From e4a90319525abfe0d6b0eed2686d381c7d17ad34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 19 Mar 2015 12:21:29 +0100 Subject: [PATCH] Improve YAML syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve readibility. Signed-off-by: Sébastien Han --- maintenance.yml | 11 +++++++++-- roles/ceph-common/tasks/install_on_redhat.yml | 8 ++++++-- roles/ceph-common/tasks/main.yml | 8 ++++++-- roles/ceph-common/tasks/prerequisite_ice.yml | 4 +++- roles/ceph-mds/tasks/pre_requisite.yml | 4 +++- roles/ceph-mon/tasks/ceph_keys.yml | 4 +++- roles/ceph-mon/tasks/deploy_monitors.yml | 8 ++++++-- roles/ceph-mon/tasks/openstack_config.yml | 5 +++-- roles/ceph-osd/defaults/main.yml | 2 -- roles/ceph-radosgw/tasks/install_debian.yml | 6 +++++- 10 files changed, 44 insertions(+), 16 deletions(-) diff --git a/maintenance.yml b/maintenance.yml index 9b115d116..3b7d2a9c6 100644 --- a/maintenance.yml +++ b/maintenance.yml @@ -20,10 +20,17 @@ command: poweroff - name: Wait for the server to go down - local_action: wait_for host= port=22 state=stopped + local_action: > + wait_for host= + port=22 + state=stopped - name: Wait for the server to come up - local_action: wait_for host= + wait_for host= + rpm -U http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm + creates=/etc/yum.repos.d/ceph.repo when: ceph_stable - name: Add Ceph development repository - command: "rpm -U http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm creates=/etc/yum.repos.d/ceph.repo" + command: > + rpm -U http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm + creates=/etc/yum.repos.d/ceph.repo when: ceph_dev - name: Add Inktank Ceph Enterprise repository diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index 96a9b5f7f..aff3da4ac 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -18,13 +18,17 @@ register: socket - name: Generate cluster UUID - shell: uuidgen | tee fetch/ceph_cluster_uuid.conf creates=fetch/ceph_cluster_uuid.conf + shell: > + uuidgen | tee fetch/ceph_cluster_uuid.conf + creates=fetch/ceph_cluster_uuid.conf connection: local sudo: false register: cluster_uuid - name: Read cluster UUID if it already exists - command: cat fetch/ceph_cluster_uuid.conf removes=fetch/ceph_cluster_uuid.conf + command: > + cat fetch/ceph_cluster_uuid.conf + removes=fetch/ceph_cluster_uuid.conf connection: local sudo: false register: cluster_uuid diff --git a/roles/ceph-common/tasks/prerequisite_ice.yml b/roles/ceph-common/tasks/prerequisite_ice.yml index 680665060..da530f3e9 100644 --- a/roles/ceph-common/tasks/prerequisite_ice.yml +++ b/roles/ceph-common/tasks/prerequisite_ice.yml @@ -34,7 +34,9 @@ when: ceph_stable_ice - name: Extract ICE packages - shell: "cd {{ ceph_stable_ice_temp_path }} && tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz" + shell: > + tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz + chdir={{ ceph_stable_ice_temp_path }} when: ceph_stable_ice and repo_exist.stat.exists == False - name: Move ICE extracted packages diff --git a/roles/ceph-mds/tasks/pre_requisite.yml b/roles/ceph-mds/tasks/pre_requisite.yml index bc83aede1..0bd1ffee3 100644 --- a/roles/ceph-mds/tasks/pre_requisite.yml +++ b/roles/ceph-mds/tasks/pre_requisite.yml @@ -20,7 +20,9 @@ when: cephx - name: Create MDS keyring - command: ceph --cluster ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.{{ ansible_hostname }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring creates=/var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring + command: > + ceph --cluster ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.{{ ansible_hostname }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring + creates=/var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring when: cephx changed_when: False diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index fda56a529..73761a2c2 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -6,7 +6,9 @@ wait_for: path=/etc/ceph/ceph.client.admin.keyring - name: Create RGW keyring - command: ceph auth get-or-create client.radosgw.{{ hostvars[item]['ansible_hostname'] }} osd 'allow rwx' mon 'allow rw' -o /etc/ceph/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring creates=/etc/ceph/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring + command: > + ceph auth get-or-create client.radosgw.{{ hostvars[item]['ansible_hostname'] }} osd 'allow rwx' mon 'allow rw' -o /etc/ceph/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring + creates=/etc/ceph/radosgw.{{ hostvars[item]['ansible_hostname'] }}.keyring when: cephx and radosgw with_items: groups.rgws changed_when: False diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml index 3721f16b9..6f8fcfc07 100644 --- a/roles/ceph-mon/tasks/deploy_monitors.yml +++ b/roles/ceph-mon/tasks/deploy_monitors.yml @@ -1,6 +1,8 @@ --- - name: Create monitor initial keyring - command: "ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --add-key={{ monitor_secret | mandatory }} --cap mon 'allow *' creates=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}" + command: > + ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --add-key={{ monitor_secret | mandatory }} --cap mon 'allow *' + creates=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} - name: Set initial monitor key permissions file: > @@ -18,7 +20,9 @@ mode=0644 - name: Ceph monitor mkfs - command: "ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring" + command: > + ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} + creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring - name: Start and add that the monitor service to the init sequence service: > diff --git a/roles/ceph-mon/tasks/openstack_config.yml b/roles/ceph-mon/tasks/openstack_config.yml index 8d8566bc3..870c17a8b 100644 --- a/roles/ceph-mon/tasks/openstack_config.yml +++ b/roles/ceph-mon/tasks/openstack_config.yml @@ -1,5 +1,4 @@ --- - - name: Create OpenStack pool command: rados mkpool {{ item }} with_items: @@ -10,5 +9,7 @@ ignore_errors: True - name: Create OpenStack keys - command: ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring creates=/etc/ceph/ceph.{{ item.name }}.keyring + command: > + ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring + creates=/etc/ceph/ceph.{{ item.name }}.keyring with_items: openstack_keys diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml index 5f767c2a1..f18ed49bb 100644 --- a/roles/ceph-osd/defaults/main.yml +++ b/roles/ceph-osd/defaults/main.yml @@ -51,8 +51,6 @@ zap_devices: false devices: - /dev/sdb - /dev/sdc - - /dev/sdd - - /dev/sde # Device discovery is based on the Ansible fact 'ansible_devices' # which reports all the devices on a system. If chosen all the disks diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml index e8c0b3f6f..16f95d803 100644 --- a/roles/ceph-radosgw/tasks/install_debian.yml +++ b/roles/ceph-radosgw/tasks/install_debian.yml @@ -99,7 +99,11 @@ # - name: Install default httpd.conf - template: src=httpd.conf dest=/etc/apache2/httpd.conf owner=root group=root + template: > + src=httpd.conf + dest=/etc/apache2/httpd.conf + owner=root + group=root - name: Enable some apache mod rewrite and fastcgi command: "{{ item }}"