From d8fe45b3d80d1ab1767af59057dca1fa4a753a5b Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 19 Dec 2017 14:42:18 +0000 Subject: [PATCH] Tag all (well, some of) the things (plays) Having tagged plays allows us to easily run a subset of the plays for a command, and perform targeted operations with less risk of unintended consequences. The tags are typically named after the playbook, although some of the overcloud playbooks have been tagged without an overcloud- prefix. --- ansible/bootstrap.yml | 2 ++ ansible/dell-switch-bmp.yml | 2 ++ ansible/dev-tools.yml | 2 ++ ansible/disable-glean.yml | 2 ++ ansible/disable-selinux.yml | 2 ++ ansible/docker-registry.yml | 2 ++ ansible/docker.yml | 2 ++ ansible/dump-config.yml | 2 ++ ansible/inspection-store.yml | 2 ++ ansible/ip-allocation.yml | 2 ++ ansible/ip-routing.yml | 2 ++ ansible/kayobe-ansible-user.yml | 2 ++ ansible/kolla-ansible.yml | 2 ++ ansible/kolla-bifrost-hostvars.yml | 4 ++++ ansible/kolla-bifrost.yml | 2 ++ ansible/kolla-build.yml | 2 ++ ansible/kolla-host.yml | 3 +++ ansible/kolla-openstack.yml | 10 +++++++- ansible/lvm.yml | 2 ++ ansible/network.yml | 2 ++ ansible/node-exporter.yml | 2 ++ ansible/ntp.yml | 2 ++ ansible/opensm.yml | 2 ++ ansible/overcloud-bios-raid.yml | 9 ++++++++ ansible/overcloud-deprovision.yml | 2 ++ ansible/overcloud-docker-sdk-upgrade.yml | 2 ++ ansible/overcloud-etc-hosts-fixup.yml | 4 ++++ ansible/overcloud-hardware-inspect.yml | 2 ++ ...trospection-rules-dell-lldp-workaround.yml | 9 ++++++++ ansible/overcloud-introspection-rules.yml | 4 ++++ ansible/overcloud-inventory-discover.yml | 2 ++ ansible/overcloud-ipa-build.yml | 4 ++++ ansible/overcloud-ipa-images.yml | 4 ++++ ansible/overcloud-provision.yml | 2 ++ ansible/overcloud-service-config-save.yml | 2 ++ ansible/provision-net.yml | 4 ++++ ansible/public-openrc.yml | 2 ++ ansible/seed-hypervisor-libvirt-host.yml | 2 ++ ansible/seed-introspection-rules.yml | 2 ++ ansible/seed-ipa-build.yml | 2 ++ ansible/snat.yml | 2 ++ ansible/ssh-known-host.yml | 2 ++ ansible/swift-setup.yml | 2 ++ ansible/sysctl.yml | 2 ++ ansible/users.yml | 2 ++ ansible/wipe-disks.yml | 2 ++ ansible/yum.yml | 6 ++++- doc/source/release-notes.rst | 2 ++ doc/source/usage.rst | 23 +++++++++++++++++++ 49 files changed, 156 insertions(+), 2 deletions(-) diff --git a/ansible/bootstrap.yml b/ansible/bootstrap.yml index 0699edac1..3945efa9b 100644 --- a/ansible/bootstrap.yml +++ b/ansible/bootstrap.yml @@ -1,6 +1,8 @@ --- - name: Ensure configuration management host is bootstrapped hosts: localhost + tags: + - bootstrap roles: - role: bootstrap bootstrap_ssh_key_type: "{{ ssh_key_type }}" diff --git a/ansible/dell-switch-bmp.yml b/ansible/dell-switch-bmp.yml index c99142c14..5e7ba991e 100644 --- a/ansible/dell-switch-bmp.yml +++ b/ansible/dell-switch-bmp.yml @@ -4,6 +4,8 @@ - name: Ensure that a Bare Metal Provisioning (BMP) environment is configured for Dell switches on the seed hosts: seed + tags: + - dell-switch-bmp roles: - role: dell-switch-bmp # This is the Nginx web server on the seed node. diff --git a/ansible/dev-tools.yml b/ansible/dev-tools.yml index 3aa1dee41..9fd4e1b55 100644 --- a/ansible/dev-tools.yml +++ b/ansible/dev-tools.yml @@ -1,5 +1,7 @@ --- - name: Ensure development tools are installed hosts: seed-hypervisor:seed:overcloud + tags: + - dev-tools roles: - role: dev-tools diff --git a/ansible/disable-glean.yml b/ansible/disable-glean.yml index 0ca5b40bc..11a3f0108 100644 --- a/ansible/disable-glean.yml +++ b/ansible/disable-glean.yml @@ -4,5 +4,7 @@ # interfaces. In some cases this can lead to timeouts. - name: Ensure Glean is disabled and its artifacts are removed hosts: seed:overcloud + tags: + - disable-glean roles: - role: disable-glean diff --git a/ansible/disable-selinux.yml b/ansible/disable-selinux.yml index 6e2c1a439..0124879f4 100644 --- a/ansible/disable-selinux.yml +++ b/ansible/disable-selinux.yml @@ -1,6 +1,8 @@ --- - name: Disable SELinux and reboot if required hosts: seed:overcloud + tags: + - disable-selinux roles: - role: disable-selinux disable_selinux_reboot_timeout: "{{ 600 if ansible_virtualization_role == 'host' else 300 }}" diff --git a/ansible/docker-registry.yml b/ansible/docker-registry.yml index dabf57d68..02d5b5553 100644 --- a/ansible/docker-registry.yml +++ b/ansible/docker-registry.yml @@ -8,5 +8,7 @@ - name: Ensure a local Docker registry is deployed hosts: controllers[0] + tags: + - docker-registry roles: - role: docker-registry diff --git a/ansible/docker.yml b/ansible/docker.yml index e01fb8f64..4b6c8219a 100644 --- a/ansible/docker.yml +++ b/ansible/docker.yml @@ -1,6 +1,8 @@ --- - name: Ensure docker is configured hosts: docker + tags: + - docker roles: - role: docker docker_daemon_mtu: "{{ public_net_name | net_mtu | default }}" diff --git a/ansible/dump-config.yml b/ansible/dump-config.yml index 6be06a31a..94d134ad9 100644 --- a/ansible/dump-config.yml +++ b/ansible/dump-config.yml @@ -8,6 +8,8 @@ - name: Dump configuration from one or more hosts hosts: "{{ dump_hosts }}" gather_facts: "{{ dump_facts }}" + tags: + - dump-config vars: dump_path: /tmp/kayobe-dump-config dump_facts: no diff --git a/ansible/inspection-store.yml b/ansible/inspection-store.yml index cf8471ae2..6317997f5 100644 --- a/ansible/inspection-store.yml +++ b/ansible/inspection-store.yml @@ -8,6 +8,8 @@ - name: Ensure inspection store is deployed hosts: controllers[0] + tags: + - inspection-store roles: - role: inspection-store inspection_store_enabled: "{{ inspector_store_enabled }}" diff --git a/ansible/ip-allocation.yml b/ansible/ip-allocation.yml index 0c6e4252b..6d66e700d 100644 --- a/ansible/ip-allocation.yml +++ b/ansible/ip-allocation.yml @@ -1,6 +1,8 @@ --- - name: Ensure IP addresses are allocated hosts: seed-hypervisor:seed:overcloud + tags: + - ip-allocation gather_facts: no # Use serial=1 to avoid races between allocations for different hosts. serial: 1 diff --git a/ansible/ip-routing.yml b/ansible/ip-routing.yml index cbb1fac02..e3627d377 100644 --- a/ansible/ip-routing.yml +++ b/ansible/ip-routing.yml @@ -3,5 +3,7 @@ - name: Ensure IP routing is enabled hosts: seed:overcloud + tags: + - ip-routing roles: - role: ip-routing diff --git a/ansible/kayobe-ansible-user.yml b/ansible/kayobe-ansible-user.yml index 1ef76f82d..8d8d3f8fc 100644 --- a/ansible/kayobe-ansible-user.yml +++ b/ansible/kayobe-ansible-user.yml @@ -1,6 +1,8 @@ --- - name: Ensure the Kayobe Ansible user account exists hosts: seed:overcloud + tags: + - kayobe-ansible-user vars: ansible_user: "{{ bootstrap_user }}" # We can't assume that a virtualenv exists at this point, so use the system diff --git a/ansible/kolla-ansible.yml b/ansible/kolla-ansible.yml index c3fd6e51b..b6603c978 100644 --- a/ansible/kolla-ansible.yml +++ b/ansible/kolla-ansible.yml @@ -1,6 +1,8 @@ --- - name: Ensure Kolla Ansible is configured hosts: localhost + tags: + - kolla-ansible vars: # We need to reference configuration for the controller and seed nodes. # We pick the first host from each group for this. It is possible that at diff --git a/ansible/kolla-bifrost-hostvars.yml b/ansible/kolla-bifrost-hostvars.yml index ff7b92f11..8306c13aa 100644 --- a/ansible/kolla-bifrost-hostvars.yml +++ b/ansible/kolla-bifrost-hostvars.yml @@ -4,6 +4,8 @@ - name: Ensure the Bifrost overcloud inventory is initialised hosts: seed gather_facts: no + tags: + - kolla-bifrost-hostvars tasks: - name: Ensure the Bifrost host variables directory exists file: @@ -23,6 +25,8 @@ - name: Ensure the Bifrost overcloud inventory is populated hosts: overcloud gather_facts: no + tags: + - kolla-bifrost-hostvars vars: seed_host: "{{ groups['seed'][0] }}" bifrost_hostvars: diff --git a/ansible/kolla-bifrost.yml b/ansible/kolla-bifrost.yml index b9e5256b2..1dfff0983 100644 --- a/ansible/kolla-bifrost.yml +++ b/ansible/kolla-bifrost.yml @@ -1,6 +1,8 @@ --- - name: Ensure Kolla Bifrost is configured hosts: localhost + tags: + - kolla-bifrost vars: kolla_bifrost_extra_globals_path: "{{ kayobe_config_path ~ '/kolla/config/bifrost/bifrost.yml' }}" kolla_bifrost_driver_map: diff --git a/ansible/kolla-build.yml b/ansible/kolla-build.yml index 227a883f7..0f478435d 100644 --- a/ansible/kolla-build.yml +++ b/ansible/kolla-build.yml @@ -1,6 +1,8 @@ --- - name: Ensure Kolla is installed and configured hosts: container-image-builders + tags: + - kolla-build roles: - role: kolla - role: kolla-build diff --git a/ansible/kolla-host.yml b/ansible/kolla-host.yml index 31e6420aa..8903fd41f 100644 --- a/ansible/kolla-host.yml +++ b/ansible/kolla-host.yml @@ -1,6 +1,9 @@ --- - name: Ensure Kolla host services are configured hosts: controllers + tags: + - kolla-ansible + - kolla-host tasks: - name: Ensure host iSCSI services are stopped and disabled service: diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 7c0c95659..07f52f156 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -1,7 +1,9 @@ --- - - name: Check whether Ironic is enabled hosts: controllers + tags: + - kolla-ansible + - kolla-openstack tasks: - name: Create controllers group with ironic enabled group_by: @@ -9,6 +11,9 @@ - name: Ensure locally built Ironic Python Agent images are copied hosts: controllers_with_ironic_enabled_True[0] + tags: + - kolla-ansible + - kolla-openstack vars: # These are the filenames generated by overcloud-ipa-build.yml. ipa_image_name: "ipa" @@ -73,6 +78,9 @@ - name: Ensure Kolla OpenStack components are configured hosts: localhost + tags: + - kolla-ansible + - kolla-openstack vars: switch_type_to_device_type: dellos9: netmiko_dell_force10 diff --git a/ansible/lvm.yml b/ansible/lvm.yml index d27998aa7..6ee61b538 100644 --- a/ansible/lvm.yml +++ b/ansible/lvm.yml @@ -1,6 +1,8 @@ --- - name: Ensure LVM configuration is applied hosts: seed:overcloud + tags: + - lvm pre_tasks: - name: Fail if the LVM physical disks have not been configured fail: diff --git a/ansible/network.yml b/ansible/network.yml index 84aa105a7..e6be3fb09 100644 --- a/ansible/network.yml +++ b/ansible/network.yml @@ -3,6 +3,7 @@ hosts: seed-hypervisor:seed:overcloud tags: - config + - network vars: ether_interfaces: "{{ network_interfaces | net_select_ethers | list }}" bridge_interfaces: "{{ network_interfaces | net_select_bridges | list }}" @@ -73,6 +74,7 @@ hosts: network tags: - config + - network vars: veth_bridge_mtu_map: {} veth_interfaces: [] diff --git a/ansible/node-exporter.yml b/ansible/node-exporter.yml index 5a07b2663..bdf518c05 100644 --- a/ansible/node-exporter.yml +++ b/ansible/node-exporter.yml @@ -8,5 +8,7 @@ - name: Ensure Node Exporter is deployed hosts: overcloud:&docker + tags: + - node-exporter roles: - role: node-exporter diff --git a/ansible/ntp.yml b/ansible/ntp.yml index 5b28097db..9160d990c 100644 --- a/ansible/ntp.yml +++ b/ansible/ntp.yml @@ -1,6 +1,8 @@ --- - name: Ensure NTP is installed and configured hosts: seed-hypervisor:seed:overcloud + tags: + - ntp roles: - role: yatesr.timezone become: True diff --git a/ansible/opensm.yml b/ansible/opensm.yml index 7caf95b96..55f161fb7 100644 --- a/ansible/opensm.yml +++ b/ansible/opensm.yml @@ -8,5 +8,7 @@ - name: Ensure OpenSM is deployed hosts: controllers[0] + tags: + - opensm roles: - role: opensm diff --git a/ansible/overcloud-bios-raid.yml b/ansible/overcloud-bios-raid.yml index fe28b758c..f5b3b6d6b 100644 --- a/ansible/overcloud-bios-raid.yml +++ b/ansible/overcloud-bios-raid.yml @@ -9,6 +9,9 @@ - name: Group overcloud nodes by their BMC type hosts: overcloud gather_facts: no + tags: + - bios + - raid vars: # List of BMC types supporting BIOS and RAID configuration. supported_bmc_types: @@ -31,6 +34,9 @@ - name: Check whether any changes to nodes' BIOS and RAID configuration are required hosts: overcloud_with_bmcs_of_type_idrac gather_facts: no + tags: + - bios + - raid vars: # Set this to False to avoid rebooting the nodes after configuration. drac_reboot: True @@ -50,6 +56,9 @@ - name: Ensure that overcloud BIOS and RAID volumes are configured hosts: overcloud_with_bmcs_of_type_idrac gather_facts: no + tags: + - bios + - raid vars: # Set this to False to avoid rebooting the nodes after configuration. drac_reboot: True diff --git a/ansible/overcloud-deprovision.yml b/ansible/overcloud-deprovision.yml index 744d51333..956e1a5cb 100644 --- a/ansible/overcloud-deprovision.yml +++ b/ansible/overcloud-deprovision.yml @@ -3,6 +3,8 @@ - name: Ensure the overcloud nodes are deprovisioned hosts: overcloud + tags: + - deprovision vars: # Set to False to avoid waiting for the nodes to become active. wait_available: True diff --git a/ansible/overcloud-docker-sdk-upgrade.yml b/ansible/overcloud-docker-sdk-upgrade.yml index 8ce71f172..e63ace8ac 100644 --- a/ansible/overcloud-docker-sdk-upgrade.yml +++ b/ansible/overcloud-docker-sdk-upgrade.yml @@ -1,6 +1,8 @@ --- - name: Ensure docker SDK for python is installed hosts: overcloud + tags: + - docker-sdk-upgrade tasks: # Docker renamed their python SDK from docker-py to docker in the 2.0.0 # release, and also broke backwards compatibility. Kolla-ansible requires diff --git a/ansible/overcloud-etc-hosts-fixup.yml b/ansible/overcloud-etc-hosts-fixup.yml index fb89f0c52..64e26b4c3 100644 --- a/ansible/overcloud-etc-hosts-fixup.yml +++ b/ansible/overcloud-etc-hosts-fixup.yml @@ -9,6 +9,8 @@ - name: Ensure overcloud hosts' /etc/hosts does not contain provisioning network IP hosts: overcloud + tags: + - etc-hosts-fixup tasks: - name: Ensure overcloud hosts' /etc/hosts does not contain provisioning network or loopback IPs lineinfile: @@ -23,6 +25,8 @@ - name: Ensure rabbitmq containers' /etc/hosts does not contain provisioning network or loopback IPs hosts: overcloud + tags: + - etc-hosts-fixup vars: rabbitmq_containers: - rabbitmq diff --git a/ansible/overcloud-hardware-inspect.yml b/ansible/overcloud-hardware-inspect.yml index 9db957dce..56ff28099 100644 --- a/ansible/overcloud-hardware-inspect.yml +++ b/ansible/overcloud-hardware-inspect.yml @@ -3,6 +3,8 @@ - name: Ensure the overcloud nodes' hardware is inspected hosts: overcloud + tags: + - hardware-inspect vars: # Set to False to avoid waiting for the nodes to become active. wait_inspected: True diff --git a/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml b/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml index 8244cc2ba..b3e1d7278 100644 --- a/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml +++ b/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml @@ -10,6 +10,9 @@ - name: Check whether Ironic is enabled hosts: controllers + tags: + - introspection-rules + - introspection-rules-dell-lldp-workaround tasks: - name: Create controllers group with ironic enabled group_by: @@ -18,6 +21,9 @@ - name: Group controller hosts in systems requiring the workaround hosts: controllers_with_ironic_enabled_True gather_facts: False + tags: + - introspection-rules + - introspection-rules-dell-lldp-workaround tasks: - name: Group controller hosts in systems requiring the Dell switch LLDP workaround group_by: @@ -27,6 +33,9 @@ # Only required to run on a single host. hosts: controllers_require_workaround_True[0] gather_facts: False + tags: + - introspection-rules + - introspection-rules-dell-lldp-workaround vars: all_switch_interfaces: [] ironic_inspector_rules: [] diff --git a/ansible/overcloud-introspection-rules.yml b/ansible/overcloud-introspection-rules.yml index 669d08a10..3aa29c7fd 100644 --- a/ansible/overcloud-introspection-rules.yml +++ b/ansible/overcloud-introspection-rules.yml @@ -1,6 +1,8 @@ --- - name: Check whether Ironic is enabled hosts: controllers + tags: + - introspection-rules tasks: - name: Create controllers group with ironic enabled group_by: @@ -10,6 +12,8 @@ # Only required to run on a single host. hosts: controllers_with_ironic_enabled_True[0] gather_facts: False + tags: + - introspection-rules vars: venv: "{{ virtualenv_path }}/shade" pre_tasks: diff --git a/ansible/overcloud-inventory-discover.yml b/ansible/overcloud-inventory-discover.yml index 3189971e3..6c33268e2 100644 --- a/ansible/overcloud-inventory-discover.yml +++ b/ansible/overcloud-inventory-discover.yml @@ -4,6 +4,8 @@ - name: Ensure the overcloud Ansible inventory is populated hosts: seed + tags: + - inventory-discover tasks: - name: Gather the Ironic node inventory using Bifrost command: > diff --git a/ansible/overcloud-ipa-build.yml b/ansible/overcloud-ipa-build.yml index 7c8ea7750..ce3ecb132 100644 --- a/ansible/overcloud-ipa-build.yml +++ b/ansible/overcloud-ipa-build.yml @@ -6,6 +6,8 @@ - name: Check whether Ironic is enabled hosts: controllers + tags: + - ipa-build tasks: - name: Create controllers group with ironic enabled group_by: @@ -14,6 +16,8 @@ - name: Ensure Ironic Python Agent images are built and installed hosts: controllers_with_ironic_enabled_True[0] gather_facts: False + tags: + - ipa-build vars: ipa_image_name: "ipa" tasks: diff --git a/ansible/overcloud-ipa-images.yml b/ansible/overcloud-ipa-images.yml index a37458128..7c0ee8f5b 100644 --- a/ansible/overcloud-ipa-images.yml +++ b/ansible/overcloud-ipa-images.yml @@ -1,6 +1,8 @@ --- - name: Check whether Ironic is enabled hosts: controllers + tags: + - ipa-images tasks: - name: Create controllers group with ironic enabled group_by: @@ -9,6 +11,8 @@ - name: Ensure Ironic Python Agent (IPA) images are downloaded and registered hosts: controllers_with_ironic_enabled_True[0] gather_facts: False + tags: + - ipa-images vars: # These are the filenames generated by overcloud-ipa-build.yml. ipa_image_name: "ipa" diff --git a/ansible/overcloud-provision.yml b/ansible/overcloud-provision.yml index 356b8f512..940e2cb73 100644 --- a/ansible/overcloud-provision.yml +++ b/ansible/overcloud-provision.yml @@ -3,6 +3,8 @@ - name: Ensure the overcloud nodes are provisioned hosts: overcloud + tags: + - provision vars: # Set to False to avoid waiting for the nodes to become active. wait_active: True diff --git a/ansible/overcloud-service-config-save.yml b/ansible/overcloud-service-config-save.yml index fe940aca1..257d3a5a3 100644 --- a/ansible/overcloud-service-config-save.yml +++ b/ansible/overcloud-service-config-save.yml @@ -1,6 +1,8 @@ --- - name: Save overcloud service configuration hosts: overcloud + tags: + - service-config-save vars: # Override this to change the directory in which the configuration will be # saved. diff --git a/ansible/provision-net.yml b/ansible/provision-net.yml index dccf2c990..d33181d1f 100644 --- a/ansible/provision-net.yml +++ b/ansible/provision-net.yml @@ -1,6 +1,8 @@ --- - name: Check whether Ironic is enabled hosts: controllers + tags: + - provision-net tasks: - name: Create controllers group with ironic enabled group_by: @@ -10,6 +12,8 @@ # Only required to run on a single host. hosts: controllers_with_ironic_enabled_True[0] gather_facts: False + tags: + - provision-net pre_tasks: - name: Validate OpenStack password authentication parameters fail: diff --git a/ansible/public-openrc.yml b/ansible/public-openrc.yml index 292e839ca..49f60e739 100644 --- a/ansible/public-openrc.yml +++ b/ansible/public-openrc.yml @@ -4,6 +4,8 @@ - name: Ensure a public OpenStack API environment file exists hosts: localhost + tags: + - public-openrc vars: public_api_proto: "{% if kolla_enable_tls_external | bool %}https{% else %}http{% endif %}" public_api_vip_address: "{{ public_net_name | net_vip_address }}" diff --git a/ansible/seed-hypervisor-libvirt-host.yml b/ansible/seed-hypervisor-libvirt-host.yml index 3dbb0c828..2957d629b 100644 --- a/ansible/seed-hypervisor-libvirt-host.yml +++ b/ansible/seed-hypervisor-libvirt-host.yml @@ -1,6 +1,8 @@ --- - name: Ensure the libvirt daemon is configured hosts: seed-hypervisor + tags: + - libvirt-host roles: - role: libvirt-host libvirt_host_pools: "{{ seed_hypervisor_libvirt_pools }}" diff --git a/ansible/seed-introspection-rules.yml b/ansible/seed-introspection-rules.yml index 1759e70a3..fa906e572 100644 --- a/ansible/seed-introspection-rules.yml +++ b/ansible/seed-introspection-rules.yml @@ -1,6 +1,8 @@ --- - name: Ensure introspection rules are registered in Bifrost hosts: seed + tags: + - introspection-rules roles: - role: ironic-inspector-rules ironic_inspector_venv: "{{ virtualenv_path }}/shade" diff --git a/ansible/seed-ipa-build.yml b/ansible/seed-ipa-build.yml index ed77b183e..acd50a9cd 100644 --- a/ansible/seed-ipa-build.yml +++ b/ansible/seed-ipa-build.yml @@ -4,6 +4,8 @@ - name: Ensure Ironic Python Agent images are built and installed hosts: seed + tags: + - ipa-build vars: ipa_image_name: "ipa" ipa_images: diff --git a/ansible/snat.yml b/ansible/snat.yml index a2f5a2c3c..caa88843c 100644 --- a/ansible/snat.yml +++ b/ansible/snat.yml @@ -3,6 +3,8 @@ - name: Ensure SNAT is configured hosts: seed:overcloud + tags: + - snat vars: snat_rules: - interface: "{{ ansible_default_ipv4.interface }}" diff --git a/ansible/ssh-known-host.yml b/ansible/ssh-known-host.yml index a3f6e4b72..bb4ae311f 100644 --- a/ansible/ssh-known-host.yml +++ b/ansible/ssh-known-host.yml @@ -2,6 +2,8 @@ - name: Ensure known hosts are configured hosts: all gather_facts: no + tags: + - ssh-known-host roles: - role: ssh-known-host diff --git a/ansible/swift-setup.yml b/ansible/swift-setup.yml index 209333d9f..14b924d89 100644 --- a/ansible/swift-setup.yml +++ b/ansible/swift-setup.yml @@ -1,5 +1,7 @@ --- - hosts: controllers + tags: + - swift roles: - role: swift-setup swift_image: "kolla/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-base:{{ kolla_openstack_release }}" diff --git a/ansible/sysctl.yml b/ansible/sysctl.yml index 78559a152..9aebb540d 100644 --- a/ansible/sysctl.yml +++ b/ansible/sysctl.yml @@ -1,6 +1,8 @@ --- - name: Ensure sysctl parameters are configured hosts: seed:seed-hypervisor:overcloud + tags: + - sysctl roles: - role: sysctl sysctl_file: "/etc/sysctl.d/kayobe" diff --git a/ansible/users.yml b/ansible/users.yml index 2f5f749d3..666eaaed3 100644 --- a/ansible/users.yml +++ b/ansible/users.yml @@ -1,6 +1,8 @@ --- - name: Ensure users exist hosts: seed:seed-hypervisor:overcloud + tags: + - users roles: - role: singleplatform-eng.users become: True diff --git a/ansible/wipe-disks.yml b/ansible/wipe-disks.yml index c015ef255..224534a34 100644 --- a/ansible/wipe-disks.yml +++ b/ansible/wipe-disks.yml @@ -8,5 +8,7 @@ - name: Ensure that all unmounted block devices are wiped hosts: seed:overcloud + tags: + - wipe-disks roles: - role: wipe-disks diff --git a/ansible/yum.yml b/ansible/yum.yml index d2acc726d..e006cc37f 100644 --- a/ansible/yum.yml +++ b/ansible/yum.yml @@ -1,7 +1,11 @@ --- - - name: Ensure Yum repos are configured hosts: seed-hypervisor:seed:overcloud + tags: + - yum roles: - role: yum + - role: yum-cron + tags: + - yum-cron diff --git a/doc/source/release-notes.rst b/doc/source/release-notes.rst index 035a09308..f3f868a24 100644 --- a/doc/source/release-notes.rst +++ b/doc/source/release-notes.rst @@ -41,6 +41,8 @@ Features system's python packages. This is enabled by setting the variable ``kolla_ansible_target_venv`` to a path to the virtualenv. The default for this variable is ``{{ virtualenv_path }}/kolla-ansible``. +* Adds tags to plays to support more fine grained configuration using the + ``--tags`` argument. Upgrade Notes ------------- diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 45912d751..f77b30931 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -44,3 +44,26 @@ Environment variable Export the environment variable ``KAYOBE_VAULT_PASSWORD`` to read the password from the environment. +Limiting Hosts +-------------- + +Sometimes it may be necessary to limit execution of kayobe or kolla-ansible +plays to a subset of the hosts. The ``--limit `` argument allows the +kayobe ansible hosts to be limited. The ``--kolla-limit `` argument +allows the kolla-ansible hosts to be limited. These two options may be +combined in a single command. In both cases, the argument provided should be +an `Ansible host pattern +`_, and will +ultimately be passed to ``ansible-playbook`` as a ``--limit`` argument. + +Tags +---- + +`Ansible tags `_ +provide a useful mechanism for executing a subset of the plays or tasks in a +playbook. The ``--tags `` argument allows execution of kayobe ansible +playbooks to be limited to matching plays and tasks. The ``--kolla-tags +`` argument allows execution of kolla-ansible ansible playbooks to be +limited to matching plays and tasks. The ``--skip-tags `` and +``--kolla-skip-tags `` arguments allow for avoiding execution of matching +plays and tasks.