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
This commit is contained in:
parent
aec81d595e
commit
1bec01137e
|
@ -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
|
||||||
|
@ -234,7 +234,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
|
||||||
|
|
|
@ -107,7 +107,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
|
||||||
|
@ -322,7 +322,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}
|
||||||
|
@ -424,7 +424,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
|
||||||
|
@ -438,7 +438,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:
|
||||||
|
@ -455,7 +455,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
|
||||||
|
@ -489,7 +489,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
|
||||||
|
@ -518,7 +518,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:
|
||||||
|
@ -541,7 +541,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
|
||||||
|
@ -572,7 +572,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
|
||||||
|
@ -599,7 +599,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
|
||||||
|
@ -611,7 +611,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
|
||||||
|
@ -654,7 +654,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 %}
|
||||||
|
@ -679,7 +679,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
|
||||||
|
@ -690,7 +690,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
|
||||||
|
@ -700,12 +700,12 @@ 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 %}
|
||||||
post_update_steps_playbook: |
|
post_update_steps_playbook: |
|
||||||
- hosts: overcloud
|
- hosts: overcloud
|
||||||
|
|
Loading…
Reference in New Issue