deploy-steps: switch to tripleo_role_name

"role_name" is internal to Ansible, we should not use it.
This patch uses the new variable set in the inventory to use a specific
TripleO var: tripleo_role_name which is the TripleO role name and not
the Ansible role names, both things are very different.

Depends-On: I57c4eac87e2f96dfe5490b111cd2508505715d56
Change-Id: Iecaf6f1b830e65be2f9e2e44431054fe46f9f565
Related-Bug: #1771171
(cherry picked from commit 1bec01137e)
This commit is contained in:
Emilien Macchi 2018-05-14 11:15:09 -07:00 committed by James Slagle
parent ae528b6626
commit 7af622b117
2 changed files with 28 additions and 28 deletions

View File

@ -16,13 +16,13 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
stat: stat:
path: "{{ role_name + '/step_config.pp' }}" path: "{{ tripleo_role_name + '/step_config.pp' }}"
register: stat_step_config register: stat_step_config
- name: Set fact when file existed - name: Set fact when file existed
no_log: True no_log: True
set_fact: set_fact:
role_data_step_config: "{{lookup('file', role_name + '/step_config.pp')}}" role_data_step_config: "{{lookup('file', tripleo_role_name + '/step_config.pp')}}"
when: stat_step_config.stat.exists when: stat_step_config.stat.exists
- name: Write the puppet step_config manifest - name: Write the puppet step_config manifest
@ -36,13 +36,13 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
stat: stat:
path: "{{ role_name + '/puppet_config.yaml' }}" path: "{{ tripleo_role_name + '/puppet_config.yaml' }}"
register: stat_puppet_config register: stat_puppet_config
- name: Set fact when file existed - name: Set fact when file existed
no_log: True no_log: True
set_fact: set_fact:
role_data_puppet_config: "{{lookup('file', role_name + '/puppet_config.yaml') | from_yaml | to_json}}" role_data_puppet_config: "{{lookup('file', tripleo_role_name + '/puppet_config.yaml') | from_yaml | to_json}}"
when: stat_puppet_config.stat.exists when: stat_puppet_config.stat.exists
- name: Write docker-puppet.json file - name: Write docker-puppet.json file
@ -63,13 +63,13 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
stat: stat:
path: "{{ role_name + '/docker_config_scripts.yaml' }}" path: "{{ tripleo_role_name + '/docker_config_scripts.yaml' }}"
register: stat_docker_config_scripts register: stat_docker_config_scripts
- name: Set fact when file existed - name: Set fact when file existed
no_log: True no_log: True
set_fact: set_fact:
role_data_docker_config_scripts: "{{lookup('file', role_name + '/docker_config_scripts.yaml') | from_yaml}}" role_data_docker_config_scripts: "{{lookup('file', tripleo_role_name + '/docker_config_scripts.yaml') | from_yaml}}"
when: stat_docker_config_scripts.stat.exists when: stat_docker_config_scripts.stat.exists
- name: Write docker config scripts - name: Write docker config scripts
@ -91,13 +91,13 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
stat: stat:
path: "{{ role_name + '/docker_config.yaml' }}" path: "{{ tripleo_role_name + '/docker_config.yaml' }}"
register: stat_docker_config register: stat_docker_config
- name: Set fact when file existed - name: Set fact when file existed
no_log: True no_log: True
set_fact: set_fact:
role_data_docker_config: "{{lookup('file', role_name + '/docker_config.yaml') | from_yaml}}" role_data_docker_config: "{{lookup('file', tripleo_role_name + '/docker_config.yaml') | from_yaml}}"
when: stat_docker_config.stat.exists when: stat_docker_config.stat.exists
- name: Set docker_startup_configs_with_default fact - name: Set docker_startup_configs_with_default fact
@ -119,13 +119,13 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
stat: stat:
path: "{{ role_name + '/kolla_config.yaml' }}" path: "{{ tripleo_role_name + '/kolla_config.yaml' }}"
register: stat_kolla_config register: stat_kolla_config
- name: Set fact when file existed - name: Set fact when file existed
no_log: True no_log: True
set_fact: set_fact:
role_data_kolla_config: "{{lookup('file', role_name + '/kolla_config.yaml') | from_yaml}}" role_data_kolla_config: "{{lookup('file', tripleo_role_name + '/kolla_config.yaml') | from_yaml}}"
when: stat_kolla_config.stat.exists when: stat_kolla_config.stat.exists
- name: Write kolla config json files - name: Write kolla config json files
@ -148,13 +148,13 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
stat: stat:
path: "{{ role_name + '/docker_puppet_tasks.yaml' }}" path: "{{ tripleo_role_name + '/docker_puppet_tasks.yaml' }}"
register: stat_docker_puppet_tasks register: stat_docker_puppet_tasks
- name: Set fact when file existed - name: Set fact when file existed
no_log: True no_log: True
set_fact: set_fact:
role_data_docker_puppet_tasks: "{{lookup('file', role_name + '/docker_puppet_tasks.yaml') | from_yaml}}" role_data_docker_puppet_tasks: "{{lookup('file', tripleo_role_name + '/docker_puppet_tasks.yaml') | from_yaml}}"
when: stat_docker_puppet_tasks.stat.exists when: stat_docker_puppet_tasks.stat.exists
- name: Write docker-puppet-tasks json files - name: Write docker-puppet-tasks json files
@ -229,7 +229,7 @@
command: >- command: >-
paunch --debug apply paunch --debug apply
--file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json --file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
--config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}} --config-id tripleo_step{{step}} --managed-by tripleo-{{tripleo_role_name}}
changed_when: false changed_when: false
check_mode: no check_mode: no
register: outputs register: outputs

View File

@ -106,7 +106,7 @@ resources:
modulepath: /usr/share/ansible-modules modulepath: /usr/share/ansible-modules
inputs: inputs:
- name: step - name: step
- name: role_name - name: tripleo_role_name
- name: update_identifier - name: update_identifier
- name: bootstrap_server_id - name: bootstrap_server_id
- name: enable_debug - name: enable_debug
@ -326,7 +326,7 @@ resources:
config: {get_resource: RoleConfig} config: {get_resource: RoleConfig}
input_values: input_values:
step: {{step}} step: {{step}}
role_name: {{role.name}} tripleo_role_name: {{role.name}}
update_identifier: {get_param: DeployIdentifier} update_identifier: {get_param: DeployIdentifier}
bootstrap_server_id: {get_attr: [BootstrapServerId, value]} bootstrap_server_id: {get_attr: [BootstrapServerId, value]}
enable_debug: {get_param: ConfigDebug} enable_debug: {get_param: ConfigDebug}
@ -426,7 +426,7 @@ outputs:
- include: {{role.name}}/deployments.yaml - include: {{role.name}}/deployments.yaml
vars: vars:
force: false force: false
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
with_items: "{{ '{{' }} {{role.name}}_pre_deployments|default([]) {{ '}}' }}" with_items: "{{ '{{' }} {{role.name}}_pre_deployments|default([]) {{ '}}' }}"
{%- endfor %} {%- endfor %}
tags: tags:
@ -443,7 +443,7 @@ outputs:
tasks: tasks:
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/host_prep_tasks.yaml - include: {{role.name}}/host_prep_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
tags: tags:
- overcloud - overcloud
@ -477,7 +477,7 @@ outputs:
tasks: tasks:
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/deploy_steps_tasks.yaml - include: {{role.name}}/deploy_steps_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
tags: tags:
- overcloud - overcloud
@ -506,7 +506,7 @@ outputs:
- include: {{role.name}}/deployments.yaml - include: {{role.name}}/deployments.yaml
vars: vars:
force: false force: false
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
with_items: "{{ '{{' }} {{role.name}}_post_deployments|default([]) {{ '}}' }}" with_items: "{{ '{{' }} {{role.name}}_post_deployments|default([]) {{ '}}' }}"
{%- endfor %} {%- endfor %}
tags: tags:
@ -529,7 +529,7 @@ outputs:
update_steps_tasks: | update_steps_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/update_tasks.yaml - include: {{role.name}}/update_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
update_steps_playbook: | update_steps_playbook: |
- hosts: undercloud - hosts: undercloud
@ -568,7 +568,7 @@ outputs:
pre_upgrade_rolling_steps_tasks: | pre_upgrade_rolling_steps_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/pre_upgrade_rolling_tasks.yaml - include: {{role.name}}/pre_upgrade_rolling_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
pre_upgrade_rolling_steps_playbook: | pre_upgrade_rolling_steps_playbook: |
- hosts: undercloud - hosts: undercloud
@ -595,7 +595,7 @@ outputs:
upgrade_steps_tasks: | upgrade_steps_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/upgrade_tasks.yaml - include: {{role.name}}/upgrade_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
upgrade_steps_playbook: | upgrade_steps_playbook: |
- hosts: overcloud - hosts: overcloud
@ -607,7 +607,7 @@ outputs:
post_upgrade_steps_tasks: | post_upgrade_steps_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/post_upgrade_tasks.yaml - include: {{role.name}}/post_upgrade_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
post_upgrade_steps_playbook: | post_upgrade_steps_playbook: |
- hosts: overcloud - hosts: overcloud
@ -650,7 +650,7 @@ outputs:
rm -f /usr/libexec/os-apply-config/templates/etc/puppet/hiera.yaml rm -f /usr/libexec/os-apply-config/templates/etc/puppet/hiera.yaml
rm -f /usr/libexec/os-refresh-config/configure.d/10-hiera-disable rm -f /usr/libexec/os-refresh-config/configure.d/10-hiera-disable
fi fi
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
name: Run Fast Forward Upgrade Prep Workarounds for {{role.name}} name: Run Fast Forward Upgrade Prep Workarounds for {{role.name}}
{%- endfor %} {%- endfor %}
{% raw %} {% raw %}
@ -675,7 +675,7 @@ outputs:
fast_forward_upgrade_post_role_tasks: | fast_forward_upgrade_post_role_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include_tasks: {{role.name}}/fast_forward_post_upgrade_tasks.yaml - include_tasks: {{role.name}}/fast_forward_post_upgrade_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
- name: Openstack Heat Agents package update - name: Openstack Heat Agents package update
yum: name=openstack-heat-agents state=latest yum: name=openstack-heat-agents state=latest
@ -686,7 +686,7 @@ outputs:
fast_forward_upgrade_prep_role_tasks: | fast_forward_upgrade_prep_role_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml - include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}
fast_forward_upgrade_bootstrap_tasks: | fast_forward_upgrade_bootstrap_tasks: |
- include_tasks: fast_forward_upgrade_bootstrap_role_tasks.yaml - include_tasks: fast_forward_upgrade_bootstrap_role_tasks.yaml
@ -696,10 +696,10 @@ outputs:
fast_forward_upgrade_bootstrap_role_tasks: | fast_forward_upgrade_bootstrap_role_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml - include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
when: role_name == '{{role.name}}' and ansible_hostname == {{role.name}}[0] when: tripleo_role_name == '{{role.name}}' and ansible_hostname == {{role.name}}[0]
{%- endfor %} {%- endfor %}
post_update_steps_tasks: | post_update_steps_tasks: |
{%- for role in roles %} {%- for role in roles %}
- include: {{role.name}}/post_update_tasks.yaml - include: {{role.name}}/post_update_tasks.yaml
when: role_name == '{{role.name}}' when: tripleo_role_name == '{{role.name}}'
{%- endfor %} {%- endfor %}