Browse Source

Fix tripleo_hierdata permissions

Add become: true to the tasks that need to be able to write to /etc/

Change-Id: I24b118220ce2371f651cad6b8dfbbf5d031ee118
Related-Bug: #1883609
(cherry picked from commit c8d8e9adaf)
changes/00/739500/1
Alex Schultz 1 year ago
committed by Emilien Macchi
parent
commit
a7f9c2c0a3
  1. 1
      tripleo_ansible/roles/tripleo_hieradata/tasks/ansible_hieradata.yml
  2. 2
      tripleo_ansible/roles/tripleo_hieradata/tasks/hieradata_vars.yaml
  3. 2
      tripleo_ansible/roles/tripleo_hieradata/tasks/main.yml

1
tripleo_ansible/roles/tripleo_hieradata/tasks/ansible_hieradata.yml

@ -1,5 +1,6 @@
---
- name: Check for hieradata file
become: true
stat:
path:
src: "{{ hieradata_ansible_file }}"

2
tripleo_ansible/roles/tripleo_hieradata/tasks/hieradata_vars.yaml

@ -15,11 +15,13 @@
# under the License.
- name: Copy overcloud.json to all_nodes.json
become: true
copy:
src: "{{ playbook_dir }}/group_vars/overcloud.json"
dest: "{{ dest_path | default('/etc/puppet/hieradata/all_nodes.json') }}"
- name: Render hieradata from template
become: true
template:
src: templates/{{ item }}.j2
dest: "{{ dest_path | default('/etc/puppet/hieradata/' ~ item ~ '.json') }}"

2
tripleo_ansible/roles/tripleo_hieradata/tasks/main.yml

@ -15,12 +15,14 @@
# under the License.
- name: Create /etc/puppet/hieradata
become: true
file:
path: /etc/puppet/hieradata
state: directory
mode: 0700
- name: Write hiera config
become: true
when:
- (hieradata_files | length) > 0
copy:

Loading…
Cancel
Save