tripleo-hieradata: add hieradata_files param
If hieradata_files is set (must be a list), Ansible will configure /etc/puppet/hiera.yaml with the right configuration for Hiera. Note: we now use hiera3 for backward compatibility but in the future we will switch to hiera5. Change-Id: Ia5f11ea1a2f16b736ed7053c5182c7f5a7eb1f4b implements: blueprint reduce-deployment-resources
This commit is contained in:
parent
afcd089024
commit
94c0c09261
@ -12,6 +12,7 @@ Required:
|
||||
* `hieradata_variable_start_string` -- string marking the beginning of a template print statement.
|
||||
* `hieradata_variable_end_string` -- string marking the end of a template print statement.
|
||||
* `hieradata_per_host` -- whether or not we configure hieradata per host.
|
||||
* `hieradata_files` -- List of hieradata files (Order matters for Hierarchy).
|
||||
|
||||
Test playbook
|
||||
-------------
|
||||
|
@ -1,4 +1,5 @@
|
||||
hieradata_template: ""
|
||||
hieradata_files: []
|
||||
# jinja2 escape trick for simple {{ and }} strings:
|
||||
hieradata_variable_start_string: "{{ '{{' }}"
|
||||
hieradata_variable_end_string: "{{ '}}' }}"
|
||||
|
@ -4,6 +4,22 @@
|
||||
state: directory
|
||||
mode: 0700
|
||||
|
||||
- name: Write hiera config
|
||||
when: hieradata_files != []
|
||||
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 }}
|
||||
|
||||
- name: Template hieradata file
|
||||
when: hieradata_template != ""
|
||||
delegate_to: localhost
|
||||
|
@ -8,3 +8,6 @@
|
||||
# jinja2 escape trick for simple {{ and }} strings:
|
||||
variable_start_string: "{{ '{{' }}"
|
||||
variable_end_string: "{{ '}}' }}"
|
||||
hieradata_files:
|
||||
- node
|
||||
- common
|
||||
|
Loading…
x
Reference in New Issue
Block a user