Cleanup/standardize usage of tags

The numerous tags within the role have been condensed
to two tags: ironic-install and ironic-config

These tags have been chosen as they are namespaced
and cover the two major functions of the role.

Change-Id: I1ddbf229f4a3665c2c6fc798b39882d137c536d1
This commit is contained in:
alextricity25 2016-08-11 09:19:29 -05:00 committed by Travis Truman
parent e8b360fa22
commit 92aacee8e5
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
.. _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'
vars:
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" }
notify:
- Restart ironic services
tags:
- ironic-httpd
- name: Disable default apache site
file:
@ -34,8 +32,6 @@
when: not ironic_standalone
notify:
- Restart ironic services
tags:
- ironic-httpd
- name: Enable default apache site vhost
file:
@ -47,8 +43,6 @@
when: ironic_standalone
notify:
- Restart ironic services
tags:
- ironic-httpd
- name: Enable ironic vhost
file:
@ -59,8 +53,6 @@
- { src: "/etc/apache2/sites-available/ironic-httpd.conf", dest: "/etc/apache2/sites-enabled/ironic-httpd.conf", state: "link" }
notify:
- Restart ironic services
tags:
- ironic-httpd
- name: Setup Ironic WSGI Configs
template:
@ -71,5 +63,3 @@
mode: "0755"
notify:
- Restart ironic services
tags:
- ironic-config

View File

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

View File

@ -20,8 +20,6 @@
when: ironic_standalone
notify:
- Restart isc-dhcp-server
tags:
- isc-dhcp-server
- name: Create /tftpboot
file:
@ -30,8 +28,6 @@
owner: "{{ ironic_system_user_name }}"
group: "{{ ironic_system_group_name }}"
mode: "0755"
tags:
- tftpd-hpa
- name: Copy in tftpd-hpa config file
template:
@ -39,8 +35,6 @@
dest: /etc/default/tftpd-hpa
notify:
- Restart tftpd-hpa
tags:
- tftpd-hpa
- name: Copy in tftpd-hpa map file
copy:
@ -48,8 +42,6 @@
dest: /tftpboot/map-file
notify:
- Restart tftpd-hpa
tags:
- tftpd-hpa
## 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
@ -57,8 +49,6 @@
## which is a wasted effort.
- name: Copy syslinux pxlinux.0
command: "cp {{ ironic_pxelinux_path }} /tftpboot/pxelinux.0"
tags:
- tftpd-hpa
## 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
@ -66,5 +56,3 @@
## which is a wasted effort.
- name: Copy syslinux 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 }}"
notify:
- Restart ironic services
tags:
- ironic-db-setup
- ironic-conductor

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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