123456789101112131415161718192021222324252627282930313233343536373839404142 |
- ---
- - name: Check if input config file is encrypted
- command: cat {{ role_path }}/../../appliance/{{ input_config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- - name: Decrpyt input_config.yml
- command: >-
- ansible-vault decrypt {{ role_path }}/../../appliance/{{ input_config_filename }}
- --vault-password-file {{ role_path }}/../../appliance/roles/common/files/{{ vault_filename }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- - name: Include variable file input_config.yml
- include_vars: "{{ role_path }}/../../appliance/{{ input_config_filename }}"
- no_log: True
- - name: Save input variables from file
- set_fact:
- cobbler_password: "{{ provision_password }}"
- db_password: "{{ mariadb_password }}"
- k8s_cni: "{{ k8s_cni }}"
- no_log: True
- - name: Encrypt input config file
- command: >-
- ansible-vault encrypt {{ role_path }}/../../appliance/{{ input_config_filename }}
- --vault-password-file {{ role_path }}/../../appliance/roles/common/files/{{ vault_filename }}
- when: "'$ANSIBLE_VAULT;' not in config_content.stdout"
|