Add the ability to disable hosts in inventory

It is possible, you don't want to run windmill on a specific host.
Rather then removing the host from the inventory file, you can now place
it in the disabled inventory group and our playbooks will skip it.

This logic is used by the opendev team when running ansible-playbooks
against their control plane.

Change-Id: I717fc4b951c16c5df6286bfe13f0fe5701cf7abb
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-01-18 13:03:37 -05:00
parent eb2d859e87
commit 14c6144ee9
14 changed files with 21 additions and 19 deletions

View File

@ -1,5 +1,7 @@
bastion ansible_connection=local
[disabled]
[gear]
gear01 ansible_host=127.0.2.1

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Bootstrap nodes
hosts: all,!bastion
hosts: all:!bastion:!disabled
pre_tasks:
- name: Update apt cache
@ -29,7 +29,7 @@
name: openstack.sudoers
- name: Bootstrap python dependencies for windmill
hosts: all,!bastion,!zookeeper
hosts: all:!bastion:!zookeeper:!disabled
tasks:
- name: Setup openstack.virtualenv role

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install gear.
hosts: gear
hosts: gear:!disabled
tasks:
- name: Setup openstack.gearman role

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install nodepool-builder
hosts: nodepool-builder
hosts: nodepool-builder:!disabled
post_tasks:
- name: Run nodepool-server validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install nodepool-launcher
hosts: nodepool-launcher
hosts: nodepool-launcher:!disabled
post_tasks:
- name: Run nodepool-launcher validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Bootstrap nodepool hosts
hosts: nodepool
hosts: nodepool:!disabled
tasks:
# NOTE(pabelanger): Because of ordering issues create the required home
@ -26,7 +26,7 @@
- pre
- name: Bootstrap nodepool-builder
hosts: nodepool-builder
hosts: nodepool-builder:!disabled
tasks:
- name: Setup openstack.ssh role
@ -48,7 +48,7 @@
src: "{{ windmill_config_git_dest }}/nodepool/elements"
- name: Bootstrap nodepool hosts
hosts: nodepool
hosts: nodepool:!disabled
tasks:
- name: Setup openstack.openstacksdk role

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install statsd.
hosts: statsd
hosts: statsd:!disabled
tasks:
- name: Setup openstack.statsd role.

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install zookeeper
hosts: zookeeper
hosts: zookeeper:!disabled
tasks:
- name: Setup openstack.zookeeper role

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install zuul-executor
hosts: zuul-executor
hosts: zuul-executor:!disabled
post_tasks:
- name: Run zuul-executor validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install zuul-fingergw
hosts: zuul-fingergw
hosts: zuul-fingergw:!disabled
post_tasks:
- name: Run zuul-fingergw validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install zuul-merger
hosts: zuul-merger
hosts: zuul-merger:!disabled
post_tasks:
- name: Run zuul-merger validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install zuul-scheduler
hosts: zuul-scheduler
hosts: zuul-scheduler:!disabled
post_tasks:
- name: Run zuul-scheduler validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Install zuul-web
hosts: zuul-web
hosts: zuul-web:!disabled
post_tasks:
- name: Run zuul-web validation

View File

@ -13,7 +13,7 @@
# under the License.
---
- name: Bootstrap SSH keys for zuul-connections
hosts: zuul-connections
hosts: zuul-connections:!disabled
tasks:
# NOTE(pabelanger): Because of ordering issues create the required home
@ -39,7 +39,7 @@
ssh_user_home: "{{ item.ssh_user_home }}"
- name: Bootstrap zuul-executor
hosts: zuul-executor
hosts: zuul-executor:!disabled
tasks:
- name: Setup openstack.ssh role
@ -55,7 +55,7 @@
state: present
- name: Install zuul
hosts: zuul
hosts: zuul:!disabled
tasks:
- name: Setup openstack.zuul role
@ -67,7 +67,7 @@
name: openstack.logrotate
- name: Bootstrap zuul-web
hosts: zuul-web
hosts: zuul-web:!disabled
tasks:
- name: Setup openstack.nginx role