mirror of https://github.com/ceph/ceph-ansible.git
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
parent
54353f74e8
commit
d20288c3c2
|
@ -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
|
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
|
creates=/etc/yum.repos.d/ceph.repo
|
||||||
when: ceph_stable
|
when: ceph_stable
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Add Ceph development repository
|
- name: Add Ceph development repository
|
||||||
command: >
|
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
|
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
|
creates=/etc/yum.repos.d/ceph.repo
|
||||||
when: ceph_dev
|
when: ceph_dev
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Add Inktank Ceph Enterprise repository
|
- name: Add Inktank Ceph Enterprise repository
|
||||||
template: >
|
template: >
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
|
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: socket
|
register: socket
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Generate cluster UUID
|
- name: Generate cluster UUID
|
||||||
shell: >
|
shell: >
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
connection: local
|
connection: local
|
||||||
sudo: false
|
sudo: false
|
||||||
register: cluster_uuid
|
register: cluster_uuid
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Generate Ceph configuration file
|
- name: Generate Ceph configuration file
|
||||||
template: >
|
template: >
|
||||||
|
|
|
@ -2,16 +2,19 @@
|
||||||
- name: Disable OSD directory parsing by updatedb
|
- name: Disable OSD directory parsing by updatedb
|
||||||
command: updatedb -e /var/lib/ceph
|
command: updatedb -e /var/lib/ceph
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Disable transparent hugepage
|
- name: Disable transparent hugepage
|
||||||
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
|
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
|
||||||
when: disable_transparent_hugepage
|
when: disable_transparent_hugepage
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Disable swap
|
- name: Disable swap
|
||||||
command: swapoff -a
|
command: swapoff -a
|
||||||
when: disable_swap
|
when: disable_swap
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Apply OS tuning
|
- name: Apply OS tuning
|
||||||
sysctl: >
|
sysctl: >
|
||||||
|
|
|
@ -38,7 +38,9 @@
|
||||||
tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
|
tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
|
||||||
chdir={{ ceph_stable_ice_temp_path }}
|
chdir={{ ceph_stable_ice_temp_path }}
|
||||||
when: ceph_stable_ice and repo_exist.stat.exists == False
|
when: ceph_stable_ice and repo_exist.stat.exists == False
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Move ICE extracted packages
|
- name: Move ICE extracted packages
|
||||||
shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}"
|
shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}"
|
||||||
when: ceph_stable_ice and repo_exist.stat.exists == False
|
when: ceph_stable_ice and repo_exist.stat.exists == False
|
||||||
|
changed_when: False
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
shell: ls -1 /etc/ceph/*.keyring
|
shell: ls -1 /etc/ceph/*.keyring
|
||||||
register: ceph_keys
|
register: ceph_keys
|
||||||
when: cephx
|
when: cephx
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Set keys permissions
|
- name: Set keys permissions
|
||||||
file: >
|
file: >
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
with_items:
|
with_items:
|
||||||
- cephfs_data
|
- cephfs_data
|
||||||
- cephfs_metadata
|
- cephfs_metadata
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Create Ceph Filesystem
|
- name: Create Ceph Filesystem
|
||||||
command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
|
command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
|
||||||
|
changed_when: False
|
||||||
|
|
|
@ -7,9 +7,11 @@
|
||||||
- "{{ openstack_nova_pool }}"
|
- "{{ openstack_nova_pool }}"
|
||||||
- "{{ openstack_cinder_backup_pool }}"
|
- "{{ openstack_cinder_backup_pool }}"
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Create OpenStack keys
|
- name: Create OpenStack keys
|
||||||
command: >
|
command: >
|
||||||
ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring
|
ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring
|
||||||
creates=/etc/ceph/ceph.{{ item.name }}.keyring
|
creates=/etc/ceph/ceph.{{ item.name }}.keyring
|
||||||
with_items: openstack_keys
|
with_items: openstack_keys
|
||||||
|
changed_when: False
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
- done
|
- done
|
||||||
- upstart
|
- upstart
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Activate monitor with sysvinit
|
- name: Activate monitor with sysvinit
|
||||||
file: >
|
file: >
|
||||||
|
@ -42,3 +43,4 @@
|
||||||
- name: Get Ceph monitor version
|
- name: Get Ceph monitor version
|
||||||
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
|
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
|
||||||
register: ceph_version
|
register: ceph_version
|
||||||
|
changed_when: False
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
command: "ceph-disk prepare {{ item }}"
|
command: "ceph-disk prepare {{ item }}"
|
||||||
when: osd_directory
|
when: osd_directory
|
||||||
with_items: osd_directories
|
with_items: osd_directories
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
# Activate means:
|
# Activate means:
|
||||||
# - mount the volume in a temp location
|
# - mount the volume in a temp location
|
||||||
|
|
|
@ -4,12 +4,14 @@
|
||||||
with_items: devices
|
with_items: devices
|
||||||
register: osd_path
|
register: osd_path
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Get OSD id
|
- name: Get OSD id
|
||||||
command: cat {{ item.stdout }}/whoami
|
command: cat {{ item.stdout }}/whoami
|
||||||
register: osd_id
|
register: osd_id
|
||||||
with_items: osd_path.results
|
with_items: osd_path.results
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Create a Ceph fragment and assemble directory
|
- name: Create a Ceph fragment and assemble directory
|
||||||
file: >
|
file: >
|
||||||
|
@ -30,6 +32,7 @@
|
||||||
|
|
||||||
- name: Copy ceph.conf for assembling
|
- name: Copy ceph.conf for assembling
|
||||||
command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
|
command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Assemble OSD sections
|
- name: Assemble OSD sections
|
||||||
assemble: >
|
assemble: >
|
||||||
|
|
|
@ -29,5 +29,6 @@
|
||||||
- ispartition.results
|
- ispartition.results
|
||||||
- devices
|
- devices
|
||||||
- raw_journal_devices
|
- raw_journal_devices
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- include: activate_osds.yml
|
- include: activate_osds.yml
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
command: ceph-disk zap {{ item }}
|
command: ceph-disk zap {{ item }}
|
||||||
when: zap_devices and (journal_collocation or raw_multi_journal)
|
when: zap_devices and (journal_collocation or raw_multi_journal)
|
||||||
with_items: devices
|
with_items: devices
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Erasing partitions and labels from the journal device(s)
|
- name: Erasing partitions and labels from the journal device(s)
|
||||||
command: ceph-disk zap {{ item }}
|
command: ceph-disk zap {{ item }}
|
||||||
when: zap_devices and raw_multi_journal
|
when: zap_devices and raw_multi_journal
|
||||||
with_items: raw_journal_devices
|
with_items: raw_journal_devices
|
||||||
|
changed_when: False
|
||||||
|
|
|
@ -34,11 +34,13 @@
|
||||||
- name: Enable multiverse repo for Trusty
|
- name: Enable multiverse repo for Trusty
|
||||||
command: "apt-add-repository multiverse"
|
command: "apt-add-repository multiverse"
|
||||||
when: ansible_lsb.codename in ['trusty'] and not http_100_continue
|
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
|
# Disable the repo when we are using the Ceph repo for 100-continue packages
|
||||||
- name: Disable multiverse repo for Trusty
|
- name: Disable multiverse repo for Trusty
|
||||||
command: "apt-add-repository -r multiverse"
|
command: "apt-add-repository -r multiverse"
|
||||||
when: ansible_lsb.codename in ['trusty'] and http_100_continue
|
when: ansible_lsb.codename in ['trusty'] and http_100_continue
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
# If using 100-continue, add Ceph dev key
|
# If using 100-continue, add Ceph dev key
|
||||||
- name: Install the Ceph development repository key
|
- name: Install the Ceph development repository key
|
||||||
|
@ -110,6 +112,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- a2enmod rewrite
|
- a2enmod rewrite
|
||||||
- a2enmod fastcgi
|
- a2enmod fastcgi
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Install Rados Gateway vhost
|
- name: Install Rados Gateway vhost
|
||||||
template: >
|
template: >
|
||||||
|
@ -129,6 +132,7 @@
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
notify:
|
notify:
|
||||||
- restart apache2
|
- restart apache2
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Install s3gw.fcgi script
|
- name: Install s3gw.fcgi script
|
||||||
template: >
|
template: >
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
- name: Add special fastcgi repository
|
- 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
|
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"
|
- name: "Install Apache and fastcgi"
|
||||||
yum: >
|
yum: >
|
||||||
|
|
|
@ -9,3 +9,4 @@
|
||||||
- name: Start Ceph REST API
|
- name: Start Ceph REST API
|
||||||
shell: "nohup ceph-rest-api &"
|
shell: "nohup ceph-rest-api &"
|
||||||
when: restapi_status.rc != 0
|
when: restapi_status.rc != 0
|
||||||
|
changed_when: False
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
- done
|
- done
|
||||||
- upstart
|
- upstart
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: Activate Ceph REST API with sysvinit
|
- name: Activate Ceph REST API with sysvinit
|
||||||
file: >
|
file: >
|
||||||
|
|
Loading…
Reference in New Issue