mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-17 00:47:32 -02:30
Fixing up vault variables
This commit is contained in:
@@ -12,11 +12,11 @@
|
||||
|
||||
- name: "sync_file | Set facts for file contents"
|
||||
set_fact:
|
||||
sync_file_contents: "{{ hostvars[sync_file_srcs|first]['sync_file_cat']['stdout'] }}"
|
||||
sync_file_contents: "{{ hostvars[sync_file_srcs|first].get('sync_file_cat', {}).get('stdout') }}"
|
||||
|
||||
- name: "sync_file | Set fact for key contents"
|
||||
set_fact:
|
||||
sync_file_key_contents: "{{ hostvars[sync_file_srcs|first]['sync_file_key_cat']['stdout'] }}"
|
||||
sync_file_key_contents: "{{ hostvars[sync_file_srcs|first].get('sync_file_key_cat', {}).get('stdout') }}"
|
||||
when: sync_file_is_cert|d()
|
||||
|
||||
- name: "sync_file | Ensure the directory exists"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
with_items: "{{ sync_file_hosts | unique }}"
|
||||
loop_control:
|
||||
loop_var: host_item
|
||||
when: hostvars[host_item]["sync_file_stat"]["stat"]["exists"]|bool
|
||||
when: hostvars[host_item].get("sync_file_stat", {}).get("stat", {}).get("exists")
|
||||
|
||||
- name: "sync_file | Combine all possible key file sync sources"
|
||||
set_fact:
|
||||
@@ -44,7 +44,7 @@
|
||||
with_items: "{{ sync_file_hosts | unique }}"
|
||||
loop_control:
|
||||
loop_var: host_item
|
||||
when: sync_file_is_cert|d() and hostvars[host_item]["sync_file_key_stat"]["stat"]["exists"]|bool
|
||||
when: sync_file_is_cert|d() and hostvars[host_item].get("sync_file_key_stat", {}).get("stat", {}).get("exists")
|
||||
|
||||
- name: "sync_file | Remove sync sources with files that do not match sync_file_srcs|first"
|
||||
set_fact:
|
||||
@@ -52,7 +52,7 @@
|
||||
when: >-
|
||||
sync_file_srcs|d([])|length > 1 and
|
||||
inventory_hostname != sync_file_srcs|first and
|
||||
sync_file_stat.stat.get("checksum") != hostvars[sync_file_srcs|first]["sync_file_stat"]["stat"]["checksum"]
|
||||
sync_file_stat.stat.get("checksum") != hostvars[sync_file_srcs|first].get("sync_file_stat", {}).get("stat", {}).get("checksum")
|
||||
|
||||
- name: "sync_file | Remove sync sources with keys that do not match sync_file_srcs|first"
|
||||
set_fact:
|
||||
@@ -61,7 +61,7 @@
|
||||
sync_file_is_cert|d() and
|
||||
sync_file_key_srcs|d([])|length > 1 and
|
||||
inventory_hostname != sync_file_key_srcs|first and
|
||||
sync_file_key_stat.stat.checksum != hostvars[sync_file_srcs|first]["sync_file_key_stat"]["stat"]["checksum"]
|
||||
sync_file_key_stat.stat.get("checksum") != hostvars[sync_file_srcs|first].get("sync_file_key_stat", {}).get("stat", {}).get("checksum")
|
||||
|
||||
- name: "sync_file | Consolidate file and key sources"
|
||||
set_fact:
|
||||
|
||||
Reference in New Issue
Block a user