Cleanup/standardize usage of tags
The numerous tags within the role have been condensed to two tags: magnum-install and magnum-config These tags have been chosen as they are namespaced and cover the two major functions of the role. Change-Id: Ie90c02084774be4d93e3b83983f2810caffe5654
This commit is contained in:
parent
17bce6b224
commit
6a01bf9552
|
@ -56,3 +56,12 @@ Example Playbook
|
|||
ansible_hostname: "{{ container_name }}"
|
||||
is_metal: "{{ properties.is_metal|default(false) }}"
|
||||
|
||||
Tags
|
||||
====
|
||||
|
||||
This role supports two tags: ``magnum-install`` and ``magnum-config``.
|
||||
|
||||
The ``magnum-install`` tag can be used to install and upgrade.
|
||||
|
||||
The ``magnum-config`` tag can be used to maintain configuration of the
|
||||
service.
|
||||
|
|
|
@ -17,9 +17,3 @@
|
|||
command: "{{ magnum_bin}}/magnum-db-manage upgrade"
|
||||
become: yes
|
||||
become_user: "{{ magnum_system_user_name }}"
|
||||
tags:
|
||||
- magnum-database-setup
|
||||
- magnum-db-setup
|
||||
- magnum-database-sync
|
||||
- magnum-db-sync
|
||||
- magnum-setup
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
- include: magnum_install_apt.yml
|
||||
when:
|
||||
- ansible_pkg_mgr == 'apt'
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-apt-packages
|
||||
|
||||
- name: Create developer mode constraint file
|
||||
copy:
|
||||
|
@ -29,9 +26,6 @@
|
|||
{% endfor %}
|
||||
when:
|
||||
- magnum_developer_mode | bool
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Clone requirements git repository
|
||||
git:
|
||||
|
@ -42,27 +36,18 @@
|
|||
version: "{{ magnum_requirements_git_install_branch }}"
|
||||
when:
|
||||
- magnum_developer_mode | bool
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-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:
|
||||
- magnum_developer_mode | bool
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-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 magnum_developer_mode | bool
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Install requires pip packages
|
||||
pip:
|
||||
|
@ -73,9 +58,6 @@
|
|||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Get local venv checksum
|
||||
stat:
|
||||
|
@ -84,9 +66,6 @@
|
|||
when:
|
||||
- not magnum_developer_mode | bool
|
||||
register: local_venv_stat
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Get remote venv checksum
|
||||
uri:
|
||||
|
@ -95,9 +74,6 @@
|
|||
when:
|
||||
- not magnum_developer_mode | bool
|
||||
register: remote_venv_checksum
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
# TODO: When project moves to ansible 2 we can pass this a sha256sum which will:
|
||||
# a) allow us to remove force: yes
|
||||
|
@ -115,16 +91,10 @@
|
|||
- not magnum_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:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Set magnum get_venv fact
|
||||
set_fact:
|
||||
magnum_get_venv: "{{ get_venv }}"
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Remove existing venv
|
||||
file:
|
||||
|
@ -132,18 +102,12 @@
|
|||
state: absent
|
||||
when:
|
||||
- magnum_get_venv | changed
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Create magnum venv dir
|
||||
file:
|
||||
path: "{{ magnum_bin | dirname }}"
|
||||
state: directory
|
||||
register: magnum_venv_dir
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Unarchive pre-built venv
|
||||
unarchive:
|
||||
|
@ -154,9 +118,6 @@
|
|||
- not magnum_developer_mode | bool
|
||||
- magnum_get_venv | changed or magnum_venv_dir | changed
|
||||
notify: Restart magnum services
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Install pip packages
|
||||
pip:
|
||||
|
@ -172,9 +133,6 @@
|
|||
when:
|
||||
- magnum_get_venv | failed or magnum_developer_mode | bool
|
||||
notify: Restart magnum services
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
- name: Update virtualenv path
|
||||
command: >
|
||||
|
@ -182,7 +140,3 @@
|
|||
when:
|
||||
- not magnum_developer_mode | bool
|
||||
- magnum_get_venv | success
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-pip-packages
|
||||
|
||||
|
|
|
@ -16,13 +16,9 @@
|
|||
|
||||
- include: magnum_init_upstart.yml
|
||||
when: pid1_name == "init"
|
||||
tags:
|
||||
- magnum-init
|
||||
|
||||
- include: magnum_init_systemd.yml
|
||||
when: pid1_name == "systemd"
|
||||
tags:
|
||||
- magnum-init
|
||||
|
||||
- name: Load service
|
||||
service:
|
||||
|
|
|
@ -20,15 +20,11 @@
|
|||
stat:
|
||||
path: /var/cache/apt
|
||||
register: apt_cache_stat
|
||||
tags:
|
||||
- magnum-apt-sources
|
||||
|
||||
- name: Update apt if needed
|
||||
apt:
|
||||
update_cache: yes
|
||||
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
|
||||
tags:
|
||||
- magnum-apt-sources
|
||||
|
||||
- name: Install apt packages for Magnum
|
||||
apt:
|
||||
|
@ -39,5 +35,3 @@
|
|||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ magnum_apt_packages }}"
|
||||
tags:
|
||||
- magnum-apt-packages
|
||||
|
|
|
@ -36,20 +36,32 @@
|
|||
- always
|
||||
|
||||
- include: pre-install.yml
|
||||
tags:
|
||||
- magnum-install
|
||||
|
||||
- include: install.yml
|
||||
tags:
|
||||
- magnum-install
|
||||
|
||||
- include: post-install.yml
|
||||
tags:
|
||||
- magnum-config
|
||||
|
||||
- include: magnum_init.yml
|
||||
tags:
|
||||
- magnum-install
|
||||
|
||||
- include: database-setup.yml
|
||||
when: >
|
||||
inventory_hostname == groups['magnum_all'][0]
|
||||
tags:
|
||||
- magnum-install
|
||||
|
||||
- include: service-setup.yml
|
||||
when: >
|
||||
inventory_hostname == groups['magnum_all'][0]
|
||||
tags:
|
||||
- magnum-install
|
||||
|
||||
- name: Restart Magnum Services
|
||||
service:
|
||||
|
@ -58,6 +70,9 @@
|
|||
with_items:
|
||||
- "{{ magnum_api_program_name }}"
|
||||
- "{{ magnum_conductor_program_name }}"
|
||||
tags:
|
||||
- magnum-install
|
||||
- magnum-config
|
||||
|
||||
- name: Flush handlers
|
||||
meta: flush_handlers
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
destination: "{{ magnum_etc_directory }}/api-paste.ini"
|
||||
config_overrides: "{{ magnum_api_paste_ini_overrides }}"
|
||||
config_type: "ini"
|
||||
tags:
|
||||
- magnum-config-files
|
||||
- magnum-configuration
|
||||
- magnum-post-install
|
||||
|
||||
- name: Upload images to Glance
|
||||
glance:
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
name: "{{ magnum_system_group_name }}"
|
||||
state: "present"
|
||||
system: "yes"
|
||||
tags:
|
||||
- magnum-group
|
||||
- magnum-system-settings
|
||||
|
||||
- name: Create the Magnum system user
|
||||
user:
|
||||
|
@ -31,9 +28,6 @@
|
|||
system: "yes"
|
||||
createhome: "yes"
|
||||
home: "{{ magnum_system_user_home }}"
|
||||
tags:
|
||||
- magnum-user
|
||||
- magnum-system-settings
|
||||
|
||||
- name: Create Magnum's directories
|
||||
file:
|
||||
|
@ -45,9 +39,6 @@
|
|||
with_items:
|
||||
- path: "/etc/magnum"
|
||||
- path: "{{ magnum_system_user_home }}"
|
||||
tags:
|
||||
- magnum-directories
|
||||
- magnum-system-settings
|
||||
|
||||
- name: Test for Magnum log directory or link
|
||||
shell: |
|
||||
|
@ -60,10 +51,6 @@
|
|||
register: log_dir
|
||||
failed_when: false
|
||||
changed_when: log_dir.rc != 0
|
||||
tags:
|
||||
- magnum-directories
|
||||
- magnum-logs
|
||||
- magnum-system-settings
|
||||
|
||||
- name: Create Magnum log directory
|
||||
file:
|
||||
|
@ -73,7 +60,3 @@
|
|||
group: "{{ magnum_system_group_name }}"
|
||||
mode: "0750"
|
||||
when: log_dir.rc != 0
|
||||
tags:
|
||||
- magnum-directories
|
||||
- magnum-logs
|
||||
- magnum-system-settings
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
until: add_magnum_service |success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- magnum-api-setup
|
||||
- magnum-service-add
|
||||
- magnum-setup
|
||||
|
||||
- name: Ensure the magnum user exists
|
||||
keystone:
|
||||
|
@ -48,11 +44,6 @@
|
|||
until: add_magnum_user |success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- magnum-api-setup
|
||||
- magnum-service-add
|
||||
- magnum-user-add
|
||||
- magnum-setup
|
||||
|
||||
- name: Ensure the magnum user has the admin role
|
||||
keystone:
|
||||
|
@ -70,10 +61,6 @@
|
|||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ magnum_service_role_names }}"
|
||||
tags:
|
||||
- magnum-api-setup
|
||||
- magnum-role-setup
|
||||
- magnum-setup
|
||||
|
||||
- name: Ensure the magnum endpoint is registered
|
||||
keystone:
|
||||
|
@ -97,11 +84,6 @@
|
|||
until: add_magnum_endpoints |success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- magnum-api-setup
|
||||
- magnum-service-add
|
||||
- magnum-endpoints-add
|
||||
- magnum-setup
|
||||
|
||||
- name: Ensure the magnum trustee domain exists
|
||||
keystone:
|
||||
|
@ -117,9 +99,6 @@
|
|||
until: add_magnum_trustee_user |success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- magnum-domain-add
|
||||
- magnum-setup
|
||||
|
||||
- name: Ensure the magnum trustee user exists
|
||||
keystone:
|
||||
|
@ -137,9 +116,6 @@
|
|||
until: add_magnum_trustee_user |success
|
||||
retries: 5
|
||||
delay: 2
|
||||
tags:
|
||||
- magnum-user-add
|
||||
- magnum-setup
|
||||
|
||||
- name: Ensure the magnum user has the admin role
|
||||
keystone:
|
||||
|
@ -157,6 +133,3 @@
|
|||
retries: 5
|
||||
delay: 2
|
||||
with_items: "{{ magnum_trustee_domain_admin_roles }}"
|
||||
tags:
|
||||
- magnum-role-setup
|
||||
- magnum-setup
|
||||
|
|
Loading…
Reference in New Issue