diff --git a/ansible/roles/cinder/tasks/main.yml b/ansible/roles/cinder/tasks/main.yml index 4c44e7aecd..184b97a273 100644 --- a/ansible/roles/cinder/tasks/main.yml +++ b/ansible/roles/cinder/tasks/main.yml @@ -1,6 +1,12 @@ --- - include: ceph.yml - when: enable_ceph | bool + when: + - enable_ceph | bool + - inventory_hostname in groups['ceph-mon'] or + inventory_hostname in groups['cinder-api'] or + inventory_hostname in groups['cinder-volume'] or + inventory_hostname in groups['cinder-scheduler'] or + inventory_hostname in groups['cinder-backup'] - include: register.yml when: inventory_hostname in groups['cinder-api'] or diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index ac021e8193..86f99c12a1 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -59,8 +59,9 @@ lock_path = /var/lib/cinder/tmp [oslo_messaging_rabbit] rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} -rabbit_host = {{ kolla_internal_address }} rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} + {% if cinder_volume_driver == "lvm" %} [lvmdriver-1] diff --git a/ansible/roles/glance/tasks/main.yml b/ansible/roles/glance/tasks/main.yml index 39c541d0b1..3370da4c1f 100644 --- a/ansible/roles/glance/tasks/main.yml +++ b/ansible/roles/glance/tasks/main.yml @@ -1,6 +1,10 @@ --- - include: ceph.yml - when: enable_ceph | bool + when: + - enable_ceph | bool + - inventory_hostname in groups['ceph-mon'] or + inventory_hostname in groups['glance-api'] or + inventory_hostname in groups['glance-registry'] - include: register.yml when: inventory_hostname in groups['glance-api'] or diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index 3e31edb0e3..aa214f7379 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -35,14 +35,6 @@ listen mariadb {% endif %} {% if enable_rabbitmq | bool %} -listen rabbitmq - mode tcp - option tcpka - bind {{ kolla_internal_address }}:{{ rabbitmq_port }} -{% for host in groups['rabbitmq'] %} - server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }} check inter 2000 rise 2 fall 5 -{% endfor %} - listen rabbitmq_management bind {{ kolla_internal_address }}:{{ rabbitmq_management_port }} {% for host in groups['rabbitmq'] %} diff --git a/ansible/roles/heat/tasks/main.yml b/ansible/roles/heat/tasks/main.yml index 5c48120b7c..52e4eef7e6 100644 --- a/ansible/roles/heat/tasks/main.yml +++ b/ansible/roles/heat/tasks/main.yml @@ -1,8 +1,20 @@ --- - include: register.yml + when: inventory_hostname in groups['heat-api'] or + inventory_hostname in groups['heat-api-cfn'] or + inventory_hostname in groups['heat-engine'] - include: config.yml + when: inventory_hostname in groups['heat-api'] or + inventory_hostname in groups['heat-api-cfn'] or + inventory_hostname in groups['heat-engine'] - include: bootstrap.yml + when: inventory_hostname in groups['heat-api'] or + inventory_hostname in groups['heat-api-cfn'] or + inventory_hostname in groups['heat-engine'] - include: start.yml + when: inventory_hostname in groups['heat-api'] or + inventory_hostname in groups['heat-api-cfn'] or + inventory_hostname in groups['heat-engine'] diff --git a/ansible/roles/heat/templates/heat.conf.j2 b/ansible/roles/heat/templates/heat.conf.j2 index e074f75ad0..a03f2fb003 100644 --- a/ansible/roles/heat/templates/heat.conf.j2 +++ b/ansible/roles/heat/templates/heat.conf.j2 @@ -15,10 +15,10 @@ syslog_log_facility=LOG_LOCAL0 use_syslog=yes [oslo_messaging_rabbit] -rabbit_host = {{ kolla_internal_address }} rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} {% if service_name == 'heat-api' %} [heat_api] diff --git a/ansible/roles/ironic/tasks/main.yml b/ansible/roles/ironic/tasks/main.yml index 5c48120b7c..4bc9641255 100644 --- a/ansible/roles/ironic/tasks/main.yml +++ b/ansible/roles/ironic/tasks/main.yml @@ -1,8 +1,24 @@ --- - include: register.yml + when: inventory_hostname in groups['ironic-api'] or + inventory_hostname in groups['ironic-conductor'] or + inventory_hostname in groups['ironic-discoverd'] or + inventory_hostname in groups['ironic-pxe'] - include: config.yml + when: inventory_hostname in groups['ironic-api'] or + inventory_hostname in groups['ironic-conductor'] or + inventory_hostname in groups['ironic-discoverd'] or + inventory_hostname in groups['ironic-pxe'] - include: bootstrap.yml + when: inventory_hostname in groups['ironic-api'] or + inventory_hostname in groups['ironic-conductor'] or + inventory_hostname in groups['ironic-discoverd'] or + inventory_hostname in groups['ironic-pxe'] - include: start.yml + when: inventory_hostname in groups['ironic-api'] or + inventory_hostname in groups['ironic-conductor'] or + inventory_hostname in groups['ironic-discoverd'] or + inventory_hostname in groups['ironic-pxe'] diff --git a/ansible/roles/ironic/templates/ironic.conf.j2 b/ansible/roles/ironic/templates/ironic.conf.j2 index 6860aee12d..e37001dca3 100644 --- a/ansible/roles/ironic/templates/ironic.conf.j2 +++ b/ansible/roles/ironic/templates/ironic.conf.j2 @@ -24,7 +24,7 @@ glance_host = {{ kolla_internal_address }} url = http://{{ kolla_internal_address }}:{{ neutron_server_port }} [oslo_messaging_rabbit] -rabbit_host = {{ kolla_internal_address }} rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} diff --git a/ansible/roles/murano/tasks/main.yml b/ansible/roles/murano/tasks/main.yml index 5c48120b7c..a76d0866dd 100644 --- a/ansible/roles/murano/tasks/main.yml +++ b/ansible/roles/murano/tasks/main.yml @@ -1,8 +1,16 @@ --- - include: register.yml + when: inventory_hostname in groups['murano-api'] or + inventory_hostname in groups['murano-engine'] - include: config.yml + when: inventory_hostname in groups['murano-api'] or + inventory_hostname in groups['murano-engine'] - include: bootstrap.yml + when: inventory_hostname in groups['murano-api'] or + inventory_hostname in groups['murano-engine'] - include: start.yml + when: inventory_hostname in groups['murano-api'] or + inventory_hostname in groups['murano-engine'] diff --git a/ansible/roles/murano/templates/murano.conf.j2 b/ansible/roles/murano/templates/murano.conf.j2 index db4192e37f..760576baf5 100644 --- a/ansible/roles/murano/templates/murano.conf.j2 +++ b/ansible/roles/murano/templates/murano.conf.j2 @@ -2,9 +2,6 @@ verbose = {{ openstack_logging_verbose }} debug = {{ openstack_logging_debug }} -rabbit_host = {{ kolla_internal_address }} -rabbit_userid = {{ rabbitmq_user }} -rabbit_password = {{ rabbitmq_password }} notification_driver = noop use_syslog = True @@ -31,9 +28,8 @@ password = {{ murano_keystone_password }} [murano] url = http://{{ kolla_internal_address }}:{{ murano_api_port }} -{% if service_name == 'murano-engine' %} -[rabbitmq] -host = {{ kolla_internal_address }} -login = {{ rabbitmq_user }} -password = {{ rabbitmq_password }} -{% endif %} +[oslo_messaging_rabbit] +rabbit_userid = {{ rabbitmq_user }} +rabbit_password = {{ rabbitmq_password }} +rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} diff --git a/ansible/roles/neutron/tasks/main.yml b/ansible/roles/neutron/tasks/main.yml index 3ff2244691..f8eff9ba93 100644 --- a/ansible/roles/neutron/tasks/main.yml +++ b/ansible/roles/neutron/tasks/main.yml @@ -3,9 +3,21 @@ - include: ironic-check.yml - include: register.yml + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] or + inventory_hostname in groups['neutron-server'] - include: config.yml + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] or + inventory_hostname in groups['neutron-server'] - include: bootstrap.yml + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] or + inventory_hostname in groups['neutron-server'] - include: start.yml + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] or + inventory_hostname in groups['neutron-server'] diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index 65013c2fb6..787cbb7d17 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -38,10 +38,10 @@ password = {{ nova_keystone_password }} lock_path = /var/lib/neutron/tmp [oslo_messaging_rabbit] -rabbit_host = {{ kolla_internal_address }} rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} [agent] root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf diff --git a/ansible/roles/nova/tasks/main.yml b/ansible/roles/nova/tasks/main.yml index 19a5a4fb3f..869235f35e 100644 --- a/ansible/roles/nova/tasks/main.yml +++ b/ansible/roles/nova/tasks/main.yml @@ -1,35 +1,43 @@ --- - include: ceph.yml - when: enable_ceph | bool + when: + - enable_ceph | bool + - inventory_hostname in groups['ceph-mon'] or + inventory_hostname in groups['compute'] or + inventory_hostname in groups['nova-api'] or + inventory_hostname in groups['nova-conductor'] or + inventory_hostname in groups['nova-consoleauth'] or + inventory_hostname in groups['nova-novncproxy'] or + inventory_hostname in groups['nova-scheduler'] - include: register.yml - when: inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-consoleauth'] or + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['nova-api'] or inventory_hostname in groups['nova-conductor'] or + inventory_hostname in groups['nova-consoleauth'] or inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] or - inventory_hostname in groups['compute'] + inventory_hostname in groups['nova-scheduler'] - include: config.yml - when: inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-consoleauth'] or + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['nova-api'] or inventory_hostname in groups['nova-conductor'] or + inventory_hostname in groups['nova-consoleauth'] or inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] or - inventory_hostname in groups['compute'] + inventory_hostname in groups['nova-scheduler'] - include: bootstrap.yml - when: inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-consoleauth'] or + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['nova-api'] or inventory_hostname in groups['nova-conductor'] or + inventory_hostname in groups['nova-consoleauth'] or inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] or - inventory_hostname in groups['compute'] + inventory_hostname in groups['nova-scheduler'] - include: start.yml - when: inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-consoleauth'] or + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['nova-api'] or inventory_hostname in groups['nova-conductor'] or + inventory_hostname in groups['nova-consoleauth'] or inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] or - inventory_hostname in groups['compute'] + inventory_hostname in groups['nova-scheduler'] diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index 847728cad9..6192a2a6e2 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -83,10 +83,10 @@ api_endpoint = http://{{ kolla_internal_address }}:{{ ironic_api_port }}/v1 {% endif %} [oslo_messaging_rabbit] -rabbit_host = {{ kolla_internal_address }} rabbit_userid = {{ rabbitmq_user }} rabbit_password = {{ rabbitmq_password }} rabbit_ha_queues = true +rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} [oslo_concurrency] lock_path = /var/lib/nova/tmp diff --git a/ansible/roles/swift/tasks/main.yml b/ansible/roles/swift/tasks/main.yml index 5c48120b7c..47592b8746 100644 --- a/ansible/roles/swift/tasks/main.yml +++ b/ansible/roles/swift/tasks/main.yml @@ -1,8 +1,24 @@ --- - include: register.yml + when: inventory_hostname in groups['swift-account-server'] or + inventory_hostname in groups['swift-container-server'] or + inventory_hostname in groups['swift-object-server'] or + inventory_hostname in groups['swift-proxy-server'] - include: config.yml + when: inventory_hostname in groups['swift-account-server'] or + inventory_hostname in groups['swift-container-server'] or + inventory_hostname in groups['swift-object-server'] or + inventory_hostname in groups['swift-proxy-server'] - include: bootstrap.yml + when: inventory_hostname in groups['swift-account-server'] or + inventory_hostname in groups['swift-container-server'] or + inventory_hostname in groups['swift-object-server'] or + inventory_hostname in groups['swift-proxy-server'] - include: start.yml + when: inventory_hostname in groups['swift-account-server'] or + inventory_hostname in groups['swift-container-server'] or + inventory_hostname in groups['swift-object-server'] or + inventory_hostname in groups['swift-proxy-server'] diff --git a/ansible/site.yml b/ansible/site.yml index 91617fb658..f5feddd349 100755 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -48,10 +48,11 @@ when: enable_keystone | bool } - hosts: - - swift-account-server - - swift-container-server - - swift-object-server - - swift-proxy-server + - swift-account-server + - swift-container-server + - swift-object-server + - swift-proxy-server + - rabbitmq roles: - { role: swift, tags: swift, @@ -61,6 +62,7 @@ - ceph-mon - glance-api - glance-registry + - rabbitmq roles: - { role: glance, tags: glance, @@ -75,6 +77,7 @@ - nova-consoleauth - nova-novncproxy - nova-scheduler + - rabbitmq roles: - { role: nova, tags: nova, @@ -84,6 +87,7 @@ - compute - neutron-agents - neutron-server + - rabbitmq roles: - { role: neutron, tags: neutron, @@ -95,6 +99,7 @@ - cinder-backup - cinder-scheduler - cinder-volume + - rabbitmq roles: - { role: cinder, tags: cinder, @@ -104,6 +109,7 @@ - heat-api - heat-api-cfn - heat-engine + - rabbitmq roles: - { role: heat, tags: heat, @@ -118,6 +124,7 @@ - hosts: - murano-api - murano-engine + - rabbitmq roles: - { role: murano, tags: murano, @@ -128,6 +135,7 @@ - ironic-conductor - ironic-discoverd - ironic-pxe + - rabbitmq roles: - { role: ironic, tags: ironic,