Merge "Cleanup/standardize usage of tags"

This commit is contained in:
Jenkins 2016-08-12 14:31:53 +00:00 committed by Gerrit Code Review
commit 84a0b62326
13 changed files with 32 additions and 138 deletions

View File

@ -7,3 +7,13 @@ Please see the `role-ironic spec`_ for more details.
.. _OpenStack-Ansible: https://github.com/openstack/openstack-ansible .. _OpenStack-Ansible: https://github.com/openstack/openstack-ansible
.. _role-ironic spec: https://github.com/openstack/openstack-ansible-specs/blob/master/specs/mitaka/role-ironic.rst .. _role-ironic spec: https://github.com/openstack/openstack-ansible-specs/blob/master/specs/mitaka/role-ironic.rst
Tags
====
This role supports two tags: ``ironic-install`` and ``ironic-config``
The ``ironic-install`` tag can be used to install and upgrade.
The ``ironic-config`` tag can be used to maintain configuration of the
service.

View File

@ -18,7 +18,3 @@
- ansible_pkg_mgr == 'apt' - ansible_pkg_mgr == 'apt'
vars: vars:
apt_pkgs: "{{ ironic_api_apt_packages }}" apt_pkgs: "{{ ironic_api_apt_packages }}"
tags:
- ironic-install
- ironic-api
- ironic-apt-packages

View File

@ -24,8 +24,6 @@
- { src: "ironic-httpd.conf.j2", dest: "/etc/apache2/sites-available/ironic-httpd.conf" } - { src: "ironic-httpd.conf.j2", dest: "/etc/apache2/sites-available/ironic-httpd.conf" }
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- ironic-httpd
- name: Disable default apache site - name: Disable default apache site
file: file:
@ -34,8 +32,6 @@
when: not ironic_standalone when: not ironic_standalone
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- ironic-httpd
- name: Enable default apache site vhost - name: Enable default apache site vhost
file: file:
@ -47,8 +43,6 @@
when: ironic_standalone when: ironic_standalone
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- ironic-httpd
- name: Enable ironic vhost - name: Enable ironic vhost
file: file:
@ -59,8 +53,6 @@
- { src: "/etc/apache2/sites-available/ironic-httpd.conf", dest: "/etc/apache2/sites-enabled/ironic-httpd.conf", state: "link" } - { src: "/etc/apache2/sites-available/ironic-httpd.conf", dest: "/etc/apache2/sites-enabled/ironic-httpd.conf", state: "link" }
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- ironic-httpd
- name: Setup Ironic WSGI Configs - name: Setup Ironic WSGI Configs
template: template:
@ -71,5 +63,3 @@
mode: "0755" mode: "0755"
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- ironic-config

View File

@ -18,10 +18,6 @@
- ansible_pkg_mgr == 'apt' - ansible_pkg_mgr == 'apt'
vars: vars:
apt_pkgs: "{{ ironic_conductor_apt_packages }}" apt_pkgs: "{{ ironic_conductor_apt_packages }}"
tags:
- ironic-install
- ironic-conductor
- ironic-apt-packages
- include: ironic_install_apt.yml - include: ironic_install_apt.yml
when: when:
@ -29,7 +25,3 @@
- ironic_standalone - ironic_standalone
vars: vars:
apt_pkgs: "{{ ironic_conductor_standalone_apt_packages }}" apt_pkgs: "{{ ironic_conductor_standalone_apt_packages }}"
tags:
- ironic-install
- ironic-conductor
- ironic-apt-packages

View File

@ -20,8 +20,6 @@
when: ironic_standalone when: ironic_standalone
notify: notify:
- Restart isc-dhcp-server - Restart isc-dhcp-server
tags:
- isc-dhcp-server
- name: Create /tftpboot - name: Create /tftpboot
file: file:
@ -30,8 +28,6 @@
owner: "{{ ironic_system_user_name }}" owner: "{{ ironic_system_user_name }}"
group: "{{ ironic_system_group_name }}" group: "{{ ironic_system_group_name }}"
mode: "0755" mode: "0755"
tags:
- tftpd-hpa
- name: Copy in tftpd-hpa config file - name: Copy in tftpd-hpa config file
template: template:
@ -39,8 +35,6 @@
dest: /etc/default/tftpd-hpa dest: /etc/default/tftpd-hpa
notify: notify:
- Restart tftpd-hpa - Restart tftpd-hpa
tags:
- tftpd-hpa
- name: Copy in tftpd-hpa map file - name: Copy in tftpd-hpa map file
copy: copy:
@ -48,8 +42,6 @@
dest: /tftpboot/map-file dest: /tftpboot/map-file
notify: notify:
- Restart tftpd-hpa - Restart tftpd-hpa
tags:
- tftpd-hpa
## TODO(odyssey4me): Switch this to the copy module and make use of ## TODO(odyssey4me): Switch this to the copy module and make use of
## remote_src: True once we move to Ansible 2.x. For Ansible 1.9x ## remote_src: True once we move to Ansible 2.x. For Ansible 1.9x
@ -57,8 +49,6 @@
## which is a wasted effort. ## which is a wasted effort.
- name: Copy syslinux pxlinux.0 - name: Copy syslinux pxlinux.0
command: "cp {{ ironic_pxelinux_path }} /tftpboot/pxelinux.0" command: "cp {{ ironic_pxelinux_path }} /tftpboot/pxelinux.0"
tags:
- tftpd-hpa
## TODO(odyssey4me): Switch this to the copy module and make use of ## TODO(odyssey4me): Switch this to the copy module and make use of
## remote_src: True once we move to Ansible 2.x. For Ansible 1.9x ## remote_src: True once we move to Ansible 2.x. For Ansible 1.9x
@ -66,5 +56,3 @@
## which is a wasted effort. ## which is a wasted effort.
- name: Copy syslinux chain.c32 - name: Copy syslinux chain.c32
command: "cp {{ ironic_chainc32_path }} /tftpboot/chain.c32" command: "cp {{ ironic_chainc32_path }} /tftpboot/chain.c32"
tags:
- tftpd-hpa

View File

@ -19,6 +19,3 @@
become_user: "{{ ironic_system_user_name }}" become_user: "{{ ironic_system_user_name }}"
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- ironic-db-setup
- ironic-conductor

View File

@ -15,13 +15,9 @@
- include: ironic_init_upstart.yml - include: ironic_init_upstart.yml
when: pid1_name == "init" when: pid1_name == "init"
tags:
- ironic-init
- include: ironic_init_systemd.yml - include: ironic_init_systemd.yml
when: pid1_name == "systemd" when: pid1_name == "systemd"
tags:
- ironic-init
- name: Load service - name: Load service
service: service:

View File

@ -22,9 +22,6 @@
{% endfor %} {% endfor %}
when: when:
- ironic_developer_mode | bool - ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- include: ironic_install_apt.yml - include: ironic_install_apt.yml
when: when:
@ -32,10 +29,6 @@
- ironic_developer_mode | bool - ironic_developer_mode | bool
vars: vars:
apt_pkgs: "{{ ironic_developer_apt_packages }}" apt_pkgs: "{{ ironic_developer_apt_packages }}"
tags:
- ironic-install
- ironic-apt
- ironic-apt-packages
- name: Clone requirements git repository - name: Clone requirements git repository
git: git:
@ -46,27 +39,18 @@
version: "{{ ironic_requirements_git_install_branch }}" version: "{{ ironic_requirements_git_install_branch }}"
when: when:
- ironic_developer_mode | bool - ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Add constraints to pip_install_options fact for developer mode - name: Add constraints to pip_install_options fact for developer mode
set_fact: set_fact:
pip_install_options_fact: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt" pip_install_options_fact: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt"
when: when:
- ironic_developer_mode | bool - ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Set pip_install_options_fact when not in developer mode - name: Set pip_install_options_fact when not in developer mode
set_fact: set_fact:
pip_install_options_fact: "{{ pip_install_options|default('') }}" pip_install_options_fact: "{{ pip_install_options|default('') }}"
when: when:
- not ironic_developer_mode | bool - not ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Install requires pip packages - name: Install requires pip packages
pip: pip:
@ -77,9 +61,6 @@
until: install_packages|success until: install_packages|success
retries: 5 retries: 5
delay: 2 delay: 2
tags:
- ironic-install
- ironic-pip-packages
- name: Get local venv checksum - name: Get local venv checksum
stat: stat:
@ -88,9 +69,6 @@
when: when:
- not ironic_developer_mode | bool - not ironic_developer_mode | bool
register: local_venv_stat register: local_venv_stat
tags:
- ironic-install
- ironic-pip-packages
- name: Get remote venv checksum - name: Get remote venv checksum
uri: uri:
@ -99,9 +77,6 @@
when: when:
- not ironic_developer_mode | bool - not ironic_developer_mode | bool
register: remote_venv_checksum register: remote_venv_checksum
tags:
- ironic-install
- ironic-pip-packages
# TODO: When project moves to ansible 2 we can pass this a sha256sum which will: # TODO: When project moves to ansible 2 we can pass this a sha256sum which will:
# a) allow us to remove force: yes # a) allow us to remove force: yes
@ -119,16 +94,10 @@
- not ironic_developer_mode | bool - not ironic_developer_mode | bool
- (local_venv_stat.stat.exists == False or - (local_venv_stat.stat.exists == False or
{{ local_venv_stat.stat.checksum is defined and local_venv_stat.stat.checksum != remote_venv_checksum.content | trim }}) {{ local_venv_stat.stat.checksum is defined and local_venv_stat.stat.checksum != remote_venv_checksum.content | trim }})
tags:
- ironic-install
- ironic-pip-packages
- name: Set ironic get_venv fact - name: Set ironic get_venv fact
set_fact: set_fact:
ironic_get_venv: "{{ get_venv }}" ironic_get_venv: "{{ get_venv }}"
tags:
- ironic-install
- ironic-pip-packages
- name: Remove existing venv - name: Remove existing venv
file: file:
@ -136,18 +105,12 @@
state: absent state: absent
when: when:
- ironic_get_venv | changed - ironic_get_venv | changed
tags:
- ironic-install
- ironic-pip-packages
- name: Create ironic venv dir - name: Create ironic venv dir
file: file:
path: "{{ ironic_bin | dirname }}" path: "{{ ironic_bin | dirname }}"
state: directory state: directory
register: ironic_venv_dir register: ironic_venv_dir
tags:
- ironic-install
- ironic-pip-packages
- name: Unarchive pre-built venv - name: Unarchive pre-built venv
unarchive: unarchive:
@ -158,9 +121,6 @@
- not ironic_developer_mode | bool - not ironic_developer_mode | bool
- ironic_get_venv | changed or ironic_venv_dir | changed - ironic_get_venv | changed or ironic_venv_dir | changed
notify: Restart ironic services notify: Restart ironic services
tags:
- ironic-install
- ironic-pip-packages
- name: Install pip packages - name: Install pip packages
pip: pip:
@ -176,9 +136,6 @@
when: when:
- ironic_get_venv | failed or ironic_developer_mode | bool - ironic_get_venv | failed or ironic_developer_mode | bool
notify: Restart ironic services notify: Restart ironic services
tags:
- ironic-install
- ironic-pip-packages
- name: Update virtualenv path - name: Update virtualenv path
command: > command: >
@ -186,6 +143,3 @@
when: when:
- not ironic_developer_mode | bool - not ironic_developer_mode | bool
- ironic_get_venv | success - ironic_get_venv | success
tags:
- ironic-install
- ironic-pip-packages

View File

@ -21,8 +21,6 @@
until: apt_update|success until: apt_update|success
retries: 5 retries: 5
delay: 2 delay: 2
tags:
- ironic-apt-packages
- name: Install apt packages - name: Install apt packages
apt: apt:
@ -34,6 +32,3 @@
delay: 2 delay: 2
with_items: with_items:
- "{{ apt_pkgs }}" - "{{ apt_pkgs }}"
tags:
- ironic-install
- ironic-apt-packages

View File

@ -50,7 +50,6 @@
- inventory_hostname == groups['ironic_all'][0] - inventory_hostname == groups['ironic_all'][0]
- not ironic_standalone | bool - not ironic_standalone | bool
tags: tags:
- ironic-swift-auth
- always - always
- name: Get swift account - name: Get swift account
@ -67,7 +66,6 @@
- (ironic_swift_auth_account is undefined) or (ironic_swift_endpoint is undefined) - (ironic_swift_auth_account is undefined) or (ironic_swift_endpoint is undefined)
- not ironic_standalone | bool - not ironic_standalone | bool
tags: tags:
- ironic-swift-auth
- always - always
- name: Validate swift output - name: Validate swift output
@ -82,7 +80,6 @@
- not ironic_standalone | bool - not ironic_standalone | bool
- not swift_storage_url.stdout - not swift_storage_url.stdout
tags: tags:
- ironic-swift-auth
- always - always
- name: Set the swift auth facts - name: Set the swift auth facts
@ -128,9 +125,6 @@
config_overrides: "{{ ironic_policy_overrides }}" config_overrides: "{{ ironic_policy_overrides }}"
config_type: "json" config_type: "json"
notify: Restart ironic services notify: Restart ironic services
tags:
- ironic-config
- ironic-post-install
- name: Copy ironic rootwrap filter config - name: Copy ironic rootwrap filter config
copy: copy:
@ -143,9 +137,6 @@
- { src: "rootwrap.d/ironic-lib.filters", dest: "/etc/ironic/rootwrap.d/ironic-lib.filters" } - { src: "rootwrap.d/ironic-lib.filters", dest: "/etc/ironic/rootwrap.d/ironic-lib.filters" }
- { src: "rootwrap.d/ironic-utils.filters", dest: "/etc/ironic/rootwrap.d/ironic-utils.filters" } - { src: "rootwrap.d/ironic-utils.filters", dest: "/etc/ironic/rootwrap.d/ironic-utils.filters" }
notify: Restart ironic services notify: Restart ironic services
tags:
- ironic-config
- ironic-post-install
- name: Include sudoers file - name: Include sudoers file
template: template:
@ -154,6 +145,3 @@
mode: "0440" mode: "0440"
owner: "root" owner: "root"
group: "root" group: "root"
tags:
- ironic-api
- ironic-conductor

View File

@ -18,9 +18,6 @@
name: "{{ ironic_system_group_name }}" name: "{{ ironic_system_group_name }}"
state: "present" state: "present"
system: "yes" system: "yes"
tags:
- ironic-api
- ironic-conductor
- name: Remove old key file(s) if found - name: Remove old key file(s) if found
file: file:
@ -31,9 +28,6 @@
- "{{ ironic_system_home_folder }}/.ssh/id_rsa" - "{{ ironic_system_home_folder }}/.ssh/id_rsa"
- "{{ ironic_system_home_folder }}/.ssh/id_rsa.pub" - "{{ ironic_system_home_folder }}/.ssh/id_rsa.pub"
when: ironic_recreate_keys | bool when: ironic_recreate_keys | bool
tags:
- ironic-api
- ironic-conductor
- name: Create the ironic system user - name: Create the ironic system user
user: user:
@ -45,9 +39,6 @@
createhome: "yes" createhome: "yes"
home: "{{ ironic_system_home_folder }}" home: "{{ ironic_system_home_folder }}"
generate_ssh_key: "yes" generate_ssh_key: "yes"
tags:
- ironic-api
- ironic-conductor
- name: Create ironic dir - name: Create ironic dir
file: file:
@ -71,9 +62,6 @@
- { path: "/var/run/ironic" } - { path: "/var/run/ironic" }
- { path: "/var/www/cgi-bin", owner: root, group: root } - { path: "/var/www/cgi-bin", owner: root, group: root }
- { path: "/var/www/cgi-bin/ironic" } - { path: "/var/www/cgi-bin/ironic" }
tags:
- ironic-api
- ironic-conductor
- name: Test for log directory or link - name: Test for log directory or link
shell: | shell: |
@ -86,9 +74,6 @@
register: log_dir register: log_dir
failed_when: false failed_when: false
changed_when: log_dir.rc != 0 changed_when: log_dir.rc != 0
tags:
- ironic-api
- ironic-conductor
- name: Create ironic log dir - name: Create ironic log dir
file: file:
@ -100,6 +85,3 @@
with_items: with_items:
- { path: "{{ ironic_system_log_folder }}" } - { path: "{{ ironic_system_log_folder }}" }
when: log_dir.rc != 0 when: log_dir.rc != 0
tags:
- ironic-api
- ironic-conductor

View File

@ -29,10 +29,6 @@
until: add_service|success until: add_service|success
retries: 5 retries: 5
delay: 2 delay: 2
tags:
- ironic-api-setup
- ironic-service-add
- ironic-setup
# Create an admin user # Create an admin user
- name: Ensure ironic user - name: Ensure ironic user
@ -51,10 +47,6 @@
until: add_service|success until: add_service|success
retries: 5 retries: 5
delay: 10 delay: 10
tags:
- ironic-api-setup
- ironic-service-add
- ironic-setup
# Add a role to the user # Add a role to the user
- name: Ensure ironic user to admin role - name: Ensure ironic user to admin role
@ -73,10 +65,6 @@
until: add_service|success until: add_service|success
retries: 5 retries: 5
delay: 10 delay: 10
tags:
- ironic-api-setup
- ironic-service-add
- ironic-setup
# Create an endpoint # Create an endpoint
- name: Ensure ironic endpoint - name: Ensure ironic endpoint
@ -101,7 +89,3 @@
until: add_service|success until: add_service|success
retries: 5 retries: 5
delay: 10 delay: 10
tags:
- ironic-api-setup
- ironic-service-add
- ironic-setup

View File

@ -37,32 +37,54 @@
- always - always
- include: ironic_pre_install.yml - include: ironic_pre_install.yml
tags:
- ironic-install
- include: ironic_install.yml - include: ironic_install.yml
tags:
- ironic-install
- include: ironic_api_install.yml - include: ironic_api_install.yml
when: > when: >
inventory_hostname in groups['ironic_api'] inventory_hostname in groups['ironic_api']
tags:
- ironic-install
- include: ironic_conductor_install.yml - include: ironic_conductor_install.yml
when: > when: >
inventory_hostname in groups['ironic_conductor'] inventory_hostname in groups['ironic_conductor']
tags:
- ironic-install
- include: ironic_post_install.yml - include: ironic_post_install.yml
tags:
- ironic-install
- ironic-config
- include: ironic_api_post_install.yml - include: ironic_api_post_install.yml
when: > when: >
inventory_hostname in groups['ironic_api'] inventory_hostname in groups['ironic_api']
tags:
- ironic-config
- include: ironic_conductor_post_install.yml - include: ironic_conductor_post_install.yml
when: > when: >
inventory_hostname in groups['ironic_conductor'] inventory_hostname in groups['ironic_conductor']
tags:
- ironic-config
- include: ironic_db_setup.yml - include: ironic_db_setup.yml
when: > when: >
inventory_hostname == groups['ironic_conductor'][0] inventory_hostname == groups['ironic_conductor'][0]
tags:
- ironic-install
- include: ironic_init.yml - include: ironic_init.yml
tags:
- ironic-install
- include: ironic_service_setup.yml - include: ironic_service_setup.yml
when: > when: >
inventory_hostname == groups['ironic_api'][0] inventory_hostname == groups['ironic_api'][0]
tags:
- ironic-install