Added ceph_release generation and fixed missing whitespace in ceph_release checks

pull/953/head
James Saint-Rossy 2016-09-09 18:16:41 -04:00
parent 666637f715
commit d4a60a9394
14 changed files with 65 additions and 54 deletions

View File

@ -4,4 +4,4 @@ coreos_pypy_url: https://bitbucket.org/pypy/pypy/downloads/pypy-{{coreos_pypy_ve
pypy_directory: /opt/pypy
pypy_binary_directory: /opt/bin
pip_url: https://bootstrap.pypa.io/get-pip.py
local_temp_directory: /tmp
local_temp_directory: /tmp

View File

@ -13,4 +13,4 @@
ignore_errors: true
- include: install_pip.yml
when: need_pip | failed and need_python | failed
when: need_pip | failed and need_python | failed

View File

@ -9,7 +9,7 @@
- socket.rc == 0
- ansible_distribution != 'Ubuntu'
- mon_group_name in group_names
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: restart ceph mons with systemd
service:
@ -19,7 +19,7 @@
- socket.rc == 0
- use_systemd
- mon_group_name in group_names
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: restart ceph mons on ubuntu
command: initctl restart ceph-mon cluster={{ cluster }} id={{ monitor_name }}
@ -35,7 +35,7 @@
- socket.rc == 0
- ansible_distribution != 'Ubuntu'
- osd_group_name in group_names
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.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
@ -48,7 +48,7 @@
- socket.rc == 0
- use_systemd
- osd_group_name in group_names
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: restart ceph osds on ubuntu
shell: |
@ -76,7 +76,7 @@
- ansible_distribution != 'Ubuntu'
- use_systemd
- mds_group_name in group_names
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: restart ceph mdss with systemd
service:
@ -86,7 +86,7 @@
- socket.rc == 0
- use_systemd
- mds_group_name in group_names
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: restart ceph rgws on ubuntu
command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
@ -102,7 +102,7 @@
- socketrgw.rc == 0
- ansible_distribution != 'Ubuntu'
- rgw_group_name in group_names
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: restart ceph rgws on red hat
command: /etc/init.d/ceph-radosgw restart
@ -110,7 +110,7 @@
- socketrgw.rc == 0
- ansible_os_family == 'RedHat'
- rgw_group_name in group_names
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: restart ceph rgws with systemd
service:
@ -120,7 +120,7 @@
- socketrgw.rc == 0
- use_systemd
- rgw_group_name in group_names
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: restart apache2
service:

View File

@ -76,7 +76,7 @@
name: ceph
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when:
- ceph_release_num.{{ ceph_release}} <= ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} <= ceph_release_num.infernalis
- ansible_pkg_mgr == "yum"
- ceph_origin != 'local'
@ -106,7 +106,7 @@
when:
- mon_group_name in group_names
- ansible_pkg_mgr == "yum"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -117,7 +117,7 @@
when:
- mon_group_name in group_names
- ansible_pkg_mgr == "dnf"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -128,7 +128,7 @@
when:
- osd_group_name in group_names
- ansible_pkg_mgr == "yum"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -139,7 +139,7 @@
when:
- osd_group_name in group_names
- ansible_pkg_mgr == "dnf"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -150,7 +150,7 @@
when:
- mds_group_name in group_names
- ansible_pkg_mgr == "yum"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -161,7 +161,7 @@
when:
- mds_group_name in group_names
- ansible_pkg_mgr == "dnf"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -172,7 +172,7 @@
when:
- client_group_name in group_names
- ansible_pkg_mgr == "yum"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom
@ -183,7 +183,7 @@
when:
- client_group_name in group_names
- ansible_pkg_mgr == "dnf"
- ceph_release_num.{{ ceph_release}} > ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
or ceph_origin == "distro"
or ceph_custom

View File

@ -111,77 +111,77 @@
dir_owner: ceph
dir_group: ceph
dir_mode: "0755"
when: ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- set_fact:
dir_owner: root
dir_group: root
dir_mode: "0755"
when: ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
when: ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- set_fact:
key_owner: root
key_group: root
key_mode: "0600"
when: ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
when: ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- set_fact:
key_owner: ceph
key_group: ceph
key_mode: "0600"
when: ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- set_fact:
activate_file_owner: ceph
activate_file_group: ceph
activate_file_mode: "0644"
when: ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- set_fact:
activate_file_owner: root
activate_file_group: root
activate_file_mode: "0644"
when: ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
when: ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- set_fact:
rbd_client_directory_owner: root
when:
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- rbd_client_directory_owner is not defined
or not rbd_client_directory_owner
- set_fact:
rbd_client_directory_owner: ceph
when:
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- rbd_client_directory_owner is not defined
or not rbd_client_directory_owner
- set_fact:
rbd_client_directory_group: root
when:
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- rbd_client_directory_group is not defined
or not rbd_client_directory_group
- set_fact:
rbd_client_directory_group: ceph
when:
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- rbd_client_directory_group is not defined
or not rbd_client_directory_group
- set_fact:
rbd_client_directory_mode: "1777"
when:
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- rbd_client_directory_mode is not defined
or not rbd_client_directory_mode
- set_fact:
rbd_client_directory_mode: "0770"
when:
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- rbd_client_directory_mode is not defined
or not rbd_client_directory_mode

View File

@ -0,0 +1,11 @@
---
# Set ceph_release to ceph_stable by default
- set_fact:
ceph_release: "{{ ceph_stable_release }}"
# Set ceph_release to latest known release (Which should match ceph_dev)
- set_fact:
ceph_release: "{{ item.key }}"
when:
ceph_dev and ({{ item.value }} > ceph_release_num.{{ ceph_release }})
with_dict: "{{ ceph_release_num }}"

View File

@ -76,7 +76,7 @@
failed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: start and add that the metadata service to the init sequence (upstart)
command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }}
@ -93,7 +93,7 @@
changed_when: false
when:
- not use_systemd
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: start and add that the metadata service to the init sequence (systemd after hammer)
service:
@ -103,4 +103,4 @@
changed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer

View File

@ -50,7 +50,7 @@
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
when:
- cephx
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: ceph monitor mkfs without keyring (for or after infernalis release)
command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
@ -58,7 +58,7 @@
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
when:
- not cephx
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: ceph monitor mkfs with keyring (before infernalis release)
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
@ -66,7 +66,7 @@
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
when:
- cephx
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: ceph monitor mkfs without keyring (before infernalis release)
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
@ -74,4 +74,4 @@
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
when:
- not cephx
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis

View File

@ -47,7 +47,7 @@
failed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: start the monitor service (for or after infernalis)
service:
@ -57,7 +57,7 @@
changed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: collect admin and bootstrap keys
command: ceph-create-keys --cluster {{ cluster }} --id {{ monitor_name }}

View File

@ -89,7 +89,7 @@
- ansible_selinux != false
- ansible_selinux['status'] == 'enabled'
- ansible_selinux['config_mode'] != 'disabled'
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: start and add that the osd service(s) to the init sequence (before infernalis)
service:
@ -98,7 +98,7 @@
enabled: yes
when:
- ansible_distribution != "Ubuntu"
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: get osd id (for or after infernalis)
shell: 'ls /var/lib/ceph/osd/ | grep -oP "\d+$"'
@ -107,7 +107,7 @@
register: osd_id
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: enable the osd service (for or after infernalis)
command: systemctl enable ceph-osd@{{ item }}
@ -116,7 +116,7 @@
with_items: "{{ osd_id.stdout_lines }}"
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: start and add that the osd service(s) to the init sequence (for or after infernalis)
service:
@ -127,4 +127,4 @@
changed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer

View File

@ -12,7 +12,7 @@
changed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: enable systemd unit file for the rbd mirror service (systemd after hammer)
command: systemctl enable ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}
@ -20,7 +20,7 @@
failed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: start and add that the rbd mirror service to the init sequence (systemd after hammer)
service:
@ -30,4 +30,4 @@
changed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer

View File

@ -16,7 +16,7 @@
- name: include rgw multisite playbooks
include: multisite/main.yml
when: rgw_zone is defined and rgw_multisite and ( ceph_release_num.{{ ceph_release}} >= ceph_release_num.jewel )
when: rgw_zone is defined and rgw_multisite and ( ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel )
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False

View File

@ -47,7 +47,7 @@
creates: /var/run/systemd/generator.late/ceph-radosgw.service
when:
- ansible_os_family == "RedHat"
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: activate rados gateway with upstart
file:

View File

@ -26,7 +26,7 @@
enabled: yes
when:
- ansible_os_family == 'RedHat'
- ceph_release_num.{{ ceph_release}} < ceph_release_num.infernalis
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
- name: enable systemd unit file for rgw instance (for or after infernalis)
command: systemctl enable ceph-radosgw@rgw.{{ ansible_hostname }}
@ -34,7 +34,7 @@
failed_when: false
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
- name: start rgw with systemd (for or after infernalis)
service:
@ -43,4 +43,4 @@
enabled: yes
when:
- use_systemd
- ceph_release_num.{{ ceph_release}} > ceph_release_num.hammer
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer