Only change when the task returns false

We only want to see things that really changed after a play completes.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
pull/245/head
Sébastien Han 2015-04-08 18:46:54 +02:00
parent 54353f74e8
commit d20288c3c2
16 changed files with 30 additions and 0 deletions

View File

@ -33,12 +33,14 @@
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
changed_when: False
- 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
when: ceph_dev
changed_when: False
- name: Add Inktank Ceph Enterprise repository
template: >

View File

@ -16,6 +16,7 @@
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
ignore_errors: true
register: socket
changed_when: False
- name: Generate cluster UUID
shell: >
@ -32,6 +33,7 @@
connection: local
sudo: false
register: cluster_uuid
changed_when: False
- name: Generate Ceph configuration file
template: >

View File

@ -2,16 +2,19 @@
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph
ignore_errors: true
changed_when: False
- name: Disable transparent hugepage
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
when: disable_transparent_hugepage
ignore_errors: true
changed_when: False
- name: Disable swap
command: swapoff -a
when: disable_swap
ignore_errors: true
changed_when: False
- name: Apply OS tuning
sysctl: >

View File

@ -38,7 +38,9 @@
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
- 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

View File

@ -27,6 +27,7 @@
shell: ls -1 /etc/ceph/*.keyring
register: ceph_keys
when: cephx
changed_when: False
- name: Set keys permissions
file: >

View File

@ -4,6 +4,8 @@
with_items:
- cephfs_data
- cephfs_metadata
changed_when: False
- name: Create Ceph Filesystem
command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
changed_when: False

View File

@ -7,9 +7,11 @@
- "{{ openstack_nova_pool }}"
- "{{ openstack_cinder_backup_pool }}"
ignore_errors: True
changed_when: False
- 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

View File

@ -10,6 +10,7 @@
- done
- upstart
when: ansible_distribution == "Ubuntu"
changed_when: False
- name: Activate monitor with sysvinit
file: >
@ -42,3 +43,4 @@
- name: Get Ceph monitor version
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
register: ceph_version
changed_when: False

View File

@ -30,6 +30,7 @@
command: "ceph-disk prepare {{ item }}"
when: osd_directory
with_items: osd_directories
changed_when: False
# Activate means:
# - mount the volume in a temp location

View File

@ -4,12 +4,14 @@
with_items: devices
register: osd_path
ignore_errors: true
changed_when: False
- name: Get OSD id
command: cat {{ item.stdout }}/whoami
register: osd_id
with_items: osd_path.results
ignore_errors: true
changed_when: False
- name: Create a Ceph fragment and assemble directory
file: >
@ -30,6 +32,7 @@
- name: Copy ceph.conf for assembling
command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
changed_when: False
- name: Assemble OSD sections
assemble: >

View File

@ -29,5 +29,6 @@
- ispartition.results
- devices
- raw_journal_devices
changed_when: False
- include: activate_osds.yml

View File

@ -6,8 +6,10 @@
command: ceph-disk zap {{ item }}
when: zap_devices and (journal_collocation or raw_multi_journal)
with_items: devices
changed_when: False
- 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

View File

@ -34,11 +34,13 @@
- 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
# 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
# If using 100-continue, add Ceph dev key
- name: Install the Ceph development repository key
@ -110,6 +112,7 @@
with_items:
- a2enmod rewrite
- a2enmod fastcgi
changed_when: False
- name: Install Rados Gateway vhost
template: >
@ -129,6 +132,7 @@
ignore_errors: True
notify:
- restart apache2
changed_when: False
- name: Install s3gw.fcgi script
template: >

View File

@ -14,6 +14,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
- name: "Install Apache and fastcgi"
yum: >

View File

@ -9,3 +9,4 @@
- name: Start Ceph REST API
shell: "nohup ceph-rest-api &"
when: restapi_status.rc != 0
changed_when: False

View File

@ -27,6 +27,7 @@
- done
- upstart
when: ansible_distribution == "Ubuntu"
changed_when: False
- name: Activate Ceph REST API with sysvinit
file: >