]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Cosmetic 289/head
authorleseb <seb@redhat.com>
Thu, 25 Jun 2015 22:26:03 +0000 (00:26 +0200)
committerleseb <seb@redhat.com>
Fri, 26 Jun 2015 12:48:05 +0000 (14:48 +0200)
Add more visibility for the 'when' statement.

Signed-off-by: leseb <seb@redhat.com>
30 files changed:
roles/ceph-common/handlers/main.yml
roles/ceph-common/tasks/install_on_debian.yml
roles/ceph-common/tasks/install_on_redhat.yml
roles/ceph-common/tasks/main.yml
roles/ceph-common/tasks/os_tuning.yml
roles/ceph-common/tasks/prerequisite_ice.yml
roles/ceph-mds/tasks/docker.yml
roles/ceph-mds/tasks/pre_requisite.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-mon/tasks/create_mds_filesystems.yml
roles/ceph-mon/tasks/docker.yml
roles/ceph-mon/tasks/main.yml
roles/ceph-mon/tasks/openstack_config.yml
roles/ceph-mon/tasks/start_monitor.yml
roles/ceph-osd/tasks/activate_osds.yml
roles/ceph-osd/tasks/check_devices.yml
roles/ceph-osd/tasks/docker.yml
roles/ceph-osd/tasks/journal_collocation.yml
roles/ceph-osd/tasks/osd_directory.yml
roles/ceph-osd/tasks/osd_fragment.yml
roles/ceph-osd/tasks/raw_multi_journal.yml
roles/ceph-osd/tasks/zap_devices.yml
roles/ceph-radosgw/tasks/docker.yml
roles/ceph-radosgw/tasks/install_debian.yml
roles/ceph-radosgw/tasks/install_redhat.yml
roles/ceph-radosgw/tasks/main.yml
roles/ceph-radosgw/tasks/pre_requisite.yml
roles/ceph-radosgw/tasks/start_radosgw.yml
roles/ceph-restapi/tasks/main.yml
roles/ceph-restapi/tasks/pre_requisite.yml

index d6bf1cfc500e45fd51def6a83537d8667a6878ea..6e98ad90a7256111166566b7e89e8859bc03ea7c 100644 (file)
@@ -4,20 +4,31 @@
 
 - name: restart ceph mons
   command: service ceph restart mon
-  when: socket.rc == 0 and 'mons' in group_names
+  when:
+    socket.rc == 0 and
+    'mons' in group_names
 
 - name: restart ceph osds
   command: service ceph restart osd
-  when: socket.rc == 0 and 'osds' in group_names
+  when:
+    socket.rc == 0 and
+    'osds' in group_names
 
 - name: restart ceph osds on ubuntu
   command: restart ceph-osd-all
-  when: socket.rc == 0 and ansible_distribution == 'Ubuntu' and 'osds' in group_names
+  when:
+    socket.rc == 0 and
+    ansible_distribution == 'Ubuntu' and
+    'osds' in group_names
 
 - name: restart ceph mdss
   command: service ceph restart mds
-  when: socket.rc == 0 and 'mdss' in group_names
+  when:
+    socket.rc == 0 and
+    'mdss' in group_names
 
 - name: restart ceph rgws
   command: /etc/init.d/radosgw restart
-  when: socket.rc == 0 and 'rgws' in group_names
+  when:
+    socket.rc == 0 and
+    'rgws' in group_names
index 76fde548cd3b593ddd4fbee3020c61f763c62f70..e72fba2adfb12469c1dedcb990cab7eb1ed0705d 100644 (file)
   apt_repository: >
     repo="deb http://ceph.com/debian-{{ ceph_stable_release }}/ {{ ansible_lsb.codename }} main"
     state=present
+  changed_when: false
   when: ceph_stable
 
 - name: add Ceph development repository
   apt_repository: >
     repo="deb http://gitbuilder.ceph.com/ceph-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/{{ ceph_dev_branch }} {{ ansible_lsb.codename }} main"
     state=present
+  changed_when: false
   when: ceph_dev
 
 - name: add Inktank Ceph Enterprise repository
   apt_repository: >
     repo="deb file://{{ ceph_stable_ice_temp_path }} {{ ansible_lsb.codename }} main"
     state=present
+  changed_when: false
   when: ceph_stable_ice
 
 - name: install Ceph
index 2c915210dfebb62f548347637f974df126b7594b..0774e14752450e663ff061bfbeb26843eeafc126 100644 (file)
 
 - name: add Ceph stable repository
   yum: name=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
-  register: repo_result
+  changed_when: false
   when: ceph_stable
-  failed_when: repo_result.rc > 1
-  changed_when: repo_result.rc == 0
 
 - name: add Ceph development repository
   yum: name=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
-  register: repo_result
+  changed_when: false
   when: ceph_dev
-  failed_when: repo_result.rc > 1
-  changed_when: repo_result.rc == 0
 
 - name: add Inktank Ceph Enterprise repository
   template: >
index 8435dae6ad116b6fc59bbe00b3cab4049e865419..bfac9d0b6ff52c5182ac6cb66d685529b1cd6607 100644 (file)
 
 - name: check for a Ceph socket
   shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
+  changed_when: false
   ignore_errors: true
   register: socket
-  changed_when: False
 
 - name: generate cluster UUID
   shell: >
     uuidgen | tee fetch/ceph_cluster_uuid.conf
     creates=fetch/ceph_cluster_uuid.conf
   connection: local
-  sudo: false
   register: cluster_uuid
+  sudo: false
 
 - name: read cluster UUID if it already exists
   command: >
     cat fetch/ceph_cluster_uuid.conf
     removes=fetch/ceph_cluster_uuid.conf
   connection: local
-  sudo: false
+  changed_when: false
   register: cluster_uuid
-  changed_when: False
+  sudo: false
 
 - include: check-mandatory-vars.yml
 
index 2aee688fd6507040f652ebc61e616e9d35821a76..8e8e61f8a3b01a88526d0e6a61382b40b0105603 100644 (file)
@@ -1,20 +1,20 @@
 ---
 - name: disable OSD directory parsing by updatedb
   command: updatedb -e /var/lib/ceph
+  changed_when: false
   ignore_errors: true
-  changed_when: False
 
 - name: disable transparent hugepage
   command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
-  when: disable_transparent_hugepage
+  changed_when: false
   ignore_errors: true
-  changed_when: False
+  when: disable_transparent_hugepage
 
 - name: disable swap
   command: swapoff -a
-  when: disable_swap
+  changed_when: false
   ignore_errors: true
-  changed_when: False
+  when: disable_swap
 
 - name: apply OS tuning
   sysctl: >
index 542816b1e1e60e79d4f3f4d21c91402adf83b7c9..d03f33e31324cc168c1712e6e798ee1c37f6e0d3 100644 (file)
@@ -25,7 +25,9 @@
   with_items:
     - kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm
     - kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm
-  when: ceph_stable_ice and ansible_os_family == 'RedHat'
+  when:
+    ceph_stable_ice and
+    ansible_os_family == 'RedHat'
 
 - name: stat extracted ICE repo files
   stat: >
   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
-  changed_when: False
+  changed_when: false
+  when:
+    ceph_stable_ice and
+    repo_exist.stat.exists == False
 
 - name: move ICE extracted packages
   shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}"
-  when: ceph_stable_ice and repo_exist.stat.exists == False
-  changed_when: False
+  changed_when: false
+  when:
+    ceph_stable_ice and
+    repo_exist.stat.exists == False
index bf1c1084143424a0127c4b3320be9525140dee42..d0cb7ac5fa1781836304c165574fa8618f4b46a2 100644 (file)
@@ -9,14 +9,16 @@
       - /var/lib/ceph/bootstrap-mds/ceph.keyring
 
 - name: install docker-py
-  pip: name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
+  pip: >
+    name=docker-py
+    version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
 
 - name: stat for Ceph config and keys
   stat: >
     path={{ item }}
   with_items: ceph_config_keys
+  ignore_errors: true
   register: statconfig
-  ignore_errors: True
 
 - name: try to fetch Ceph config and keys
   copy: >
index 7195128cd7a5c29abfadbf805189133c5002702a..d7412ae4399de1ec1c99d3027f5dc190111ed558 100644 (file)
@@ -23,8 +23,8 @@
   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
+  changed_when: false
   when: cephx
-  changed_when: False
 
 - name: set MDS key permissions
   file: >
@@ -44,6 +44,7 @@
   with_items:
     - done
     - upstart
+  changed_when: false
   when: ansible_distribution == "Ubuntu"
 
 - name: activate metadata server with sysvinit
@@ -56,6 +57,7 @@
   with_items:
     - done
     - sysvinit
+  changed_when: false
   when: ansible_distribution != "Ubuntu"
 
 - name: start and add that the metadata service to the init sequence (Ubuntu)
@@ -64,6 +66,7 @@
     state=started
     enabled=yes
     args="id={{ ansible_hostname }}"
+  changed_when: false
   when: ansible_distribution == "Ubuntu"
 
 - name: start and add that the metadata service to the init sequence
@@ -72,4 +75,5 @@
     state=started
     enabled=yes
     args=mds
+  changed_when: false
   when: ansible_distribution != "Ubuntu"
index f1306ff55505ae930da6f473a046a7475367d2f3..babac4a3e8745efb327b7a8ecc85e18c9d88ee0c 100644 (file)
@@ -8,17 +8,21 @@
   command: >
     ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
     creates=/etc/ceph/ceph.client.restapi.keyring
-  when: cephx and restapi
-  changed_when: False
+  changed_when: false
+  when:
+    cephx and
+    restapi
 
 - include: openstack_config.yml
-  when: openstack_config and cephx
+  when:
+    openstack_config and
+    cephx
 
 - name: find Ceph keys
   shell: ls -1 /etc/ceph/*.keyring
+  changed_when: false
   register: ceph_keys
   when: cephx
-  changed_when: False
 
 - name: set keys permissions
   file: >
     src={{ item }}
     dest=fetch/{{ fsid }}/{{ item }}
     flat=yes
-  when: cephx
   with_items:
     - "{{ ceph_keys.stdout_lines }}"
     - /var/lib/ceph/bootstrap-osd/ceph.keyring
     - /var/lib/ceph/bootstrap-rgw/ceph.keyring
     - /var/lib/ceph/bootstrap-mds/ceph.keyring
+  when: cephx
 
 - name: drop in a motd script to report status when logging in
   copy: >
index 769024b1440e1d4a054d7d7cf6ab723becf16687..2a917ceb4c1263dc89506a5406fb191f03252df7 100644 (file)
@@ -8,10 +8,10 @@
   with_items:
     - cephfs_data
     - cephfs_metadata
-  changed_when: False
+  changed_when: false
   when: not {{ ceph_version.stdout | version_compare('0.84', '<') }}
 
 - name: create Ceph Filesystem
   command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
-  changed_when: False
+  changed_when: false
   when: not {{ ceph_version.stdout | version_compare('0.84', '<') }}
index 0abbe669f66ba7b93ec095ae1c00e2c371e18258..a920f16580dd7993a463f83e402c6461ffc780ef 100644 (file)
@@ -8,14 +8,16 @@
       - /etc/ceph/ceph.mon.keyring
 
 - name: install docker-py
-  pip: name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
+  pip: >
+    name=docker-py
+    version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
 
 - name: stat for Ceph config and keys
   stat: >
     path={{ item }}
   with_items: ceph_config_keys
+  ignore_errors: true
   register: statconfig
-  ignore_errors: True
 
 - name: try to fetch Ceph config and keys
   copy: >
index 0d950290993fc04891ddab590567ff08853b93f2..d56151e32a5b495ce838a4341bf7661cac93824d 100644 (file)
@@ -9,11 +9,14 @@
   when: not ceph_containerized_deployment
 
 - include: create_mds_filesystems.yml
-  when: not ceph_containerized_deployment and mds
+  when:
+    not ceph_containerized_deployment and
+    mds
 
 - include: secure_cluster.yml
-  when: secure_cluster and not ceph_containerized_deployment
-  tags: secure_cluster
+  when:
+    secure_cluster and
+    not ceph_containerized_deployment
 
 - include: docker.yml
   when: ceph_containerized_deployment
index e3462171cf6629f1d3ca301d69b043ec9aed366a..1bfdf4582af39ae3bf4a5c911e71956c4cc552ba 100644 (file)
@@ -6,12 +6,12 @@
     - "{{ openstack_cinder_pool }}"
     - "{{ openstack_nova_pool }}"
     - "{{ openstack_cinder_backup_pool }}"
-  ignore_errors: True
-  changed_when: False
+  changed_when: false
+  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
   with_items: openstack_keys
-  changed_when: False
+  changed_when: false
index e8a8496faf9b4696aceee2032d76ba0dec1af191..52ee896d22edeab7bed16e30fc9a5c2fc4d1dc85 100644 (file)
@@ -10,7 +10,7 @@
     - done
     - upstart
   when: ansible_distribution == "Ubuntu"
-  changed_when: False
+  changed_when: false
 
 - name: activate monitor with sysvinit
   file: >
@@ -42,5 +42,5 @@
 
 - name: get Ceph monitor version
   shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
+  changed_when: false
   register: ceph_version
-  changed_when: False
index 1011a74c6d3c66a571c8e95c90dad50ac2b73355..a1d12e88f6c3e47c31393bcc976b3b1a8cfa07ec 100644 (file)
@@ -8,9 +8,11 @@
     - parted.results
     - ispartition.results
     - devices
-  when: item.0.rc == 0 and item.1.rc != 0
-  ignore_errors: True
-  changed_when: False
+  changed_when: false
+  ignore_errors: true
+  when:
+    item.0.rc == 0 and
+    item.1.rc != 0
 
 # NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
 - name: activate OSD(s) when device is a partition
@@ -18,9 +20,9 @@
   with_together:
     - ispartition.results
     - devices
+  changed_when: false
+  ignore_errors: true
   when: item.0.rc == 0
-  ignore_errors: True
-  changed_when: False
 
 - include: osd_fragment.yml
   when: crush_location
index eae5d4dd66a43785f07b483c3aa37c02aa2a85ec..ab17959144aff6768b760b3ecb03d784033ed0d7 100644 (file)
@@ -2,18 +2,18 @@
 # NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1"
 # the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition
 # it should exist we rc=0 and don't do anything unless we do something like --force
-# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: True"
+# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: true"
 # I believe it's safer
 - name: check if the device is a partition or a disk
   shell: "echo '{{ item }}' | egrep '/dev/(([a-z]{3,4}[0-9]$)|(cciss/c[0-9]{1}d[0-9]{1}p[0-9]$))'"
-  ignore_errors: true
   with_items: devices
+  changed_when: false
+  ignore_errors: true
   register: ispartition
-  changed_when: False
 
 - name: if partition named 'ceph' exists
   shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
-  ignore_errors: True
   with_items: devices
+  changed_when: false
+  ignore_errors: true
   register: parted
-  changed_when: False
index 735476733010859106153178a114531f3446c57a..1d9fdad7ac40c3c6df5eecce70bd63e230450502 100644 (file)
@@ -9,14 +9,16 @@
       - /var/lib/ceph/bootstrap-osd/ceph.keyring
 
 - name: install docker-py
-  pip: name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
+  pip: >
+    name=docker-py
+    version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
 
 - name: stat for Ceph config and keys
   stat: >
     path={{ item }}
   with_items: ceph_config_keys
+  ignore_errors: true
   register: statconfig
-  ignore_errors: True
 
 - name: try to fetch Ceph config and keys
   copy: >
index 16f8e9e632dc89ba613d38b5dbe8c48270f0d88c..613715eea855d6f6e1c0cedaaaf6469040ff136e 100644 (file)
 # failed, this is why we check if the device is a partition too.
 - name: automatic prepare OSD disk(s) without partitions
   command: ceph-disk prepare "/dev/{{ item.key }}"
-  when: ansible_devices is defined and item.value.removable == "0" and item.value.partitions|count == 0 and journal_collocation and osd_auto_discovery
-  ignore_errors: True
-  with_dict: ansible_devices
+  ignore_errors: true
   register: prepared_osds
+  with_dict: ansible_devices
+  when:
+    ansible_devices is defined and
+    item.value.removable == "0" and
+    item.value.partitions|count == 0 and
+    journal_collocation and
+    osd_auto_discovery
 
 - name: manually Prepare OSD disk(s)
   command: "ceph-disk prepare {{ item.2 }}"
+  ignore_errors: true
+  with_together:
+    - parted.results
+    - ispartition.results
+    - devices
   when:
     item.0.rc != 0 and
     item.1.rc != 0 and
     journal_collocation and not
     osd_auto_discovery
-  ignore_errors: True
-  with_together:
-    - parted.results
-    - ispartition.results
-    - devices
 
 - include: activate_osds.yml
index f5c68a48de4f6c9ad224663c617fe97ad40eb332..7be19b77c85ff1018b8eaed12537d414577a73f2 100644 (file)
 # since Ansible will sequential process the loop
 - name: prepare OSD disk(s)
   command: "ceph-disk prepare {{ item }}"
-  when: osd_directory
   with_items: osd_directories
-  changed_when: False
+  changed_when: false
+  when: osd_directory
 
 - name: activate OSD(s)
   command: "ceph-disk activate {{ item }}"
   with_items: osd_directories
-  changed_when: False
+  changed_when: false
 
 - name: start and add that the OSD service to the init sequence
   service: >
index 930c52c92609053d5baa0e68da1b9e421a8f4648..13ac57c89c35e3c4c2fff49347629ea65947e2e9 100644 (file)
@@ -2,16 +2,16 @@
 - name: get OSD path
   shell: "df | grep {{ item }} | awk '{print $6}'"
   with_items: devices
-  register: osd_path
+  changed_when: false
   ignore_errors: true
-  changed_when: False
+  register: osd_path
 
 - name: get OSD id
   command: cat {{ item.stdout }}/whoami
-  register: osd_id
   with_items: osd_path.results
+  changed_when: false
   ignore_errors: true
-  changed_when: False
+  register: osd_id
 
 - name: create a Ceph fragment and assemble directory
   file: >
@@ -32,7 +32,7 @@
 
 - name: copy ceph.conf for assembling
   command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
-  changed_when: False
+  changed_when: false
 
 - name: assemble OSD sections
   assemble: >
index b63263750a458ca9c147c9c927bec59b5789499c..76b7f0ff0574f73cdd013d714d0255a73fee3c54 100644 (file)
 # failed, this is why we check if the device is a partition too.
 - name: prepare OSD disk(s)
   command: "ceph-disk prepare {{ item.2 }} {{ item.3 }}"
-  when: item.0.rc != 0 and
-        item.1.rc != 0 and
-        raw_multi_journal
-  ignore_errors: True
   with_together:
     - parted.results
     - ispartition.results
     - devices
     - raw_journal_devices
-  changed_when: False
+  changed_when: false
+  ignore_errors: true
+  when:
+    item.0.rc != 0 and
+    item.1.rc != 0 and
+    raw_multi_journal
 
 - include: activate_osds.yml
index e5cbc9d0049d14d2a7c260a42d87a53518462abe..9180daa09083ff91759d6f92a1d2732bc8e62de2 100644 (file)
@@ -4,12 +4,16 @@
 # ensures that the device will get successfully prepared.
 - name: erasing partitions and labels from OSD disk(s)
   command: ceph-disk zap {{ item }}
-  when: zap_devices and (journal_collocation or raw_multi_journal)
   with_items: devices
-  changed_when: False
+  changed_when: false
+  when:
+    zap_devices and
+    (journal_collocation or raw_multi_journal)
 
 - name: erasing partitions and labels from the journal device(s)
   command: ceph-disk zap {{ item }}
-  when: zap_devices and raw_multi_journal
   with_items: raw_journal_devices
-  changed_when: False
+  changed_when: false
+  when:
+    zap_devices and
+    raw_multi_journal
index fe8de1a66533b9605c5c6afb9b189d58df3030b8..43bf4c1ab4e6759b9a736228db56c12f80660efb 100644 (file)
@@ -9,14 +9,16 @@
       - /var/lib/ceph/bootstrap-rgw/ceph.keyring
 
 - name: install docker-py
-  pip: name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
+  pip: >
+    name=docker-py
+    version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227
 
 - name: stat for Ceph config and keys
   stat: >
     path={{ item }}
   with_items: ceph_config_keys
+  ignore_errors: true
   register: statconfig
-  ignore_errors: True
 
 - name: try to fetch Ceph config and keys
   copy: >
index 4922ddd45d871b991b84738751139b7dd5b2f1f6..1752f19ba5c4ff12b0bf5f1978470c9909131fc0 100644 (file)
@@ -14,7 +14,9 @@
     - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse
     - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
     - deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse
-  when: ansible_lsb.codename in ['precise'] and not http_100_continue
+  when:
+    ansible_lsb.codename in ['precise'] and not
+    http_100_continue
 
 # NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
 - name: disable multiverse repo for Precise
     - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse
     - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
     - deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse
-  when: ansible_lsb.codename in ['precise'] and http_100_continue
+  when:
+    ansible_lsb.codename in ['precise'] and
+    http_100_continue
 
 # NOTE (leseb): needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
 - name: enable multiverse repo for Trusty
   command: "apt-add-repository multiverse"
-  when: ansible_lsb.codename in ['trusty'] and not http_100_continue
-  changed_when: False
+  changed_when: false
+  when:
+    ansible_lsb.codename in ['trusty'] and not
+    http_100_continue
 
 # NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
 - name: disable multiverse repo for Trusty
   command: "apt-add-repository -r multiverse"
-  when: ansible_lsb.codename in ['trusty'] and http_100_continue
-  changed_when: False
+  changed_when: false
+  when:
+    ansible_lsb.codename in ['trusty'] and
+    http_100_continue
 
 # NOTE (leseb): if using 100-continue, add Ceph dev key
 - name: install the Ceph development repository key
@@ -83,7 +91,9 @@
     - apache2.2-bin
     - apache2.2-common
     - libapache2-mod-fastcgi
-  when: purge_default_apache.changed or purge_ceph_apache.changed
+  when:
+    purge_default_apache.changed or
+    purge_ceph_apache.changed
 
 - name: install Apache and fastcgi
   apt: >
   with_items:
     - a2enmod rewrite
     - a2enmod fastcgi
-  changed_when: False
+  changed_when: false
 
 - name: install Rados Gateway vhost
   template: >
   with_items:
     - a2ensite rgw.conf
     - a2dissite *default
-  ignore_errors: True
+  changed_when: false
+  ignore_errors: true
   notify:
     - restart apache2
-  changed_when: False
 
 - name: install s3gw.fcgi script
   template: >
index 436d21ef233b45e278787abff482c215721c007d..9be921d6cb808a3fae5e1d293216bd983522f876 100644 (file)
@@ -11,7 +11,7 @@
 
 - name: add special fastcgi repository
   command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
-  changed_when: False
+  changed_when: false
 
 - name: install Apache and fastcgi
   yum: >
@@ -39,6 +39,6 @@
 
 - name: disable default site
   shell: sed -i "s/^[^+#]/#/g" /etc/httpd/conf.d/welcome.conf
-  changed_when: False
+  changed_when: false
   notify:
     - restart apache2
index eddbe05ac6ef92a592905852f9fec744923e5989..05f3d0070ee7cb3a6f54e26d041dfe6bf744e264 100644 (file)
@@ -3,23 +3,33 @@
   when: not ceph_containerized_deployment
 
 - include: install_redhat.yml
-  when: ansible_os_family == 'RedHat' and radosgw_frontend == 'apache' and not ceph_containerized_deployment
+  when:
+    ansible_os_family == 'RedHat' and
+    radosgw_frontend == 'apache' and not
+    ceph_containerized_deployment
 
 - include: install_debian.yml
-  when: ansible_os_family == 'Debian' and radosgw_frontend == 'apache' and not ceph_containerized_deployment
+  when:
+    ansible_os_family == 'Debian' and
+    radosgw_frontend == 'apache' and not
+    ceph_containerized_deployment
 
 - name: install Rados Gateway
   apt: >
     pkg=radosgw
     state=present
     update_cache=yes
-  when: ansible_os_family == 'Debian' and not ceph_containerized_deployment
+  when:
+    ansible_os_family == 'Debian' and not
+    ceph_containerized_deployment
 
 - name: install Rados Gateway
   yum: >
     name=ceph-radosgw
     state=present
-  when: ansible_os_family == 'RedHat' and not ceph_containerized_deployment
+  when:
+    ansible_os_family == 'RedHat' and not
+    ceph_containerized_deployment
 
 - include: openstack-keystone.yml
   when: radosgw_keystone
index 88243ff1e3bdfb6b2f88ec148368bed4c80b5cfd..fbd2114a8ebfb06e98ad723a702f2a2285142b53 100644 (file)
@@ -23,8 +23,8 @@
   command: >
     ceph --cluster ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/ceph.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
     creates=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
+  changed_when: false
   when: cephx
-  changed_when: False
 
 - name: set RGW key permissions
   file: >
@@ -44,4 +44,5 @@
   with_items:
     - done
     - upstart
+  changed_when: false
   when: ansible_distribution == "Ubuntu"
index 442072247a0039ce4c599a7d0165806af38e0ce0..f56dca901b5601efb74a45a28393cb620af64798 100644 (file)
@@ -2,17 +2,25 @@
 # NOTE (leseb): if we don't perform this check Ansible will start multiple instance of radosgw
 - name: check if RGW is started
   command: /etc/init.d/radosgw status
+  changed_when: false
+  ignore_errors: true
   register: rgwstatus
-  ignore_errors: True
 
 - name: start RGW
   command: /etc/init.d/radosgw start
-  when: rgwstatus.rc != 0 and ansible_distribution != "Ubuntu" and ansible_os_family != 'RedHat'
+  when:
+    rgwstatus.rc != 0 and
+    ansible_distribution != "Ubuntu" and
+    ansible_os_family != 'RedHat'
 
 - name: start RGW
-  service: name=radosgw-all state=started
+  service: >
+    name=radosgw-all
+    state=started
   when: ansible_distribution == "Ubuntu"
 
 - name: start RGW
-  service: name=ceph-radosgw state=started
+  service: >
+    name=ceph-radosgw
+    state=started
   when: ansible_os_family == 'RedHat'
index 7731862759d5cbb4a46fdf6c8f7f367ba15fd889..6d8ebc18f62beeff4cdfaa7f484999ff7f2189ef 100644 (file)
@@ -3,10 +3,10 @@
 
 - name: check if Ceph REST API is already started
   shell: "pgrep ceph-rest-api"
+  ignore_errors: true
   register: restapi_status
-  ignore_errors: True
 
 - name: start Ceph REST API
   shell: "nohup ceph-rest-api &"
+  changed_when: false
   when: restapi_status.rc != 0
-  changed_when: False
index 92e855532354451b686f10b6e28f2da1770f47a3..982f9828c28d8513730b215643aa9dee2947fd70 100644 (file)
@@ -26,8 +26,8 @@
   with_items:
     - done
     - upstart
+  changed_when: false
   when: ansible_distribution == "Ubuntu"
-  changed_when: False
 
 - name: activate Ceph REST API with sysvinit
   file: >