Merge "Use jinja raw tag instead of quoted concatenation"

This commit is contained in:
Zuul 2020-03-16 21:28:49 +00:00 committed by Gerrit Code Review
commit 21c907f1de

View File

@ -434,24 +434,26 @@ outputs:
- hosts: all - hosts: all
name: Manage SELinux and generate /etc/hosts name: Manage SELinux and generate /etc/hosts
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
tasks: tasks:
- name: Set selinux state - name: Set selinux state
selinux: selinux:
policy: targeted policy: targeted
state: SELINUX_MODE state: SELINUX_MODE
{% raw %}
- name: Configure Hosts Entries - name: Configure Hosts Entries
include_role: include_role:
name: tripleo_hosts_entries name: tripleo_hosts_entries
vars: vars:
tripleo_hosts_entries_undercloud_hosts_entries: {{ '"{{ ' }} undercloud_hosts_entries {{ ' }}"' }} tripleo_hosts_entries_undercloud_hosts_entries: "{{ undercloud_hosts_entries }}"
tripleo_hosts_entries_extra_hosts_entries: {{ '"{{ ' }} extra_hosts_entries {{ ' }}"' }} tripleo_hosts_entries_extra_hosts_entries: "{{ extra_hosts_entries }}"
tripleo_hosts_entries_vip_hosts_entries: {{ '"{{ ' }} vip_hosts_entries {{ ' }}"' }} tripleo_hosts_entries_vip_hosts_entries: "{{ vip_hosts_entries }}"
{% endraw %}
- hosts: DEPLOY_TARGET_HOST - hosts: DEPLOY_TARGET_HOST
name: Common roles for TripleO servers name: Common roles for TripleO servers
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
# pre_tasks run before any roles in a play, so we use it for the # pre_tasks run before any roles in a play, so we use it for the
# named debug task for --start-at-task. # named debug task for --start-at-task.
@ -469,7 +471,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Deploy step tasks for step 0 name: Deploy step tasks for step 0
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -492,7 +494,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server pre deployment steps name: Server pre deployment steps
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
tasks: tasks:
- import_tasks: hiera_steps_tasks.yaml - import_tasks: hiera_steps_tasks.yaml
@ -502,9 +504,10 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server deployments name: Server deployments
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
tasks: tasks:
{% raw %}
- name: Server deployments - name: Server deployments
delegate_to: localhost delegate_to: localhost
run_once: true run_once: true
@ -513,7 +516,7 @@ outputs:
- include_tasks: deployments.yaml - include_tasks: deployments.yaml
vars: vars:
force: false force: false
with_items: "{{ '{{' }} hostvars[inventory_hostname]['pre_deployments_' ~ tripleo_role_name]|default([]) {{ '}}' }}" with_items: "{{ hostvars[inventory_hostname]['pre_deployments_' ~ tripleo_role_name]|default([]) }}"
- name: Check for previous run of NetworkConfig - name: Check for previous run of NetworkConfig
stat: stat:
@ -529,13 +532,13 @@ outputs:
- name: Check NetworkConfig script existence - name: Check NetworkConfig script existence
local_action: local_action:
module: stat module: stat
path: {{ '"{{' }} lookup('first_found', NetworkConfig_paths, errors='ignore') {{ '}}"' }} path: "{{ lookup('first_found', NetworkConfig_paths, errors='ignore') }}"
become: no become: no
register: NetworkConfig_stat register: NetworkConfig_stat
vars: vars:
NetworkConfig_paths: NetworkConfig_paths:
- {{ '"{{' }} tripleo_role_name ~ '/' ~ inventory_hostname ~ '/NetworkConfig' {{ '}}"' }} - "{{ tripleo_role_name ~ '/' ~ inventory_hostname ~ '/NetworkConfig' }}"
- {{ '"{{' }} tripleo_role_name ~ '/NetworkConfig' {{ '}}"' }} - "{{ tripleo_role_name ~ '/NetworkConfig' }}"
- name: NetworkConfig - name: NetworkConfig
block: block:
@ -550,22 +553,22 @@ outputs:
- name: Render NetworkConfig script - name: Render NetworkConfig script
template: template:
dest: /var/lib/tripleo-config/scripts/run_os_net_config.sh dest: /var/lib/tripleo-config/scripts/run_os_net_config.sh
src: {{ '"{{' }} NetworkConfig_stat.stat.path {{ '}}"' }} src: "{{ NetworkConfig_stat.stat.path }}"
mode: 0755 mode: 0755
- name: Run NetworkConfig script - name: Run NetworkConfig script
command: /var/lib/tripleo-config/scripts/run_os_net_config.sh command: /var/lib/tripleo-config/scripts/run_os_net_config.sh
async: {{ '"{{' }} async_timeout | default(300) {{ '}}"' }} async: "{{ async_timeout | default(300) }}"
poll: {{ '"{{' }} async_poll | default(3) {{ '}}"' }} poll: "{{ async_poll | default(3) }}"
environment: environment:
bridge_name: {{ '"{{' }} neutron_physical_bridge_name {{ '}}"' }} bridge_name: "{{ neutron_physical_bridge_name }}"
interface_name: {{ '"{{' }} neutron_public_interface_name {{ '}}"' }} interface_name: "{{ neutron_public_interface_name }}"
register: NetworkConfig_result register: NetworkConfig_result
failed_when: NetworkConfig_result.rc is not defined failed_when: NetworkConfig_result.rc is not defined
- name: Write rc of NetworkConfig script - name: Write rc of NetworkConfig script
copy: copy:
content: {{ '"{{' }} NetworkConfig_result.rc {{ '}}"' }} content: "{{ NetworkConfig_result.rc }}"
dest: /var/lib/tripleo-config/os-net-config.returncode dest: /var/lib/tripleo-config/os-net-config.returncode
- name: NetworkConfig stdout - name: NetworkConfig stdout
@ -602,26 +605,27 @@ outputs:
- name: AllNodesValidationConfig - name: AllNodesValidationConfig
script: all_nodes_validation_script.sh script: all_nodes_validation_script.sh
environment: environment:
validate_controllers_icmp: {{ '"{{' }} validate_controllers_icmp {{ '}}"' }} validate_controllers_icmp: "{{ validate_controllers_icmp }}"
validate_gateways_icmp: {{ '"{{' }} validate_gateways_icmp {{ '}}"' }} validate_gateways_icmp: "{{ validate_gateways_icmp }}"
validate_fqdn: {{ '"{{' }} validate_fqdn {{ '}}"' }} validate_fqdn: "{{ validate_fqdn }}"
validate_ntp: {{ '"{{' }} validate_ntp {{ '}}"' }} validate_ntp: "{{ validate_ntp }}"
ping_test_ips: {{ '"{{' }} ping_test_ips | to_json {{ '}}"' }} ping_test_ips: "{{ ping_test_ips | to_json }}"
tripleo_role_name: {{ '"{{' }} tripleo_role_name {{ '}}"' }} tripleo_role_name: "{{ tripleo_role_name }}"
- name: ArtifactsConfig - name: ArtifactsConfig
script: deploy-artifacts.sh script: deploy-artifacts.sh
environment: environment:
artifact_urls: {{ '"{{' }} deploy_artifact_urls {{ '}}"' }} artifact_urls: "{{ deploy_artifact_urls }}"
tags: tags:
- overcloud - overcloud
- pre_deploy_steps - pre_deploy_steps
{% endraw %}
{%- for role in roles %} {%- for role in roles %}
- hosts: {{role.name}} - hosts: {{role.name}}
name: {{role.name}} Host prep steps name: {{role.name}} Host prep steps
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -650,7 +654,7 @@ outputs:
- hosts: DEPLOY_SOURCE_HOST - hosts: DEPLOY_SOURCE_HOST
name: External deployment step {{step}} name: External deployment step {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
become: false become: false
vars: vars:
@ -679,7 +683,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Deploy step tasks for {{step}} name: Deploy step tasks for {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
# FIXME(shardy) - it would be nice to use strategy: free to # FIXME(shardy) - it would be nice to use strategy: free to
# allow the tasks per-step to run in parallel on each role, # allow the tasks per-step to run in parallel on each role,
@ -698,11 +702,13 @@ outputs:
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks: tasks:
- name: Write the config_step hieradata for the deploy step {{step}} tasks - name: Write the config_step hieradata for the deploy step {{step}} tasks
{% raw %}
copy: copy:
content: "{{ '{{' }} dict(step=step|int) | to_json {{ '}}' }}" content: "{{ dict(step=step | int) | to_json }}"
dest: /etc/puppet/hieradata/config_step.json dest: /etc/puppet/hieradata/config_step.json
force: true force: true
mode: '0600' mode: '0600'
{% endraw %}
- name: Deploy step tasks for {{step}} - name: Deploy step tasks for {{step}}
delegate_to: localhost delegate_to: localhost
run_once: true run_once: true
@ -724,7 +730,7 @@ outputs:
{% if step == 1 %} {% if step == 1 %}
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Overcloud common bootstrap tasks for step 1 name: Overcloud common bootstrap tasks for step 1
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -760,7 +766,7 @@ outputs:
{% endif %} {% endif %}
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Overcloud common deploy step tasks {{step}} name: Overcloud common deploy step tasks {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -795,7 +801,7 @@ outputs:
{%- endfor %} {%- endfor %}
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server Post Deployments name: Server Post Deployments
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
tasks: tasks:
- name: Server Post Deployments - name: Server Post Deployments
@ -803,17 +809,19 @@ outputs:
run_once: true run_once: true
debug: debug:
msg: Use --start-at-task 'Server Post Deployments' to resume from this task msg: Use --start-at-task 'Server Post Deployments' to resume from this task
{% raw %}
- include_tasks: deployments.yaml - include_tasks: deployments.yaml
vars: vars:
force: false force: false
with_items: "{{ '{{' }} hostvars[inventory_hostname]['post_deployments_' ~ tripleo_role_name]|default([]) {{ '}}' }}" with_items: "{{ hostvars[inventory_hostname]['post_deployments_' ~ tripleo_role_name]|default([]) }}"
tags: tags:
- overcloud - overcloud
- post_deploy_steps - post_deploy_steps
{% endraw %}
- hosts: DEPLOY_SOURCE_HOST - hosts: DEPLOY_SOURCE_HOST
name: External deployment Post Deploy tasks name: External deployment Post Deploy tasks
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
become: false become: false
vars: vars:
@ -858,8 +866,8 @@ outputs:
{%- for role in roles %} {%- for role in roles %}
- hosts: {{role.name}} - hosts: {{role.name}}
name: Run update name: Run update
serial: {{ '"{{' }} update_serial | default({{role.update_serial | default(1)}}) {{ '}}"' }} serial: "{% raw %}{{ update_serial | default({% endraw %}{{ role.update_serial | default(1) }}{% raw %})}}{% endraw %}"
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -914,7 +922,7 @@ outputs:
{%- for step in range(external_update_steps_max) %} {%- for step in range(external_update_steps_max) %}
- hosts: DEPLOY_SOURCE_HOST - hosts: DEPLOY_SOURCE_HOST
name: External update step {{step}} name: External update step {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
become: false become: false
vars: vars:
@ -942,7 +950,7 @@ outputs:
# variables "exported" from update tasks # variables "exported" from update tasks
- hosts: DEPLOY_SOURCE_HOST - hosts: DEPLOY_SOURCE_HOST
name: External deploy step {{step}} name: External deploy step {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
become: false become: false
vars: vars:
@ -982,7 +990,7 @@ outputs:
- hosts: {{role.name}} - hosts: {{role.name}}
name: Run pre-upgrade rolling tasks name: Run pre-upgrade rolling tasks
serial: {{ role.deploy_serial | default(1) }} serial: {{ role.deploy_serial | default(1) }}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
tasks: tasks:
- include_tasks: pre_upgrade_rolling_steps_tasks.yaml - include_tasks: pre_upgrade_rolling_steps_tasks.yaml
@ -1000,7 +1008,7 @@ outputs:
{%- for step in range(0,upgrade_steps_max) %} {%- for step in range(0,upgrade_steps_max) %}
- hosts: DEPLOY_TARGET_HOST - hosts: DEPLOY_TARGET_HOST
name: Upgrade tasks for step {{step}} name: Upgrade tasks for step {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -1061,7 +1069,7 @@ outputs:
{%- for step in range(external_upgrade_steps_max) %} {%- for step in range(external_upgrade_steps_max) %}
- hosts: DEPLOY_SOURCE_HOST - hosts: DEPLOY_SOURCE_HOST
name: External upgrade step {{step}} name: External upgrade step {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
become: false become: false
vars: vars:
@ -1092,7 +1100,7 @@ outputs:
# variables "exported" from upgrade tasks # variables "exported" from upgrade tasks
- hosts: DEPLOY_SOURCE_HOST - hosts: DEPLOY_SOURCE_HOST
name: External deploy step {{step}} name: External deploy step {{step}}
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"
any_errors_fatal: yes any_errors_fatal: yes
become: false become: false
vars: vars: