Simplify and combine

This commit is contained in:
Joshua Boniface 2019-06-13 16:25:33 -04:00
parent 05e0291493
commit 995a8e86f4
1 changed files with 6 additions and 24 deletions

View File

@ -8,33 +8,15 @@
fsid: "{{ fsid_raw.stdout }}" fsid: "{{ fsid_raw.stdout }}"
- name: initialize bootstrap ceph.conf - name: initialize bootstrap ceph.conf
file:
dest: /etc/ceph/ceph.conf
state: touch
- name: set global section in bootstrap ceph.conf
lineinfile: lineinfile:
dest: /etc/ceph/ceph.conf dest: /etc/ceph/ceph.conf
line: "[global]" line: "{{ item }}"
state: present
- name: set fsid in bootstrap ceph.conf
lineinfile:
dest: /etc/ceph/ceph.conf
line: "fsid = {{ fsid }}"
state: present
- name: set mon initial members in bootstrap ceph.conf
lineinfile:
dest: /etc/ceph/ceph.conf
line: "mon initial members = {% for host in pvc_nodes if host.is_coordinator %}{{ host.hostname }}{% if not loop.last %},{% endif %}{% endfor %}"
state: present
- name: set mon hosts in bootstrap ceph.conf
lineinfile:
dest: /etc/ceph/ceph.conf
line: "mon host = {% for host in pvc_nodes if host.is_coordinator %}{{ host.cluster_ip }}{% if not loop.last %},{% endif %}{% endfor %}"
state: present state: present
with_items:
- "[global]"
- "fsid = {{ fsid }}"
- "mon initial members = {% for host in pvc_nodes if host.is_coordinator %}{{ host.hostname }}{% if not loop.last %},{% endif %}{% endfor %}"
- "mon host = {% for host in pvc_nodes if host.is_coordinator %}{{ host.cluster_ip }}{% if not loop.last %},{% endif %}{% endfor %}"
- name: create temporary directory - name: create temporary directory
file: file: