Fix fact definition for deployments

For legacy deployment tasks we construct them here in tripleo-common. In
order to disable inject facts, we need to fix this here too.

Change-Id: I776192717798c9fc3f02c4d358bebed2bada3593
Related-Bug: #1915761
This commit is contained in:
Alex Schultz 2021-02-22 10:41:46 -07:00
parent 0e81eb420e
commit 6af709a65e
1 changed files with 4 additions and 4 deletions

View File

@ -6,11 +6,11 @@
- name: Lookup deployment UUID
set_fact:
deployment_uuid: "{{ lookup('file', tripleo_role_name ~ '/' ~ ansible_hostname | lower ~ '/' ~ item) | from_yaml | json_query(item_id) }}"
deployment_uuid: "{{ lookup('file', tripleo_role_name ~ '/' ~ ansible_facts['hostname'] | lower ~ '/' ~ item) | from_yaml | json_query(item_id) }}"
- name: Lookup deployment group
set_fact:
deployment_group: "{{ lookup('file', tripleo_role_name ~ '/' ~ ansible_hostname | lower ~ '/' ~ item) | from_yaml | json_query(item_group) }}"
deployment_group: "{{ lookup('file', tripleo_role_name ~ '/' ~ ansible_facts['hostname'] | lower ~ '/' ~ item) | from_yaml | json_query(item_group) }}"
- name: Hiera check and diff mode
block:
@ -35,7 +35,7 @@
- name: "Template deployment file for {{ item }}"
template:
src: "{{ tripleo_role_name ~ '/' ~ ansible_hostname | lower ~ '/' ~ item }}"
src: "{{ tripleo_role_name ~ '/' ~ ansible_facts['hostname'] | lower ~ '/' ~ item }}"
dest: "/var/lib/heat-config/check-mode/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }}.rendered"
# variable_start/end are overridden since the Heat template must be
# valid yaml, so the jinja expression must be wrapped in quotes in the
@ -122,7 +122,7 @@
- name: "Template deployment file for {{ item }}"
template:
src: "{{ tripleo_role_name ~ '/' ~ ansible_hostname | lower ~ '/' ~ item }}"
src: "{{ tripleo_role_name ~ '/' ~ ansible_facts['hostname'] | lower ~ '/' ~ item }}"
dest: "/var/lib/heat-config/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }}.rendered"
# variable_start/end are overridden since the Heat template must be
# valid yaml, so the jinja expression must be wrapped in quotes in the