when:
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
- mon_group_name in group_names and
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ mon_group_name in group_names and not
+ is_ceph_infernalis
- name: restart ceph mons with systemd
service:
when:
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
- mon_group_name in group_names and not
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ mon_group_name in group_names and
+ is_ceph_infernalis
- name: restart ceph mons on ubuntu
command: restart ceph-mon-all
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
osd_group_name in group_names and
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ not is_ceph_infernalis
# This does not just restart OSDs but everything else too. Unfortunately
# at this time the ansible role does not have an OSD id list to use
when:
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
- osd_group_name in group_names and not
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ osd_group_name in group_names and
+ is_ceph_infernalis
- name: restart ceph osds on ubuntu
command: restart ceph-osd-all
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
mds_group_name in group_names and
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
-
+ ceph_stable and
+ ceph_stable_release in ceph_stable_releases
- name: restart ceph mdss with systemd
service:
when:
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
- mds_group_name in group_names and not
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ mds_group_name in group_names and
+ ceph_stable and
+ ceph_stable_release not in ceph_stable_releases
- name: restart ceph rgws on ubuntu
command: restart ceph-all
socketrgw.rc == 0 and
ansible_distribution != 'Ubuntu' and
rgw_group_name in group_names and
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ not is_ceph_infernalis
- name: restart ceph rgws on red hat
command: /etc/init.d/ceph-radosgw restart
socketrgw.rc == 0 and
ansible_os_family == 'RedHat' and
rgw_group_name in group_names and
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ not is_ceph_infernalis
- name: restart ceph rgws with systemd
service:
when:
socketrgw.rc == 0 and
ansible_distribution != 'Ubuntu' and
- rgw_group_name in group_names and not
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ rgw_group_name in group_names and
+ is_ceph_infernalis
- name: restart apache2
service:
- rbd_client_log_path
- rbd_client_admin_socket_path
when: rbd_client_directories
+
+- name: get ceph rhcs version
+ shell: rpm -q --qf "%{version}\n" ceph-common | cut -f1,2 -d '.'
+ changed_when: false
+ failed_when: false
+ register: rh_storage_version
+ when: ceph_stable_rh_storage
failed_when: false
register: socketrgw
-- name: create a local fetch directory if it doesn't exist
+- name: create a local fetch directory if it does not exist
local_action: file path={{ fetch_directory }} state=directory
changed_when: false
sudo: false
owner: root
group: root
mode: 0644
+
+# NOTE (leseb): be careful with the following
+# somehow the YAML syntax using "is_ceph_infernalis: {{"
+# does NOT work, so we keep this syntax styling...
+- set_fact:
+ is_ceph_infernalis={{ (ceph_stable and ceph_stable_release not in ceph_stable_releases) or (ceph_stable_rh_storage and (rh_storage_version.stdout | version_compare('0.94', '>'))) }}
owner: ceph
group: ceph
mode: 0755
- when: ceph_stable_release not in ceph_stable_releases
+ when: is_ceph_infernalis
- name: create bootstrap-mds directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when: cephx and ceph_stable_release in ceph_stable_releases
+ when: not is_ceph_infernalis
- name: copy mds bootstrap key (for or after infernalis release)
copy:
owner: ceph
group: ceph
mode: 0600
- when:
- cephx and ceph_stable_release not in ceph_stable_releases
+ when: is_ceph_infernalis
- name: copy mds bootstrap key (before infernalis release)
copy:
owner: root
group: root
mode: 0600
- when:
- cephx and ceph_stable_release in ceph_stable_releases
+ when: not is_ceph_infernalis
- name: create mds directory (for or after infernalis release)
file:
owner: ceph
group: ceph
mode: 0755
- when:
- cephx and ceph_stable_release not in ceph_stable_releases
+ when: is_ceph_infernalis
- name: create mds directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when:
- cephx and ceph_stable_release in ceph_stable_releases
+ when: not is_ceph_infernalis
- 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
group: ceph
when:
cephx and
- ceph_stable_release not in ceph_stable_releases
+ is_ceph_infernalis
- name: set mds key permissions (before infernalis)
file:
owner: root
group: root
when:
- cephx and ceph_stable_release in ceph_stable_releases
+ cephx and
+ not is_ceph_infernalis
- name: activate metadata server with upstart (for or after infernalis release)
file:
changed_when: false
when:
ansible_distribution == "Ubuntu" and
- ceph_stable_release not in ceph_stable_releases
+ is_ceph_infernalis
- name: activate metadata server with upstart (before infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" and ceph_stable_release in ceph_stable_releases
+ ansible_distribution == "Ubuntu" and
+ not is_ceph_infernalis
- name: activate metadata server with sysvinit (for or after infernalis release)
file:
changed_when: false
when:
ansible_distribution != "Ubuntu" and
- ceph_stable_release not in ceph_stable_releases
+ is_ceph_infernalis
- name: activate metadata server with sysvinit (before infernalis release)
file:
- sysvinit
changed_when: false
when:
- ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
+ ansible_distribution != "Ubuntu" and
+ not is_ceph_infernalis
- name: start and add that the metadata service to the init sequence (ubuntu)
service:
enabled: yes
args: mds.{{ ansible_hostname }}
changed_when: false
- when: ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
+ when:
+ ansible_distribution != "Ubuntu" and
+ not is_ceph_infernalis
- name: start and add that the metadata service to the init sequence (for or after infernalis)
service:
state: started
enabled: yes
changed_when: false
- when: ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
+ when:
+ ansible_distribution != "Ubuntu" and
+ is_ceph_infernalis
mode: 0600
owner: ceph
group: ceph
- when: ceph_stable_release not in ceph_stable_releases
+ when: is_ceph_infernalis
+
+- name: set initial monitor key permissions (before infernalis release)
+ file:
+ path: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
+ mode: 0600
+ owner: root
+ group: root
+ when: not is_ceph_infernalis
- name: create monitor directory (for or after infernalis release)
file:
owner: ceph
group: ceph
mode: 0755
- when: ceph_stable_release not in ceph_stable_releases
-
-- name: set initial monitor key permissions (before infernalis release)
- file:
- path: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
- mode: 0600
- owner: root
- group: root
- when: ceph_stable_release in ceph_stable_releases
+ when: is_ceph_infernalis
- name: create monitor directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when: ceph_stable_release in ceph_stable_releases
+ when: not is_ceph_infernalis
- name: ceph monitor mkfs (for or after infernalis release)
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
args:
creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
- when: ceph_stable_release not in ceph_stable_releases
+ when: is_ceph_infernalis
- name: ceph monitor mkfs (before infernalis release)
command: ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
args:
creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
- when: ceph_stable_release in ceph_stable_releases
+ when: not is_ceph_infernalis
owner: ceph
group: ceph
mode: 0600
+ changed_when: false
with_items:
- done
- upstart
- when:
- ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
-
- changed_when: false
+ when:
+ ansible_distribution == "Ubuntu" and
+ is_ceph_infernalis
- name: activate monitor with upstart before infernalis release
file:
owner: root
group: root
mode: 0600
+ changed_when: false
with_items:
- done
- upstart
when:
ansible_distribution == "Ubuntu" and
- ceph_stable_release in ceph_stable_releases
- changed_when: false
+ not is_ceph_infernalis
- name: start and add that the monitor service to the init sequence (ubuntu)
service:
changed_when: false
when:
ansible_distribution != "Ubuntu" and
- ceph_stable_release in ceph_stable_releases
+ not is_ceph_infernalis
- name: start and add that the monitor service to the init sequence (for or after infernalis)
service:
changed_when: false
when:
ansible_distribution != "Ubuntu" and
- ceph_stable_release not in ceph_stable_releases
+ is_ceph_infernalis
- name: collect admin and bootstrap keys
command: ceph-create-keys --id {{ ansible_hostname }}
state: started
enabled: yes
when:
- ansible_distribution == "Ubuntu" or
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ ansible_distribution != "Ubuntu" and
+ not is_ceph_infernalis
-- name: start and add that the osd service(s) to the init sequence (on or after infernalis)
+- name: start and add that the osd service(s) to the init sequence (for or after infernalis)
service:
name: ceph.target
state: started
enabled: yes
when:
- ansible_distribution != "Ubuntu" and not
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
-
+ ansible_distribution != "Ubuntu" and
+ is_ceph_infernalis
owner: ceph
group: ceph
mode: 0755
- when: cephx and ceph_stable_release not in ceph_stable_releases
+ when:
+ cephx and
+ is_ceph_infernalis
- name: create bootstrap-osd directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when: cephx and ceph_stable_release in ceph_stable_releases
+ when:
+ cephx and
+ not is_ceph_infernalis
- name: copy osd bootstrap key (for or after infernalis release)
copy:
owner: ceph
group: ceph
mode: 0600
- when: cephx and ceph_stable_release not in ceph_stable_releases
+ when:
+ cephx and
+ is_ceph_infernalis
- name: copy osd bootstrap key (before infernalis release)
copy:
owner: root
group: root
mode: 600
- when: cephx and ceph_stable_release in ceph_stable_releases
+ when:
+ cephx and
+ not is_ceph_infernalis
with_items:
- /var/lib/ceph/bootstrap-rgw
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
- when: ceph_stable_release not in ceph_stable_releases
+ when: is_ceph_infernalis
- name: create rados gateway directories (before infernalis release)
file:
with_items:
- /var/lib/ceph/bootstrap-rgw
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
- when: ceph_stable_release in ceph_stable_releases
+ when: not is_ceph_infernalis
- name: copy rados gateway bootstrap key (for or after infernalis release)
copy:
owner: ceph
group: ceph
mode: 0600
- when: cephx and ceph_stable_release not in ceph_stable_releases
+ when:
+ cephx and
+ is_ceph_infernalis
- name: copy rados gateway bootstrap key (before infernalis release)
copy:
owner: root
group: root
mode: 0600
- when: cephx and ceph_stable_release in ceph_stable_releases
+ when:
+ cephx and
+ not is_ceph_infernalis
- name: create rados gateway keyring
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
mode: 0600
owner: ceph
group: ceph
- when: cephx and ceph_stable_release not in ceph_stable_releases
+ when:
+ cephx and
+ is_ceph_infernalis
- name: set rados gateway key permissions (before infernalis release)
file:
mode: 0600
owner: root
group: root
- when: cephx and ceph_stable_release in ceph_stable_releases
+ when:
+ cephx and
+ not is_ceph_infernalis
- name: activate rados gateway with upstart (for or after infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
+ ansible_distribution == "Ubuntu" and
+ is_ceph_infernalis
- name: activate rados gateway with upstart (before infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" and ceph_stable_release in ceph_stable_releases
+ ansible_distribution == "Ubuntu" and
+ not is_ceph_infernalis
- name: activate rados gateway with sysvinit (for or after infernalis release)
file:
- sysvinit
changed_when: false
when:
- ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
+ ansible_distribution != "Ubuntu" and
+ is_ceph_infernalis
- name: activate rados gateway with sysvinit (before infernalis release)
file:
- sysvinit
changed_when: false
when:
- ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
+ ansible_distribution != "Ubuntu" and
+ not is_ceph_infernalis
- name: generate rados gateway sudoers file
template:
name: ceph-radosgw
state: started
enabled: yes
- when: ansible_os_family == 'RedHat' and
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ when:
+ ansible_os_family == 'RedHat' and
+ not is_ceph_infernalis
- name: start rgw on red hat (after infernalis)
service:
name: ceph-radosgw@{{ ansible_hostname }}
state: started
enabled: yes
- when: ansible_os_family == 'RedHat' and not
- (ceph_stable_release == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
+ when:
+ ansible_os_family == 'RedHat' and
+ is_ceph_infernalis