kolla/ansible/site.yml
Andrew Widdersheim 4963898b21 Remove redundant common play and add haproxy hosts
In cf0c25c37 [0] a play was added to run the common role against all
hosts. This ends up being redundant since every role includes the common
role as a dependancy. The reasoning behind this change as pointed out by
the author in the review comments [1] was so that an operator could run
with '--tags common' and just have the common role applied.

To avoid redundancy, the common play has been removed and tags have been
added to the common role. This allows for just the common role to run
when another role is including it while reducing redundancy.

A side affect of removing the common playbook which runs against all
hosts is that not all facts on all hosts are gathered at the beginning
of the site.yml. This breaks the haproxy role since it relies heavily on
facts to build out the haproxy.cfg file.

Previously, the haproxy role would include several hosts purely for fact
gathering purposes as pointed out in c68c9d95 [2] and a guard was put in
place so that the tasks would only run against the 'haproxy' group. In
423e3f3f [3] these hosts were removed. After reading the review [4],
this seems to have been done without fully understanding why the hosts
were there in the first place.

This change did not break anything however since the common role that
ran on all hosts mentioned previously would gather all of the facts
necessary.

To fix this fact gathering issue replace the common role play with a
play that will simply gather facts with an 'always' tag to ensure it is
run regardless of what might be passed in the '--tags' argument by the
operator.

Kudos to Paul Bourke for helping identify many of these issues.

[0] cf0c25c37d
[1] https://review.openstack.org/#/c/369212/
[2] c68c9d95fc
[3] 423e3f3fdf
[4] https://review.openstack.org/#/c/355861

TrivialFix
Closes-Bug: #1628472

Change-Id: Ia94146579e743935501f1ff4b4c1bf6cb7c43aa3
2016-09-30 11:56:42 -04:00

381 lines
7.7 KiB
YAML

---
# NOTE(awiddersheim): Gather facts for all hosts as a
# first step since several plays below require them when
# building their configurations. The below 'gather_facts'
# set to 'false' is a bit confusing but this is to avoid
# Ansible gathering facts twice.
- name: Gather facts for all hosts
hosts:
- all
serial: '{{ serial|default("0") }}'
gather_facts: false
tasks:
- setup:
tags: always
- hosts:
- ceph-mon
- ceph-osd
- ceph-rgw
serial: '{{ serial|default("0") }}'
roles:
- { role: ceph,
tags: ceph,
when: enable_ceph | bool }
- hosts: collectd
serial: '{{ serial|default("0") }}'
roles:
- { role: collectd,
tags: collectd,
when: enable_collectd | bool }
- hosts: elasticsearch
serial: '{{ serial|default("0") }}'
roles:
- { role: elasticsearch,
tags: elasticsearch,
when: enable_elasticsearch | bool }
- hosts: influxdb
serial: '{{ serial|default("0") }}'
roles:
- { role: influxdb,
tags: influxdb,
when: enable_influxdb | bool }
- hosts:
- telegraf
serial: '{{ serial|default("0") }}'
roles:
- { role: telegraf,
tags: telegraf,
when: enable_telegraf | bool }
- hosts:
- haproxy
roles:
- { role: haproxy,
tags: haproxy,
when: enable_haproxy | bool }
- hosts: kibana
serial: '{{ serial|default("0") }}'
roles:
- { role: kibana,
tags: kibana,
when: enable_kibana | bool }
- hosts: memcached
serial: '{{ serial|default("0") }}'
roles:
- { role: memcached,
tags: [memcache, memcached],
when: enable_memcached | bool }
- hosts: mariadb
serial: '{{ serial|default("0") }}'
roles:
- { role: mariadb,
tags: mariadb,
when: enable_mariadb | bool }
- hosts:
- iscsid
- tgtd
serial: '{{ serial|default("0") }}'
roles:
- { role: iscsi,
tags: iscsi,
when: enable_iscsid | bool }
- hosts:
- multipathd
serial: '{{ serial|default("0") }}'
roles:
- { role: multipathd,
tags: multipathd,
when: enable_multipathd | bool }
- hosts: rabbitmq
roles:
- { role: rabbitmq,
tags: rabbitmq,
when: enable_rabbitmq | bool }
- hosts: etcd
serial: '{{ serial|default("0") }}'
roles:
- { role: etcd,
tags: etcd,
when: enable_etcd | bool }
- hosts:
- keystone
serial: '{{ serial|default("0") }}'
roles:
- { role: keystone,
tags: keystone,
when: enable_keystone | bool }
- hosts:
- swift-account-server
- swift-container-server
- swift-object-server
- swift-proxy-server
serial: '{{ serial|default("0") }}'
roles:
- { role: swift,
tags: swift,
when: enable_swift | bool }
- hosts:
- ceph-mon
- glance-api
- glance-registry
serial: '{{ serial|default("0") }}'
roles:
- { role: glance,
tags: glance,
when: enable_glance | bool }
- hosts:
- ceph-mon
- compute
- nova-api
- nova-conductor
- nova-consoleauth
- nova-novncproxy
- nova-scheduler
serial: '{{ serial|default("0") }}'
roles:
- { role: nova,
tags: nova,
when: enable_nova | bool }
- hosts:
- compute
roles:
- { role: kuryr,
tags: kuryr,
when: enable_kuryr | bool }
# (gmmaha): Please do not change the order listed here. The current order is a
# workaround to fix the bug https://bugs.launchpad.net/kolla/+bug/1546789
- hosts:
- neutron-server
- neutron-dhcp-agent
- neutron-l3-agent
- neutron-lbaas-agent
- neutron-metadata-agent
- neutron-vpnaas-agent
- compute
- manila-share
serial: '{{ serial|default("0") }}'
roles:
- { role: neutron,
tags: neutron,
when: enable_neutron | bool }
- hosts:
- ceph-mon
- cinder-api
- cinder-backup
- cinder-scheduler
- cinder-volume
serial: '{{ serial|default("0") }}'
roles:
- { role: cinder,
tags: cinder,
when: enable_cinder | bool }
- hosts:
- heat-api
- heat-api-cfn
- heat-engine
serial: '{{ serial|default("0") }}'
roles:
- { role: heat,
tags: heat,
when: enable_heat | bool }
- hosts:
- horizon
serial: '{{ serial|default("0") }}'
roles:
- { role: horizon,
tags: horizon,
when: enable_horizon | bool }
- hosts:
- murano-api
- murano-engine
serial: '{{ serial|default("0") }}'
roles:
- { role: murano,
tags: murano,
when: enable_murano | bool }
- hosts:
- ironic-api
- ironic-conductor
- ironic-inspector
- ironic-pxe
serial: '{{ serial|default("0") }}'
roles:
- { role: ironic,
tags: ironic,
when: enable_ironic | bool }
- hosts:
- magnum-api
- magnum-conductor
serial: '{{ serial|default("0") }}'
roles:
- { role: magnum,
tags: magnum,
when: enable_magnum | bool }
- hosts:
- mistral-api
- mistral-engine
- mistral-executor
serial: '{{ serial|default("0") }}'
roles:
- { role: mistral,
tags: mistral,
when: enable_mistral | bool }
- hosts:
- sahara-api
- sahara-engine
serial: '{{ serial|default("0") }}'
roles:
- { role: sahara,
tags: sahara,
when: enable_sahara | bool }
- hosts:
- mongodb
serial: '{{ serial|default("0") }}'
roles:
- { role: mongodb,
tags: mongodb,
when: enable_mongodb | bool }
- hosts:
- manila-api
- manila-share
- manila-scheduler
serial: '{{ serial|default("0") }}'
roles:
- { role: manila,
tags: manila,
when: enable_manila | bool }
- hosts:
- gnocchi-api
- gnocchi-metricd
- gnocchi-statsd
serial: '{{ serial|default("0") }}'
roles:
- { role: gnocchi,
tags: gnocchi,
when: enable_gnocchi | bool }
- hosts:
- ceilometer
- compute
serial: '{{ serial|default("0") }}'
roles:
- { role: ceilometer,
tags: ceilometer,
when: enable_ceilometer | bool }
- hosts:
- aodh
serial: '{{ serial|default("0") }}'
roles:
- { role: aodh,
tags: aodh,
when: enable_aodh | bool }
- hosts:
- barbican-api
- barbican-keystone-listener
- barbican-worker
serial: '{{ serial|default("0") }}'
roles:
- { role: barbican,
tags: barbican,
when: enable_barbican | bool }
- hosts:
- congress-api
- congress-policy-engine
- congress-datasource
serial: '{{ serial|default("0") }}'
roles:
- { role: congress,
tags: congress,
when: enable_congress | bool }
- hosts:
- tempest
serial: '{{ serial|default("0") }}'
roles:
- { role: tempest,
tags: tempest,
when: enable_tempest | bool }
- hosts: rally
serial: '{{ serial|default("0") }}'
roles:
- { role: rally,
tags: rally,
when: enable_rally | bool }
- hosts:
- vmtp
serial: '{{ serial|default("0") }}'
roles:
- { role: vmtp,
tags: vmtp,
when: enable_vmtp | bool }
- hosts:
- watcher-api
- watcher-engine
- watcher-applier
serial: '{{ serial|default("0") }}'
roles:
- { role: watcher,
tags: watcher,
when: enable_watcher | bool }
- hosts:
- grafana
serial: '{{ serial|default("0") }}'
roles:
- { role: grafana,
tags: grafana,
when: enable_grafana | bool }
- hosts:
- cloudkitty-api
- cloudkitty-processor
serial: '{{ serial|default("0") }}'
roles:
- { role: cloudkitty,
tags: cloudkitty,
when: enable_cloudkitty | bool }
- hosts:
- senlin-api
- senlin-engine
serial: '{{ serial|default("0") }}'
roles:
- { role: senlin,
tags: senlin,
when: enable_senlin | bool }