tripleo-common/roles/tripleo-hieradata/tasks/main.yaml
Rabi Mishra 102dccc234 Remove hieradata ansible tasks for datafiles
Depends-On: https://review.opendev.org/673731
Change-Id: I84e2ff3f25b311236ac94f3f4df270d600e59ac5
2019-08-08 07:56:22 +05:30

22 lines
623 B
YAML

- name: Create /etc/puppet/hieradata
file:
path: /etc/puppet/hieradata
state: directory
mode: 0700
- name: Write hiera config
when: (hieradata_files | length) > 0
copy:
mode: 0600
dest: /etc/puppet/hiera.yaml
# TODO(emilien) Switch to Hiera5 format once we stop calling Hiera CLI
# which is deprecated and should be replaced by "puppet lookup" command.
content: |
---
:backends:
- json
:json:
:datadir: /etc/puppet/hieradata
:hierarchy:
{{ hieradata_files | to_nice_yaml if hieradata_files | type_debug == 'list' else hieradata_files }}