Federico Ressi 66744be59c Remove quota handling from tobiko-configure role
Change-Id: Ic9948410664542d80b0b445ded03ccdd64201818
2021-07-20 19:51:40 +00:00

49 lines
1.3 KiB
YAML

---
- name: "pick undercloud SSH shotname from inventory"
set_fact:
undercloud_ssh_hostname: >-
{{ hostvars[undercloud_hostname].ansible_fqdn |
default(undercloud_hostname) }}
when:
- (undercloud_ssh_hostname | length) == 0
- (undercloud_hostname | length) > 0
- undercloud_hostname in hostvars
- name: "list configuration options"
set_fact:
test_conf_yaml: |
{% for section, options in (sections.items() | sort) %}
{% for option, value in (options.items() | sort) %}
- section: "{{ section }}"
option: "{{ option }}"
value: "{{ value }}"
{% endfor %}
{% endfor %}
vars:
sections: "{{ test_default_conf | combine(test_conf, recursive=True) }}"
- name: "generate '{{ test_conf_file }}' file"
ini_file:
path: "{{ test_conf_file }}"
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
mode: '0644'
when:
- item.section
- item.option
- item.value
loop: "{{ test_conf_yaml | from_yaml | list }}"
- name: "read resulting '{{ test_conf_file }}' file"
command: "cat '{{ test_conf_file }}'"
register: read_test_conf_file
- name: "show resulting '{{ test_conf_file }}' file"
debug: var=read_test_conf_file.stdout_lines