tripleo-ansible/tripleo_ansible/roles/tripleo_hieradata/defaults
Alex Schultz f8f74e11ce Add ansible hieradata file
Currently there isn't a good way to pass dynamic information from
ansible to puppet to end up in the configuration. This change adds an
ansible_managed hierafile that can be updated via ansible to pass
dynamic variables into a future puppet execution.

An example playbook would be:

  - name: Set my data
    set_fact:
      my_data: foo
  - name: Add my_data to hieradata
    include_role:
      name: tripleo_hieradata
      tasks_from: ansible_hierdata.yml
    vars:
      hieradata_ansible_data:
        my_magical_var: "{{ my_data }}"

The puppet code that would be executed later would just be:

  class myclass(
    $my_data = lookup('my_magical_var', 'bar')
  ) {
    file { '/var/tmp/data':
      ensure  = present,
      content = $my_data
    }
  }

Change-Id: I52ba520dbdd97b25cb093f7e09609e6e1797e3a1
2020-04-24 13:01:35 -06:00
..
main.yml Add ansible hieradata file 2020-04-24 13:01:35 -06:00