From: Andrew Schoen Date: Thu, 9 Aug 2018 13:09:41 +0000 (-0500) Subject: lv-create: use copy instead of the template module X-Git-Tag: v3.2.0beta2~43 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=04df3f0802c0bc903172314d05a38e869f0eee6a;p=ceph-ansible.git lv-create: use copy instead of the template module The copy module does in fact do variable interpolation so we do not need to use the template module or keep a template in the source. Signed-off-by: Andrew Schoen --- diff --git a/infrastructure-playbooks/lv-create.yml b/infrastructure-playbooks/lv-create.yml index 485cae239..b1c87d525 100644 --- a/infrastructure-playbooks/lv-create.yml +++ b/infrastructure-playbooks/lv-create.yml @@ -3,6 +3,23 @@ hosts: - osds + vars: + logfile: | + Suggested cut and paste under "lvm_volumes:" in "group_vars/osds.yml" for configuring with osd_scenario=lvm + ----------------------------------------------------------------------------------------------------------- + {% for lv in nvme_device_lvs %} + - data: {{ lv.lv_name }} + data_vg: {{ nvme_vg_name }} + journal: {{ lv.journal_name }} + journal_vg: {{ nvme_vg_name }} + {% endfor %} + {% for hdd in hdd_devices %} + - data: {{ hdd_lv_prefix }}-{{ hdd.split('/')[-1] }} + data_vg: {{ hdd_vg_prefix }}-{{ hdd.split('/')[-1] }} + journal: {{ hdd_journal_prefix }}-{{ hdd.split('/')[-1] }} + journal_vg: {{ nvme_vg_name }} + {% endfor %} + tasks: - name: include vars of lv_vars.yaml @@ -73,7 +90,7 @@ - name: "write output for osds.yml to {{ logfile_path }}" become: false - template: - src: "templates/lv-create-log.j2" + copy: + content: "{{ logfile }}" dest: "{{ logfile_path }}" delegate_to: localhost diff --git a/infrastructure-playbooks/templates/lv-create-log.j2 b/infrastructure-playbooks/templates/lv-create-log.j2 deleted file mode 100644 index 8b0d78feb..000000000 --- a/infrastructure-playbooks/templates/lv-create-log.j2 +++ /dev/null @@ -1,14 +0,0 @@ -Suggested cut and paste under "lvm_volumes:" in "group_vars/osds.yml" for configuring with osd_scenario=lvm ------------------------------------------------------------------------------------------------------------ -{% for lv in nvme_device_lvs %} -- data: {{ lv.lv_name }} - data_vg: {{ nvme_vg_name }} - journal: {{ lv.journal_name }} - journal_vg: {{ nvme_vg_name }} -{% endfor %} -{% for hdd in hdd_devices %} -- data: {{ hdd_lv_prefix }}-{{ hdd.split('/')[-1] }} - data_vg: {{ hdd_vg_prefix }}-{{ hdd.split('/')[-1] }} - journal: {{ hdd_journal_prefix }}-{{ hdd.split('/')[-1] }} - journal_vg: {{ nvme_vg_name }} -{% endfor %} diff --git a/tox.ini b/tox.ini index ede234e57..9764cf1c9 100644 --- a/tox.ini +++ b/tox.ini @@ -29,11 +29,8 @@ commands= bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} cp {toxinidir}/infrastructure-playbooks/lv-create.yml {toxinidir}/lv-create.yml - mkdir -p {toxinidir}/templates - cp {toxinidir}/infrastructure-playbooks/templates/lv-create-log.j2 {toxinidir}/templates/lv-create-log.j2 ansible-playbook -vv -i {changedir}/hosts {toxinidir}/lv-create.yml - cp {toxinidir}/infrastructure-playbooks/lv-teardown.yml {toxinidir}/lv-teardown.yml ansible-playbook -vv -i {changedir}/hosts {toxinidir}/lv-teardown.yml --extra-vars "ireallymeanit=yes"