diff --git a/roles/pvc/tasks/ceph/bootstrap.yml b/roles/pvc/tasks/ceph/bootstrap.yml index cd9d879..2165c33 100644 --- a/roles/pvc/tasks/ceph/bootstrap.yml +++ b/roles/pvc/tasks/ceph/bootstrap.yml @@ -8,33 +8,15 @@ fsid: "{{ fsid_raw.stdout }}" - name: initialize bootstrap ceph.conf - file: - dest: /etc/ceph/ceph.conf - state: touch - -- name: set global section in bootstrap ceph.conf lineinfile: dest: /etc/ceph/ceph.conf - line: "[global]" - 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 %}" + line: "{{ item }}" 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 file: