Merge "Ensure consistency with hostname comparison"

This commit is contained in:
Zuul 2020-03-31 05:49:52 +00:00 committed by Gerrit Code Review
commit 17135d60d0
5 changed files with 14 additions and 14 deletions

View File

@ -153,18 +153,18 @@
# Bootstrap tasks - run any tasks that have been defined # Bootstrap tasks - run any tasks that have been defined
######################################################## ########################################################
- name: "Clean container_puppet_tasks for {{ansible_hostname}} step {{step}}" - name: "Clean container_puppet_tasks for {{ansible_hostname | lower}} step {{step}}"
file: file:
path: /var/lib/container-puppet/container-puppet-tasks{{step}}.json path: /var/lib/container-puppet/container-puppet-tasks{{step}}.json
state: absent state: absent
tags: tags:
- container_config_tasks - container_config_tasks
- name: Calculate container_puppet_tasks for {{ansible_hostname}} step {{step}} - name: Calculate container_puppet_tasks for {{ansible_hostname | lower}} step {{step}}
set_fact: set_fact:
host_container_puppet_tasks: "{{host_container_puppet_tasks|default([]) + [item]}}" host_container_puppet_tasks: "{{host_container_puppet_tasks|default([]) + [item]}}"
loop: "{{container_puppet_tasks.get('step_' + step, [])}}" loop: "{{container_puppet_tasks.get('step_' + step, [])}}"
when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | sort | first) == ansible_hostname when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | sort | first | lower) == ansible_hostname | lower
vars: vars:
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}" container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
tags: tags:

View File

@ -20,7 +20,7 @@
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}' MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}'
CONTAINER_LOG_STDOUT_PATH: "{{ container_log_stdout_path }}" CONTAINER_LOG_STDOUT_PATH: "{{ container_log_stdout_path }}"
CONTAINER_HEALTHCHECK_DISABLED: "{{ container_healthcheck_disabled }}" CONTAINER_HEALTHCHECK_DISABLED: "{{ container_healthcheck_disabled }}"
SHORT_HOSTNAME: "{{ ansible_hostname }}" SHORT_HOSTNAME: "{{ ansible_hostname | lower }}"
check_mode: no check_mode: no
register: generate_config_async_result register: generate_config_async_result
@ -61,7 +61,7 @@
net_host: true net_host: true
no_archive: false no_archive: false
puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet.json" puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet.json"
short_hostname: "{{ ansible_hostname }}" short_hostname: "{{ ansible_hostname | lower }}"
step: "{{ step }}" step: "{{ step }}"
- name: "Manage Puppet containers (generate config) for step {{ step }} with tripleo-ansible" - name: "Manage Puppet containers (generate config) for step {{ step }} with tripleo-ansible"

View File

@ -1,4 +1,4 @@
- name: Write container-puppet-tasks json file for {{ansible_hostname}} step {{step}} - name: Write container-puppet-tasks json file for {{ansible_hostname | lower}} step {{step}}
no_log: True no_log: True
copy: copy:
content: "{{host_container_puppet_tasks|to_nice_json}}" content: "{{host_container_puppet_tasks|to_nice_json}}"
@ -27,7 +27,7 @@
CONTAINER_CLI: "{{ container_cli }}" CONTAINER_CLI: "{{ container_cli }}"
DEBUG: "{{ docker_puppet_debug }}" DEBUG: "{{ docker_puppet_debug }}"
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet}}' MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet}}'
SHORT_HOSTNAME: "{{ ansible_hostname }}" SHORT_HOSTNAME: "{{ ansible_hostname | lower }}"
PROCESS_COUNT: "{{ docker_puppet_process_count }}" PROCESS_COUNT: "{{ docker_puppet_process_count }}"
register: bootstrap_tasks_async_result register: bootstrap_tasks_async_result
no_log: true no_log: true
@ -61,7 +61,7 @@
net_host: true net_host: true
no_archive: true no_archive: true
puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet-tasks{{ step }}.json" puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet-tasks{{ step }}.json"
short_hostname: "{{ ansible_hostname }}" short_hostname: "{{ ansible_hostname | lower }}"
step: "{{ step }}" step: "{{ step }}"
- name: "Manage Puppet containers (bootstrap tasks) for step {{ step }} with tripleo-ansible" - name: "Manage Puppet containers (bootstrap tasks) for step {{ step }} with tripleo-ansible"

View File

@ -85,7 +85,7 @@ outputs:
path: "{{cert_path}}" path: "{{cert_path}}"
- name: set is_haproxy_bootstrap_node fact - name: set is_haproxy_bootstrap_node fact
set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name == ansible_hostname}} set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name | lower == ansible_hostname | lower}}
- name: get haproxy status - name: get haproxy status
register: haproxy_state register: haproxy_state

View File

@ -297,10 +297,10 @@ outputs:
{%- if 'octavia_' ~ octavia_groups %} {%- if 'octavia_' ~ octavia_groups %}
{% for host in groups['octavia_' ~ octavia_group] -%} {% for host in groups['octavia_' ~ octavia_group] -%}
{{ hostvars.raw_get(host)['ansible_hostname'] }}: {{ hostvars.raw_get(host)['ansible_hostname'] | lower}}:
ansible_user: {{ hostvars.raw_get(host)['ansible_ssh_user'] | default('heat-admin') }} ansible_user: {{ hostvars.raw_get(host)['ansible_ssh_user'] | default('heat-admin') }}
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }} ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }}
canonical_hostname: {{ hostvars.raw_get(host)['canonical_hostname'] | default(host) }} canonical_hostname: {{ hostvars.raw_get(host)['canonical_hostname'] | default(host) | lower }}
ansible_become: true ansible_become: true
{% endfor %} {% endfor %}
@ -310,8 +310,8 @@ outputs:
Undercloud: Undercloud:
hosts: hosts:
{% for host in groups['Undercloud'] -%} {% for host in groups['Undercloud'] -%}
{{ hostvars.raw_get(host)['ansible_hostname'] }}: {{ hostvars.raw_get(host)['ansible_hostname'] | lower}}:
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }} ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }}
ansible_become: false ansible_become: false
ansible_connection: local ansible_connection: local