Cleanup/standardize usage of tags

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

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

Documentation has been updated to inform how each tag
influences the function of the role.

Change-Id: I47d3bacb6f79f69e448691b133c319c0a811179b
This commit is contained in:
Travis Truman 2016-07-12 16:15:42 -04:00
parent 3a8e9e1732
commit 49ca0de95d
13 changed files with 17 additions and 127 deletions

View File

@ -51,3 +51,13 @@ Example Playbook
vars:
cinder_glance_api_servers: "http://glance_server:9292"
cinder_galera_address: "{{ internal_lb_vip_address }}"
Tags
====
This role supports two tags: ``cinder-install`` and ``cinder-config``
The ``cinder-install`` tag can be used to install and upgrade.
The ``cinder-config`` tag can be used to maintain configuration of the
service.

View File

@ -21,8 +21,6 @@
until: api_status |success
retries: 10
delay: 10
tags:
- cinder-backends
- name: Add in cinder devices types
shell: |
@ -32,6 +30,3 @@
{{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-key "{{ item.key }}" set volume_backend_name="{{ item.value.volume_backend_name }}"
fi
with_dict: "{{ cinder_backends|default({}) }}"
tags:
- cinder-backends
- cinder-backends-types

View File

@ -17,7 +17,3 @@
command: "{{ cinder_bin }}/cinder-manage db sync"
become: yes
become_user: "{{ cinder_system_user_name }}"
tags:
- cinder-db-sync
- cinder-setup
- cinder-command-bin

View File

@ -22,8 +22,6 @@
service_home: "{{ cinder_system_home_folder }}"
when: >
inventory_hostname in groups['cinder_api']
tags:
- upstart-init
- include: cinder_init_common.yml
vars:
@ -34,8 +32,6 @@
service_home: "{{ cinder_system_home_folder }}"
when: >
inventory_hostname in groups['cinder_scheduler']
tags:
- upstart-init
- include: cinder_init_common.yml
vars:
@ -46,8 +42,6 @@
service_home: "{{ cinder_system_home_folder }}"
when: >
inventory_hostname in groups['cinder_volume']
tags:
- upstart-init
- include: cinder_init_common.yml
vars:
@ -59,5 +53,3 @@
when: >
inventory_hostname in groups['cinder_backup'] and
cinder_service_backup_program_enabled == true
tags:
- upstart-init

View File

@ -16,13 +16,9 @@
- include: cinder_init_upstart.yml
when: pid1_name == "init"
tags:
- cinder-init
- include: cinder_init_systemd.yml
when: pid1_name == "systemd"
tags:
- cinder-init
- name: Load service
service:

View File

@ -21,24 +21,16 @@
owner: "root"
group: "root"
register: upstart_init
notify:
- Restart cinder services
tags:
- upstart-init
- cinder-init
- name: Reload init scripts
shell: |
initctl reload-configuration
when: upstart_init | changed
register: upstart_init
notify:
- Restart cinder services
tags:
- upstart-init
- cinder-init
- name: Load service
service:
@ -46,6 +38,3 @@
enabled: "yes"
notify:
- Restart cinder services
tags:
- upstart-init
- cinder-init

View File

@ -16,9 +16,6 @@
- include: cinder_install_apt.yml
when:
- ansible_pkg_mgr == 'apt'
tags:
- cinder-install
- cinder-apt-packages
- name: Create developer mode constraint file
copy:
@ -29,9 +26,6 @@
{% endfor %}
when:
- cinder_developer_mode | bool
tags:
- cinder-install
- cinder-pip-packages
- name: Clone requirements git repository
git:
@ -42,27 +36,18 @@
version: "{{ cinder_requirements_git_install_branch }}"
when:
- cinder_developer_mode | bool
tags:
- cinder-install
- cinder-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:
- cinder_developer_mode | bool
tags:
- cinder-install
- cinder-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 cinder_developer_mode | bool
tags:
- cinder-install
- cinder-pip-packages
- name: Install requires pip packages
pip:
@ -74,9 +59,6 @@
retries: 5
delay: 2
with_items: "{{ cinder_requires_pip_packages }}"
tags:
- cinder-install
- cinder-pip-packages
- name: Get local venv checksum
stat:
@ -85,9 +67,6 @@
when:
- not cinder_developer_mode | bool
register: local_venv_stat
tags:
- cinder-install
- cinder-pip-packages
- name: Get remote venv checksum
uri:
@ -96,9 +75,6 @@
when:
- not cinder_developer_mode | bool
register: remote_venv_checksum
tags:
- cinder-install
- cinder-pip-packages
# TODO: When project moves to ansible 2 we can pass this a sha256sum which will:
# a) allow us to remove force: yes
@ -116,16 +92,10 @@
- not cinder_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:
- cinder-install
- cinder-pip-packages
- name: Set cinder get_venv fact
set_fact:
cinder_get_venv: "{{ get_venv }}"
tags:
- cinder-install
- cinder-pip-packages
- name: Remove existing venv
file:
@ -133,9 +103,6 @@
state: absent
when:
- cinder_get_venv | changed
tags:
- cinder-install
- cinder-pip-packages
- name: Create cinder venv dir
file:
@ -145,9 +112,6 @@
when:
- not cinder_developer_mode | bool
- cinder_get_venv | changed
tags:
- cinder-install
- cinder-pip-packages
- name: Unarchive pre-built venv
unarchive:
@ -158,9 +122,6 @@
- not cinder_developer_mode | bool
- cinder_get_venv | changed or cinder_venv_dir | changed
notify: Restart cinder services
tags:
- cinder-install
- cinder-pip-packages
- name: Install pip packages
pip:
@ -177,9 +138,6 @@
when:
- cinder_get_venv | failed or cinder_developer_mode | bool
notify: Restart cinder services
tags:
- cinder-install
- cinder-pip-packages
- name: Update virtualenv path
command: >
@ -187,6 +145,3 @@
when:
- not cinder_developer_mode | bool
- cinder_get_venv | success
tags:
- cinder-install
- cinder-pip-packages

View File

@ -19,16 +19,12 @@
register: lvm_devices
changed_when: lvm_devices.rc != 0
failed_when: false
tags:
- cinder-lvm-config
- name: Ensure "/etc/lvm" directory
file:
state: "directory"
path: "/etc/lvm"
when: lvm_devices.rc == 0
tags:
- cinder-lvm-config
- name: Drop lvm Config
template:
@ -38,5 +34,3 @@
group: "root"
backup: "yes"
when: lvm_devices.rc == 0
tags:
- cinder-lvm-config

View File

@ -43,8 +43,6 @@
config_type: "json"
notify:
- Restart cinder services
tags:
- cinder-config
- name: Drop cinder configs
copy:
@ -54,8 +52,6 @@
group: "root"
notify:
- Restart cinder services
tags:
- cinder-config
- name: Ensure cinder tgt include
lineinfile:
@ -66,8 +62,6 @@
when:
- inventory_hostname in groups['cinder_volume']
- cinder_backend_lvm_inuse | bool
tags:
- cinder-tgt
- name: Create nfs shares export file
template:
@ -76,8 +70,6 @@
when:
- cinder_nfs_client is defined
- inventory_hostname in groups['cinder_volume']
tags:
- cinder-nfs
- name: Drop sudoers file
template:
@ -86,6 +78,3 @@
mode: "0440"
owner: "root"
group: "root"
tags:
- sudoers
- cinder-sudoers

View File

@ -18,8 +18,6 @@
name: "{{ cinder_system_group_name }}"
state: "present"
system: "yes"
tags:
- cinder-group
- name: Create the cinder system user
user:
@ -30,8 +28,6 @@
system: "yes"
createhome: "yes"
home: "{{ cinder_system_home_folder }}"
tags:
- cinder-user
- name: Create cinder dir
file:
@ -46,8 +42,6 @@
- { path: "/etc/cinder/rootwrap.d", owner: "root", group: "root" }
- { path: "/etc/sudoers.d", mode: "0750", owner: "root", group: "root" }
- { path: "{{ cinder_system_home_folder }}" }
tags:
- cinder-dirs
- name: Test for log directory or link
shell: |
@ -60,9 +54,6 @@
register: log_dir
failed_when: false
changed_when: log_dir.rc != 0
tags:
- cinder-dirs
- cinder-logs
- name: Create cinder log dir
file:
@ -74,6 +65,3 @@
with_items:
- { path: "/var/log/cinder" }
when: log_dir.rc != 0
tags:
- cinder-dirs
- cinder-logs

View File

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

View File

@ -21,8 +21,6 @@
service_publicurl: "{{ cinder_service_publicurl }}"
service_internalurl: "{{ cinder_service_internalurl }}"
service_adminurl: "{{ cinder_service_adminurl }}"
tags:
- cinder-server
- include: cinder_service_add.yml
vars:
@ -32,5 +30,3 @@
service_publicurl: "{{ cinder_service_v2_publicurl }}"
service_internalurl: "{{ cinder_service_v2_internalurl }}"
service_adminurl: "{{ cinder_service_v2_adminurl }}"
tags:
- cinder-server

View File

@ -43,19 +43,23 @@
- include: cinder_install.yml
tags:
- cinder-install
- cinder-config
- include: cinder_post_install.yml
tags:
- cinder-install
- cinder-config
- include: cinder_db_setup.yml
when: >
inventory_hostname == groups['cinder_all'][0]
tags:
- cinder-install
- include: cinder_service_setup.yml
when: >
inventory_hostname == groups['cinder_all'][0]
tags:
- cinder-install
- include: cinder_init.yml
tags:
@ -67,6 +71,8 @@
- include: cinder_backends.yml
when: >
inventory_hostname in groups['cinder_volume'][0]
tags:
- cinder-install
- include: cinder_lvm_config.yml
when: >