From b7f2fa2de43b5d24e119f9d2c68964aac5b8e097 Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Tue, 24 Oct 2017 19:24:39 -0600 Subject: ansible salt needs one file not in the buildroot --- salt/openbook/ansible/init.sls | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'salt') diff --git a/salt/openbook/ansible/init.sls b/salt/openbook/ansible/init.sls index b446c33..547544d 100644 --- a/salt/openbook/ansible/init.sls +++ b/salt/openbook/ansible/init.sls @@ -12,22 +12,14 @@ ansible_dirs_{{ dir[0] }}: - makedirs: True {% endfor %} -{% for symlink in pillar["ansible"]["symlinks"].items() %} -ansible_symlinks_{{ symlink[0] }}: - file.symlink: -{% if symlink[1]["relative_to_buildroot"] %} - - name: {{ pillar["ansible"]["build_dir"] }}/{{ symlink[1]["name"] }} - - target: {{ pillar["ansible"]["build_dir"] }}/{{ symlink[1]["target"] }} -{% else %} - - name: {{ symlink[1]["name"] }} - - target: {{ symlink[1]["target"] }} -{% endif %} -{% endfor %} - {% for file in pillar["ansible"]["files"].items() %} ansible_files_{{ file[0] }}: file.managed: +{% if file[1]["relative_to_buildroot"] %} - name: {{ pillar["ansible"]["build_dir"] }}/{{ file[1]["name"] }} +{% else %} + - name: {{ {{ file[1]["name"] }} +{% endif %} - source: salt://openbook/ansible/files/{{ file[1]["source"] }} {% if file[1]["is_template"] %} - template: jinja @@ -36,3 +28,15 @@ ansible_files_{{ file[0] }}: - group: root - mode: {{ file[1]["mode"] }} {% endfor %} + +{% for symlink in pillar["ansible"]["symlinks"].items() %} +ansible_symlinks_{{ symlink[0] }}: + file.symlink: +{% if symlink[1]["relative_to_buildroot"] %} + - name: {{ pillar["ansible"]["build_dir"] }}/{{ symlink[1]["name"] }} + - target: {{ pillar["ansible"]["build_dir"] }}/{{ symlink[1]["target"] }} +{% else %} + - name: {{ symlink[1]["name"] }} + - target: {{ symlink[1]["target"] }} +{% endif %} +{% endfor %} -- cgit v1.3