notify_nova_on_port_data_changes = True
# URL for connection to nova (Only supports one nova region currently).
-nova_url = http://{{ HA_VIP }}:8774/v2
+nova_url = http://{{ internal_vip.ip }}:8774/v2
# Name of nova region to use. Useful if keystone manages more than one region
nova_region_name = regionOne
nova_admin_password = {{ NOVA_PASS }}
# Authorization URL for connection to nova in admin context.
-nova_admin_auth_url = http://{{ HA_VIP }}:35357/v2.0
+nova_admin_auth_url = http://{{ internal_vip.ip }}:35357/v2.0
# Number of seconds between sending events to nova if there are any events to send
send_events_interval = 2
# =========== end of items for agent management extension =====
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = neutron
admin_password = {{ NEUTRON_PASS }}
notify_nova_on_port_data_changes = True
# URL for connection to nova (Only supports one nova region currently).
-nova_url = http://{{ HA_VIP }}:8774/v2
+nova_url = http://{{ internal_vip.ip }}:8774/v2
# Name of nova region to use. Useful if keystone manages more than one region
nova_region_name = regionOne
nova_admin_password = {{ NOVA_PASS }}
# Authorization URL for connection to nova in admin context.
-nova_admin_auth_url = http://{{ HA_VIP }}:35357/v2.0
+nova_admin_auth_url = http://{{ internal_vip.ip }}:35357/v2.0
# Number of seconds between sending events to nova if there are any events to send
send_events_interval = 2
# =========== end of items for agent management extension =====
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = neutron
admin_password = {{ NEUTRON_PASS }}
vnc_enabled = True
vncserver_listen = {{ internal_ip }}
vncserver_proxyclient_address = {{ internal_ip }}
-novncproxy_base_url = http://{{ HA_VIP }}:6080/vnc_auto.html
+novncproxy_base_url = http://{{ internal_vip.ip }}:6080/vnc_auto.html
novncproxy_host = {{ internal_ip }}
novncproxy_port = 6080
connection = mysql://nova:{{ NOVA_DBPASS }}@{{ db_host }}/nova
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = nova
admin_password = {{ NOVA_PASS }}
[glance]
-host = {{ HA_VIP }}
+host = {{ internal_vip.ip }}
[neutron]
-url = http://{{ HA_VIP }}:9696
+url = http://{{ internal_vip.ip }}:9696
auth_strategy = keystone
admin_tenant_name = service
admin_username = neutron
admin_password = {{ NEUTRON_PASS }}
-admin_auth_url = http://{{ HA_VIP }}:35357/v2.0
+admin_auth_url = http://{{ internal_vip.ip }}:35357/v2.0
service_metadata_proxy = True
metadata_proxy_shared_secret = {{ METADATA_SECRET }}
# auth_host = 127.0.0.1
# auth_port = 35357
# auth_protocol = http
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = cinder
admin_password = {{ CINDER_PASS }}
rabbit_password = {{ RABBIT_PASS }}
my_ip = {{ storage_controller_host }}
-glance_host = {{ HA_VIP }}
+glance_host = {{ internal_vip.ip }}
glance_port = 9292
api_rate_limit = False
storage_availability_zone = nova
volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = cinder
admin_password = {{ CINDER_PASS }}
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-create --name=cinder --pass={{ CINDER_PASS }} --email=cinder@example.com
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-role-add --user=cinder --tenant=service --role=admin
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-create --name=cinder --pass={{ CINDER_PASS }} --email=cinder@example.com
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-role-add --user=cinder --tenant=service --role=admin
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-create --name=cinder --type=volume --description="OpenStack Block Storage"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 endpoint-create --service-id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-list | awk '/ volume / {print $2}') --publicurl=http://{{ HA_VIP }}:8776/v1/%\(tenant_id\)s --internalurl=http://{{ HA_VIP }}:8776/v1/%\(tenant_id\)s --adminurl=http://{{ HA_VIP }}:8776/v1/%\(tenant_id\)s
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-create --name=cinder --type=volume --description="OpenStack Block Storage"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 endpoint-create --service-id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-list | awk '/ volume / {print $2}') --publicurl=http://{{ internal_vip.ip }}:8776/v1/%\(tenant_id\)s --internalurl=http://{{ internal_vip.ip }}:8776/v1/%\(tenant_id\)s --adminurl=http://{{ internal_vip.ip }}:8776/v1/%\(tenant_id\)s
rabbit_password = {{ RABBIT_PASS }}
my_ip = {{ storage_controller_host }}
-glance_host = {{ HA_VIP }}
+glance_host = {{ internal_vip.ip }}
glance_port = 9292
api_rate_limit = False
storage_availability_zone = nova
volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = cinder
admin_password = {{ CINDER_PASS }}
# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
# ]
-OPENSTACK_HOST = "{{ HA_VIP }}"
+OPENSTACK_HOST = "{{ internal_vip.ip }}"
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
-#bind-address = {{ hostvars[inventory_hostname]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}
-bind-address = {{ HA_VIP }}
+bind-address = {{ internal_vip.ip }}
#
# * Fine Tuning
#
max_connect_errors = 8000
skip-host-cache
skip-name-resolve
-bind-address = {{ HA_VIP }}
+bind-address = {{ internal_vip.ip }}
#
# * Galera-related settings
#
# Override bind-address
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
-#bind-address={{ hostvars[inventory_hostname]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}
-bind-address={{ HA_VIP }}
+bind-address={{ internal_vip.ip }}
##
## WSREP options
# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
-wsrep_node_address={{ internal_ips[inventory_hostname] }}
+wsrep_node_address={{ internal_ip }}
# Address for incoming client connections. Autodetect by default.
#wsrep_node_incoming_address=
login_username: ADMIN
login_password: "{{ ADMIN_PASS }}"
login_tenant_name: admin
- auth_url: "http://{{ HA_VIP }}:35357/v2.0"
+ auth_url: "http://{{ internal_vip.ip }}:35357/v2.0"
name: "{{ public_net_info.network }}"
provider_network_type: "{{ public_net_info.type }}"
provider_physical_network: "{{ public_net_info.provider_network }}"
login_username: ADMIN
login_password: "{{ ADMIN_PASS }}"
login_tenant_name: admin
- auth_url: "http://{{ HA_VIP }}:35357/v2.0"
+ auth_url: "http://{{ internal_vip.ip }}:35357/v2.0"
name: "{{ public_net_info.subnet }}"
network_name: "{{ public_net_info.network }}"
cidr: "{{ public_net_info.floating_ip_cidr }}"
login_username: ADMIN
login_password: "{{ ADMIN_PASS }}"
login_tenant_name: admin
- auth_url: "http://{{ HA_VIP }}:35357/v2.0"
+ auth_url: "http://{{ internal_vip.ip }}:35357/v2.0"
name: "{{ public_net_info.router }}"
state: present
run_once: true
login_username: ADMIN
login_password: "{{ ADMIN_PASS }}"
login_tenant_name: admin
- auth_url: "http://{{ HA_VIP }}:35357/v2.0"
+ auth_url: "http://{{ internal_vip.ip }}:35357/v2.0"
router_name: "{{ public_net_info.router }}"
network_name: "{{ public_net_info.network }}"
state: present
#db_max_retries = 20
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = glance
admin_password = {{ GLANCE_PASS }}
#db_max_retries = 20
[keystone_authtoken]
-auth_uri = http://{{ HA_VIP }}:5000/v2.0
-identity_uri = http://{{ HA_VIP }}:35357
+auth_uri = http://{{ internal_vip.ip }}:5000/v2.0
+identity_uri = http://{{ internal_vip.ip }}:35357
admin_tenant_name = service
admin_user = glance
admin_password = {{ GLANCE_PASS }}
sleep 10
-glance --os-username=admin --os-password={{ ADMIN_PASS }} --os-tenant-name=admin --os-auth-url=http://{{ HA_VIP }}:35357/v2.0 image-create --name="cirros" --disk-format=qcow2 --container-format=bare --is-public=true < /opt/{{ build_in_image_name }} && touch glance.import.completed
+glance --os-username=admin --os-password={{ ADMIN_PASS }} --os-tenant-name=admin --os-auth-url=http://{{ internal_vip.ip }}:35357/v2.0 image-create --name="cirros" --disk-format=qcow2 --container-format=bare --is-public=true < /opt/{{ build_in_image_name }} && touch glance.import.completed
pass
LOG.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', filename=LOG_FILE,level=LOG.DEBUG)
-ha_vip = {{ HA_VIP }}
+ha_vip = {{ internal_vip.ip }}
LOG.info("ha_vip: %s" % ha_vip)
#ha_vip = "10.1.0.50"
retries 5
listen proxy-glance_registry_cluster
- bind {{ HA_VIP }}:9191
+ bind {{ internal_vip.ip }}:9191
option tcpka
option tcplog
balance source
{% endfor %}
listen proxy-glance_api_cluster
- bind {{ HA_VIP }}:9292
+ bind {{ internal_vip.ip }}:9292
option tcpka
option httpchk
option tcplog
{% endfor %}
listen proxy-nova-novncproxy
- bind {{ HA_VIP }}:6080
+ bind {{ internal_vip.ip }}:6080
option tcpka
option tcplog
balance source
{% endfor %}
listen proxy-network
- bind {{ HA_VIP }}:9696
+ bind {{ internal_vip.ip }}:9696
option tcpka
option tcplog
balance source
{% endfor %}
listen proxy-volume
- bind {{ HA_VIP }}:8776
+ bind {{ internal_vip.ip }}:8776
option tcpka
option httpchk
option tcplog
{% endfor %}
listen proxy-keystone_admin_cluster
- bind {{ HA_VIP }}:35357
+ bind {{ internal_vip.ip }}:35357
option tcpka
option httpchk
option tcplog
{% endfor %}
listen proxy-keystone_public_internal_cluster
- bind {{ HA_VIP }}:5000
+ bind {{ internal_vip.ip }}:5000
option tcpka
option httpchk
option tcplog
{% endfor %}
listen proxy-nova_compute_api_cluster
- bind {{ HA_VIP }}:8774
+ bind {{ internal_vip.ip }}:8774
mode tcp
option httpchk
option tcplog
{% endfor %}
listen proxy-nova_metadata_api_cluster
- bind {{ HA_VIP }}:8775
+ bind {{ internal_vip.ip }}:8775
option tcpka
option tcplog
balance source
{% endfor %}
listen proxy-cinder_api_cluster
- bind {{ HA_VIP }}:8776
+ bind {{ internal_vip.ip }}:8776
mode tcp
option httpchk
option tcplog
global_defs {
-
- notification_email{
- root@huawei.com
- }
-
- notification_email_from keepalived@huawei.com
-
- smtp_server localhost
-
- smtp_connect_timeout 30
-
- router_id NodeA
-
+ router_id {{ inventory_hostname }}
}
-vrrp_instance VI_1 {
- interface {{ INTERNAL_INTERFACE }}
- virtual_router_id 51
+vrrp_instance internal_vip {
+ interface {{ internal_vip.interface }}
+ virtual_router_id {{ vrouter_id_internal }}
state BACKUP
nopreempt
+ preempt_delay 30
advert_int 1
-{% for host in groups['controller'] %}
-{% if host == inventory_hostname %}
- priority {{ 100 - loop.index0 * 5 }}
-{% endif %}
-{% endfor %}
+ priority 100
authentication {
auth_type PASS
- auth_pass 1111
+ auth_pass 1234
}
virtual_ipaddress {
- {{ HA_VIP }} dev {{ INTERNAL_INTERFACE }}
+ {{ internal_vip.ip }}/{{ internal_vip.netmask }} dev {{ internal_vip.interface }}
}
notify_master "/usr/local/bin/notify.sh master"
notify_backup "/usr/local/bin/notify.sh backup"
+
}
+#vrrp_instance public_vip {
+# interface {{ network_cfg.public_vip.interface }}
+# virtual_router_id {{ vrouter_id_public }}
+# state BACKUP
+# nopreempt
+# preempt_delay 30
+# advert_int 1
+# priority 100
+#
+# authentication {
+# auth_type PASS
+# auth_pass 4321
+# }
+#
+# virtual_ipaddress {
+# {{ network_cfg.public_vip.ip }}/{{ network_cfg.public_vip.netmask }} dev {{ network_cfg.public_vip.interface }}
+# }
+#
+#}
+#
+# notify_backup "/usr/local/bin/notify.sh backup"
# Verify the Identity Service installation
export OS_PASSWORD={{ ADMIN_PASS }}
export OS_TENANT_NAME=admin
-export OS_AUTH_URL=http://{{ HA_VIP }}:35357/v2.0
+export OS_AUTH_URL=http://{{ internal_vip.ip }}:35357/v2.0
export OS_USERNAME=ADMIN
export OS_USERNAME=demo
export OS_PASSWORD={{ DEMO_PASS }}
export OS_TENANT_NAME=demo
-export OS_AUTH_URL=http://{{ HA_VIP }}:35357/v2.0
+export OS_AUTH_URL=http://{{ internal_vip.ip }}:35357/v2.0
set -e
-while ! keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-list; do
+while ! keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-list; do
echo "not ready"
sleep 1
done
# create an administrative user
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 role-create --name=admin
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 tenant-create --name=admin --description="Admin Tenant"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-create --name=admin --pass={{ ADMIN_PASS }} --tenant=admin --email=admin@admin.com
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-role-add --user=admin --tenant=admin --role=admin
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 role-create --name=admin
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 tenant-create --name=admin --description="Admin Tenant"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-create --name=admin --pass={{ ADMIN_PASS }} --tenant=admin --email=admin@admin.com
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-role-add --user=admin --tenant=admin --role=admin
# create a normal user
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 tenant-create --name=demo --description="Demo Tenant"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-create --name=demo --pass={{ DEMO_PASS }} --tenant=demo --email=DEMO_EMAIL
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 tenant-create --name=demo --description="Demo Tenant"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-create --name=demo --pass={{ DEMO_PASS }} --tenant=demo --email=DEMO_EMAIL
# create a service tenant
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 tenant-create --name=service --description="Service Tenant"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 tenant-create --name=service --description="Service Tenant"
# regist keystone
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-create --name=keystone --type=identity --description="OpenStack Identity"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 endpoint-create --service_id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-list | awk '/ identity / {print $2}') --publicurl=http://{{ HA_VIP }}:5000/v2.0 --internalurl=http://{{ HA_VIP }}:5000/v2.0 --adminurl=http://{{ HA_VIP }}:35357/v2.0
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-create --name=keystone --type=identity --description="OpenStack Identity"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 endpoint-create --service_id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-list | awk '/ identity / {print $2}') --publicurl=http://{{ internal_vip.ip }}:5000/v2.0 --internalurl=http://{{ internal_vip.ip }}:5000/v2.0 --adminurl=http://{{ internal_vip.ip }}:35357/v2.0
# Create a glance user that the Image Service can use to authenticate with the Identity service
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-create --name=glance --pass={{ GLANCE_PASS }} --email=glance@example.com
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-role-add --user=glance --tenant=service --role=admin
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-create --name=glance --pass={{ GLANCE_PASS }} --email=glance@example.com
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-role-add --user=glance --tenant=service --role=admin
#Register the Image Service with the Identity service so that other OpenStack services can locate it
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-create --name=glance --type=image --description="OpenStack Image Service"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 endpoint-create --service-id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-list | awk '/ image / {print $2}') --publicurl=http://{{ HA_VIP }}:9292 --internalurl=http://{{ HA_VIP }}:9292 --adminurl=http://{{ HA_VIP }}:9292
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-create --name=glance --type=image --description="OpenStack Image Service"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 endpoint-create --service-id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-list | awk '/ image / {print $2}') --publicurl=http://{{ internal_vip.ip }}:9292 --internalurl=http://{{ internal_vip.ip }}:9292 --adminurl=http://{{ internal_vip.ip }}:9292
#Create a nova user that Compute uses to authenticate with the Identity Service
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-create --name=nova --pass={{ NOVA_PASS }} --email=nova@example.com
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-role-add --user=nova --tenant=service --role=admin
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-create --name=nova --pass={{ NOVA_PASS }} --email=nova@example.com
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-role-add --user=nova --tenant=service --role=admin
# register Compute with the Identity Service so that other OpenStack services can locate it
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-create --name=nova --type=compute --description="OpenStack Compute"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 endpoint-create --service-id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-list | awk '/ compute / {print $2}') --publicurl=http://{{ HA_VIP }}:8774/v2/%\(tenant_id\)s --internalurl=http://{{ HA_VIP }}:8774/v2/%\(tenant_id\)s --adminurl=http://{{ HA_VIP }}:8774/v2/%\(tenant_id\)s
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-create --name=nova --type=compute --description="OpenStack Compute"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 endpoint-create --service-id=$(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-list | awk '/ compute / {print $2}') --publicurl=http://{{ internal_vip.ip }}:8774/v2/%\(tenant_id\)s --internalurl=http://{{ internal_vip.ip }}:8774/v2/%\(tenant_id\)s --adminurl=http://{{ internal_vip.ip }}:8774/v2/%\(tenant_id\)s
# register netron user, role and service
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-create --name neutron --pass {{ NEUTRON_PASS }} --email neutron@example.com
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 user-role-add --user neutron --tenant service --role admin
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-create --name neutron --type network --description "OpenStack Networking"
-keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 endpoint-create --service-id $(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 service-list | awk '/ network / {print $2}') --publicurl http://{{ HA_VIP }}:9696 --adminurl http://{{ HA_VIP }}:9696 --internalurl http://{{ HA_VIP }}:9696
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-create --name neutron --pass {{ NEUTRON_PASS }} --email neutron@example.com
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 user-role-add --user neutron --tenant service --role admin
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-create --name neutron --type network --description "OpenStack Networking"
+keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 endpoint-create --service-id $(keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 service-list | awk '/ network / {print $2}') --publicurl http://{{ internal_vip.ip }}:9696 --adminurl http://{{ internal_vip.ip }}:9696 --internalurl http://{{ internal_vip.ip }}:9696
-RABBITMQ_NODE_IP_ADDRESS={{ HA_VIP }}
+RABBITMQ_NODE_IP_ADDRESS={{ internal_vip.ip }}
debug = True
# The Neutron user information for accessing the Neutron API.
-auth_url = http://{{ HA_VIP }}:5000/v2.0
+auth_url = http://{{ internal_vip.ip }}:5000/v2.0
auth_region = regionOne
# Turn off verification of the certificate for ssl
# auth_insecure = False
# endpoint_type = adminURL
# IP address used by Nova metadata server
-nova_metadata_ip = {{ HA_VIP }}
+nova_metadata_ip = {{ internal_vip.ip }}
# TCP Port used by Nova metadata server
nova_metadata_port = 8775
with_items: services | union(services_noarch)
- name: get tenant id to fill neutron.conf
- shell: keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ HA_VIP }}:35357/v2.0 tenant-get service | grep id | awk '{print $4}'
+ shell: keystone --os-token={{ ADMIN_TOKEN }} --os-endpoint=http://{{ internal_vip.ip }}:35357/v2.0 tenant-get service | grep id | awk '{print $4}'
register: NOVA_ADMIN_TENANT_ID
- name: update neutron conf
debug = True
# The Neutron user information for accessing the Neutron API.
-auth_url = http://{{ HA_VIP }}:5000/v2.0
+auth_url = http://{{ internal_vip.ip }}:5000/v2.0
auth_region = regionOne
# Turn off verification of the certificate for ssl
# auth_insecure = False
# endpoint_type = adminURL
# IP address used by Nova metadata server
-nova_metadata_ip = {{ HA_VIP }}
+nova_metadata_ip = {{ internal_vip.ip }}
# TCP Port used by Nova metadata server
nova_metadata_port = 8775
- meta: flush_handlers
-- include: igmp-router.yml
- when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }} and ansible_os_family == 'Debian'"
+#- include: igmp-router.yml
+# when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }} and ansible_os_family == 'Debian'"
- name: assert kernel support for vxlan
command: modinfo -F version vxlan
interfaces {
restore-original-config-on-shutdown: false
- interface {{ hostvars[inventory_hostname][neutron_vxlan_interface|default(internal_interface)]['device'] }} {
+ interface {{ internal_nic }} {
description: "Internal pNodes interface"
disable: false
default-system-config
protocols {
igmp {
disable: false
- interface {{ hostvars[inventory_hostname][neutron_vxlan_interface|default(internal_interface)]['device'] }} {
- vif {{ hostvars[inventory_hostname][neutron_vxlan_interface|default(internal_interface)]['device'] }} {
+ interface {{ internal_nic }} {
+ vif {{ internal_nic }} {
disable: false
version: 3
}
debug = True
# The Neutron user information for accessing the Neutron API.
-auth_url = http://{{ HA_VIP }}:5000/v2.0
+auth_url = http://{{ internal_vip.ip }}:5000/v2.0
auth_region = regionOne
# Turn off verification of the certificate for ssl
# auth_insecure = False
# endpoint_type = adminURL
# IP address used by Nova metadata server
-nova_metadata_ip = {{ HA_VIP }}
+nova_metadata_ip = {{ internal_vip.ip }}
# TCP Port used by Nova metadata server
nova_metadata_port = 8775
xorp_packages:
- openssl098e
-# - xorp
+ #- xorp
debug = True
# The Neutron user information for accessing the Neutron API.
-auth_url = http://{{ HA_VIP }}:5000/v2.0
+auth_url = http://{{ internal_vip.ip }}:5000/v2.0
auth_region = regionOne
# Turn off verification of the certificate for ssl
# auth_insecure = False
# endpoint_type = adminURL
# IP address used by Nova metadata server
-nova_metadata_ip = {{ HA_VIP }}
+nova_metadata_ip = {{ internal_vip.ip }}
# TCP Port used by Nova metadata server
nova_metadata_port = 8775
# service openvswitch-switch start ;
- name: Set OpenDaylight as the manager
- command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ HA_VIP }}:6640;"
+ command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ internal_vip.ip }}:6640;"
#- name: start and disable Neutron's agent services
# service: name=neutron-plugin-openvswitch-agent state=started
remote {
log-remote-lifecycle-events = off
netty.tcp {
- hostname = "{{ hostvars[inventory_hostname]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}"
+ hostname = "{{ hostvars[inventory_hostname]['ansible_' + internal_nic].ipv4.address }}"
port = 2550
maximum-frame-size = 419430400
send-buffer-size = 52428800
seed-nodes = [
{% for host in groups['odl'] %}
{% if loop.last %}
- "akka.tcp://opendaylight-cluster-data@{{ hostvars[host]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}:2550"
+ "akka.tcp://opendaylight-cluster-data@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2550"
{% else %}
- "akka.tcp://opendaylight-cluster-data@{{ hostvars[host]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}:2550",
+ "akka.tcp://opendaylight-cluster-data@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2550",
{% endif %}
{% endfor %}
]
{% set key = 0 %}
{% for host in groups['odl'] %}
{% set key = key + 1 %}
- {% if hostvars[host]['ansible_' + INTERNAL_INTERFACE].ipv4.address == hostvars[inventory_hostname]['ansible_' + INTERNAL_INTERFACE].ipv4.address %}
+ {% if hostvars[host]['ansible_' + internal_nic].ipv4.address == hostvars[inventory_hostname]['ansible_' + internal_nic].ipv4.address %}
"member-{{ key }}"
{% endif %}
{% endfor %}
remote {
log-remote-lifecycle-events = off
netty.tcp {
- hostname = "{{ hostvars[inventory_hostname]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}"
+ hostname = "{{ hostvars[inventory_hostname]['ansible_' + internal_nic].ipv4.address }}"
port = 2551
}
}
seed-nodes = [
{% for host in groups['odl'] %}
{% if loop.last %}
- "akka.tcp://odl-cluster-rpc@{{ hostvars[host]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}:2551"
+ "akka.tcp://odl-cluster-rpc@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2551"
{% else %}
- "akka.tcp://odl-cluster-rpc@{{ hostvars[host]['ansible_' + INTERNAL_INTERFACE].ipv4.address }}:2551",
+ "akka.tcp://odl-cluster-rpc@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2551",
{% endif %}
{% endfor %}
]
[ml2_odl]
password = admin
username = admin
-url = http://{{ HA_VIP }}:8080/controller/nb/v2/neutron
+url = http://{{ internal_vip.ip }}:8080/controller/nb/v2/neutron
EOT
when: 'item["type"] == "ovs"'
- name: setup sys intf
- shell: ip link del {{ item["name"] }}; \
- ip link add link {{ item["interface"] }} name {{ item["name"] }} type vlan id {{ item["vlan_tag"] }}; \
- ip link set {{ item["interface"] }} up
- when: '"vlan_tag" in item'
- with_items: "{{ network_cfg['sys_intf_mappings'] }}"
+ shell: ip link del {{ item.key }}; \
+ ip link add link {{ item.value["interface"] }} name {{ item.key }} type vlan id {{ item.value["vlan_tag"] }}; \
+ ip link set {{ item.value["interface"] }} up
+ when: '"vlan_tag" in item.value and item.value["type"] == "vlan"'
+ with_dict: "{{ sys_intf_mappings }}"
- name: set sys intf ip
- shell: ip addr del {{ item["ip"] }}/{{ item["netmask"] }} dev {{ item["alias"] }}; \
- ip addr add {{ item["ip"] }}/{{ item["netmask"] }} dev {{ item["alias"] }}; \
- ip link set {{ item["alias"] }} up
- with_items: "{{ host_ip_settings }}"
+ shell: ip addr del {{ item.value["ip"] }}/{{ item.value["netmask"] }} dev {{ item.value["alias"] }}; \
+ ip addr add {{ item.value["ip"] }}/{{ item.value["netmask"] }} dev {{ item.value["alias"] }}; \
+ ip link set {{ item.value["alias"] }} up
+ with_dict: "{{ host_ip_settings }}"
- name: set gateway
shell: ip route del default; \
- ip route add default via {{ item["gw"] }} dev {{ item["alias"] }}
- when: '"gw" in item'
- with_items: "{{ host_ip_settings }}"
+ ip route add default via {{ item.value["gw"] }} dev {{ item.key }}
+ when: '"gw" in item.value'
+ with_dict: "{{ host_ip_settings }}"
- name: copy net config
template: src=my_configs.debian dest=/etc/network/interfaces.d/my_configs.cfg
-{%- for intf in host_ip_settings %}
+{%- for alias, intf in host_ip_settings.items() %}
-auto {{ intf["alias"] }}
-iface {{ intf["alias"] }} inet static
+auto {{ alias }}
+iface {{ alias }} inet static
address {{ intf["ip"] }}
netmask {{ intf["netmask"] }}
{% if "gw" in intf %}
gateway {{ intf["gw"] }}
{% endif %}
-{% for sys_intf in network_cfg["sys_intf_mappings"] %}
-{% if "vlan_tag" in sys_intf and sys_intf["name"] == intf["alias"] %}
- pre-up ip link set {{ sys_intf["interface"] }} up
- pre-up ip link add link {{ sys_intf["interface"] }} name {{ sys_intf["name"] }} type vlan id {{ sys_intf["vlan_tag"] }}
+{% if intf["name"] == alias %}
+ pre-up ip link set {{ sys_intf_mappings[alias]["interface"] }} up
+ pre-up ip link add link {{ sys_intf_mappings[alias]["interface"] }} name {{ alias }} type vlan id {{ sys_intf_mappings[alias]["vlan_tag"] }}
{% endif %}
{% endfor %}
-{% endfor %}
- name: mgmt
interface: eth1
vlan_tag: 2
+ type: vlan
role:
- controller
- compute
- name: storage
interface: eth1
vlan_tag: 3
+ type: vlan
role:
- controller
- compute
- name: external
interface: br-prv
vlan_tag: 4
+ type: vlan
role:
- controller
- compute
- controller
- compute
+internal_vip:
+ ip: 172.16.1.222
+ netmask: "24"
+ interface: mgmt
+
+public_vip:
+ ip: 172.16.3.222
+ netmask: "24"
+ interface: external
+
public_net_info:
enable: False
network: ext-net