rework the various `when' tests to use that array.
ceph_stable_key: https://download.ceph.com/keys/release.asc\r
ceph_stable_release: infernalis # ceph stable release\r
\r
+####################\r
+## Stable Releases #\r
+####################\r
+ceph_stable_releases:\r
+ - dumpling\r
+ - emperor\r
+ - firefly\r
+ - giant\r
+ - hammer\r
+\r
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions\r
# # for a list of available Debian distributions, visit http://ceph.com/debian-{{ ceph_stable_release }}/dists/\r
# for more info read: https://github.com/ceph/ceph-ansible/issues/305\r
owner: ceph
group: ceph
mode: 0755
- when:
- ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer'
+ when: ceph_stable_release not in ceph_stable_releases
- name: create bootstrap-mds directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when:
- cephx 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: cephx and ceph_stable_release in ceph_stable_releases
- name: copy mds bootstrap key (for or after infernalis release)
copy:
group: ceph
mode: 0600
when:
- cephx and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ cephx and ceph_stable_release not in ceph_stable_releases
- name: copy mds bootstrap key (before infernalis release)
copy:
group: root
mode: 0600
when:
- cephx 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')
+ cephx and ceph_stable_release in ceph_stable_releases
- name: create mds directory (for or after infernalis release)
file:
group: ceph
mode: 0755
when:
- cephx and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ cephx and ceph_stable_release not in ceph_stable_releases
- name: create mds directory (before infernalis release)
file:
group: root
mode: 0755
when:
- cephx 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')
+ cephx and ceph_stable_release in ceph_stable_releases
- 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 != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ceph_stable_release not in ceph_stable_releases
- name: set mds key permissions (before infernalis)
file:
owner: root
group: root
when:
- cephx 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')
+ cephx and ceph_stable_release in ceph_stable_releases
- name: activate metadata server with upstart (for or after infernalis release)
file:
changed_when: false
when:
ansible_distribution == "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ceph_stable_release not in ceph_stable_releases
- name: activate metadata server with upstart (before infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" 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')
+ ansible_distribution == "Ubuntu" and ceph_stable_release in ceph_stable_releases
- name: activate metadata server with sysvinit (for or after infernalis release)
file:
changed_when: false
when:
ansible_distribution != "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ceph_stable_release not in ceph_stable_releases
- name: activate metadata server with sysvinit (before infernalis release)
file:
- sysvinit
changed_when: false
when:
- ansible_distribution != "Ubuntu" 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')
+ ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
- 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 == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer')
-
+ when: ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
- 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 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_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
mode: 0600
owner: ceph
group: ceph
- when:
- ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer'
+ when: ceph_stable_release not in ceph_stable_releases
- name: create monitor directory (for or after infernalis release)
file:
owner: ceph
group: ceph
mode: 0755
- when:
- ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer'
+ when: ceph_stable_release not in ceph_stable_releases
- name: set initial monitor key permissions (before infernalis release)
file:
mode: 0600
owner: root
group: root
- when:
- 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: ceph_stable_release in ceph_stable_releases
- name: create monitor directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when:
- 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: ceph_stable_release in ceph_stable_releases
- 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 != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer'
+ when: ceph_stable_release not in ceph_stable_releases
- 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 == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer'
+ when: ceph_stable_release in ceph_stable_releases
with_items:
- done
- upstart
- when:
- ansible_distribution == "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ when:
+ ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
changed_when: false
- upstart
when:
ansible_distribution == "Ubuntu" 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_release in ceph_stable_releases
changed_when: false
- name: start and add that the monitor service to the init sequence (ubuntu)
changed_when: false
when:
ansible_distribution != "Ubuntu" 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_release in ceph_stable_releases
- name: start and add that the monitor service to the init sequence (for or after infernalis)
service:
enabled: yes
changed_when: false
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
+ ceph_stable_release not in ceph_stable_releases
- name: collect admin and bootstrap keys
command: ceph-create-keys --id {{ ansible_hostname }}
owner: ceph
group: ceph
mode: 0755
- when:
- cephx and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ when: cephx and ceph_stable_release not in ceph_stable_releases
- name: create bootstrap-osd directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when:
- cephx 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: cephx and ceph_stable_release in ceph_stable_releases
- name: copy osd bootstrap key (for or after infernalis release)
copy:
owner: ceph
group: ceph
mode: 0600
- when:
- cephx and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ when: cephx and ceph_stable_release not in ceph_stable_releases
- name: copy osd bootstrap key (before infernalis release)
copy:
owner: root
group: root
mode: 600
- when:
- cephx 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: cephx and ceph_stable_release in ceph_stable_releases
owner: ceph
group: ceph
mode: 0755
- when:
- ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer'
+ when: ceph_stable_release not in ceph_stable_releases
- name: create ceph rest api directory (before infernalis release)
file:
owner: root
group: root
mode: 0755
- when:
- 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: ceph_stable_release in ceph_stable_releases
- name: copy ceph rest api keyring (for or after infernalis release)
copy:
group: ceph
mode: 600
when:
- cephx and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ cephx and ceph_stable_release not in ceph_stable_releases
- name: copy ceph rest api keyring (before infernalis release)
copy:
group: root
mode: 600
when:
- cephx 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')
+ cephx and ceph_stable_release in ceph_stable_releases
- name: activate ceph rest api with upstart (for or after infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
- name: activate ceph rest api with upstart (before infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" 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')
+ ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
- name: activate ceph rest api with sysvinit (for or after infernalis release))
file:
- done
- sysvinit
when:
- ansible_distribution != "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
- name: activate ceph rest api with sysvinit (before infernalis release))
file:
- done
- sysvinit
when:
- ansible_distribution != "Ubuntu" 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')
+ ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
# NOTE (leseb): will uncomment this when this https://github.com/ceph/ceph/pull/4144 lands
#- name: start and add that the Ceph REST API service to the init sequence (Ubuntu)
with_items:
- /var/lib/ceph/bootstrap-rgw
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
- when:
- ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer'
+ when: ceph_stable_release not in ceph_stable_releases
- 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 == 'dumpling' or
- ceph_stable_release == 'emperor' or
- ceph_stable_release == 'firefly' or
- ceph_stable_release == 'giant' or
- ceph_stable_release == 'hammer'
+ when: ceph_stable_release in ceph_stable_releases
- name: copy rados gateway bootstrap key (for or after infernalis release)
copy:
owner: ceph
group: ceph
mode: 0600
- when:
- cephx and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ when: cephx and ceph_stable_release not in ceph_stable_releases
- name: copy rados gateway bootstrap key (before infernalis release)
copy:
owner: root
group: root
mode: 0600
- when:
- cephx 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: cephx and ceph_stable_release in ceph_stable_releases
- 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 != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ when: cephx and ceph_stable_release not in ceph_stable_releases
- name: set rados gateway key permissions (before infernalis release)
file:
mode: 0600
owner: root
group: root
- when:
- cephx 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: cephx and ceph_stable_release in ceph_stable_releases
- name: activate rados gateway with upstart (for or after infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ansible_distribution == "Ubuntu" and ceph_stable_release not in ceph_stable_releases
- name: activate rados gateway with upstart (before infernalis release)
file:
- upstart
changed_when: false
when:
- ansible_distribution == "Ubuntu" 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')
+ ansible_distribution == "Ubuntu" and ceph_stable_release in ceph_stable_releases
- name: activate rados gateway with sysvinit (for or after infernalis release)
file:
- sysvinit
changed_when: false
when:
- ansible_distribution != "Ubuntu" and
- (ceph_stable_release != 'dumpling' and
- ceph_stable_release != 'emperor' and
- ceph_stable_release != 'firefly' and
- ceph_stable_release != 'giant' and
- ceph_stable_release != 'hammer')
+ ansible_distribution != "Ubuntu" and ceph_stable_release not in ceph_stable_releases
- name: activate rados gateway with sysvinit (before infernalis release)
file:
- sysvinit
changed_when: false
when:
- ansible_distribution != "Ubuntu" 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')
+ ansible_distribution != "Ubuntu" and ceph_stable_release in ceph_stable_releases
- name: generate rados gateway sudoers file
template: