TripleO Ansible project repository. Contains playbooks for use with TripleO OpenStack deployments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
709 B

---
- name: Check for hieradata file
become: true
stat:
path:
src: "{{ hieradata_ansible_file }}"
register: _hiera_file
- block:
- name: Get existing data
slurp: "{{ hieradata_ansible_file }}"
register: _file_data
become: true
- name: Set data fact
set_fact:
hieradata_content: "{{ _file_data['content'] | b64decode }}"
when:
- _hiera_file.stat is defined
- _hiera_file.stat.exists
- name: Write ansible hieradata file
copy:
dest: "{{ hieradata_ansible_file }}"
content: "{{ hieradata_content | default({}) | combine(hieradata_ansible_data | default({})) | to_json }}"
owner: root
group: root
mode: '0644'
become: true