Commit f183be03 authored by Andrew Schoen's avatar Andrew Schoen Committed by Sébastien Han
Browse files

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: default avatarAndrew Schoen <aschoen@redhat.com>
(cherry picked from commit 04df3f08

)
Signed-off-by: default avatarSébastien Han <seb@redhat.com>
parent 1decd53e
......@@ -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
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 %}
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment