Merge pull request #749 from SamYaple/unified_when

Unify formatting of when conditional
pull/770/head
Leseb 2016-05-09 18:25:37 +02:00
commit f748f8683c
44 changed files with 475 additions and 511 deletions

View File

@ -3,8 +3,7 @@
command: subscription-manager identity command: subscription-manager identity
register: subscription register: subscription
changed_when: false changed_when: false
when: when: ansible_os_family == 'RedHat'
ansible_os_family == 'RedHat'
- name: install dependencies - name: install dependencies
apt: apt:

View File

@ -6,36 +6,36 @@
- name: restart ceph mons - name: restart ceph mons
command: service ceph restart mon command: service ceph restart mon
when: when:
socket.rc == 0 and - socket.rc == 0
ansible_distribution != 'Ubuntu' and - ansible_distribution != 'Ubuntu'
mon_group_name in group_names and - mon_group_name in group_names
is_before_infernalis - is_before_infernalis
- name: restart ceph mons with systemd - name: restart ceph mons with systemd
service: service:
name: ceph-mon@{{ monitor_name }} name: ceph-mon@{{ monitor_name }}
state: restarted state: restarted
when: when:
socket.rc == 0 and - socket.rc == 0
use_systemd and - use_systemd
mon_group_name in group_names and - mon_group_name in group_names
is_after_hammer - is_after_hammer
- name: restart ceph mons on ubuntu - name: restart ceph mons on ubuntu
command: initctl restart ceph-mon cluster={{ cluster }} id={{ monitor_name }} command: initctl restart ceph-mon cluster={{ cluster }} id={{ monitor_name }}
when: when:
socket.rc == 0 and - socket.rc == 0
ansible_distribution == 'Ubuntu' and - ansible_distribution == 'Ubuntu'
not use_systemd and - not use_systemd
mon_group_name in group_names - mon_group_name in group_names
- name: restart ceph osds - name: restart ceph osds
command: service ceph restart osd command: service ceph restart osd
when: when:
socket.rc == 0 and - socket.rc == 0
ansible_distribution != 'Ubuntu' and - ansible_distribution != 'Ubuntu'
osd_group_name in group_names and - osd_group_name in group_names
is_before_infernalis - is_before_infernalis
# This does not just restart OSDs but everything else too. Unfortunately # 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 # at this time the ansible role does not have an OSD id list to use
@ -45,10 +45,10 @@
name: ceph.target name: ceph.target
state: restarted state: restarted
when: when:
socket.rc == 0 and - socket.rc == 0
use_systemd and - use_systemd
osd_group_name in group_names and - osd_group_name in group_names
is_after_hammer - is_after_hammer
- name: restart ceph osds on ubuntu - name: restart ceph osds on ubuntu
shell: | shell: |
@ -56,71 +56,71 @@
initctl restart ceph-osd cluster={{ cluster }} id=$id initctl restart ceph-osd cluster={{ cluster }} id=$id
done done
when: when:
socket.rc == 0 and - socket.rc == 0
ansible_distribution == 'Ubuntu' and - ansible_distribution == 'Ubuntu'
not use_systemd and - not use_systemd
osd_group_name in group_names - osd_group_name in group_names
- name: restart ceph mdss on ubuntu - name: restart ceph mdss on ubuntu
command: initctl restart ceph-mds cluster={{ cluster }} id={{ ansible_hostname }} command: initctl restart ceph-mds cluster={{ cluster }} id={{ ansible_hostname }}
when: when:
socket.rc == 0 and - socket.rc == 0
ansible_distribution == 'Ubuntu' and - ansible_distribution == 'Ubuntu'
not use_systemd and - not use_systemd
mds_group_name in group_names - mds_group_name in group_names
- name: restart ceph mdss - name: restart ceph mdss
command: service ceph restart mds command: service ceph restart mds
when: when:
socket.rc == 0 and - socket.rc == 0
ansible_distribution != 'Ubuntu' and - ansible_distribution != 'Ubuntu'
use_systemd and - use_systemd
mds_group_name in group_names and - mds_group_name in group_names
is_before_infernalis - is_before_infernalis
- name: restart ceph mdss with systemd - name: restart ceph mdss with systemd
service: service:
name: ceph-mds@{{ mds_name }} name: ceph-mds@{{ mds_name }}
state: restarted state: restarted
when: when:
socket.rc == 0 and - socket.rc == 0
use_systemd and - use_systemd
mds_group_name in group_names and - mds_group_name in group_names
is_after_hammer - is_after_hammer
- name: restart ceph rgws on ubuntu - name: restart ceph rgws on ubuntu
command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }} command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
when: when:
socketrgw.rc == 0 and - socketrgw.rc == 0
ansible_distribution == 'Ubuntu' and - ansible_distribution == 'Ubuntu'
not use_systemd and - not use_systemd
rgw_group_name in group_names - rgw_group_name in group_names
- name: restart ceph rgws - name: restart ceph rgws
command: /etc/init.d/radosgw restart command: /etc/init.d/radosgw restart
when: when:
socketrgw.rc == 0 and - socketrgw.rc == 0
ansible_distribution != 'Ubuntu' and - ansible_distribution != 'Ubuntu'
rgw_group_name in group_names and - rgw_group_name in group_names
is_before_infernalis - is_before_infernalis
- name: restart ceph rgws on red hat - name: restart ceph rgws on red hat
command: /etc/init.d/ceph-radosgw restart command: /etc/init.d/ceph-radosgw restart
when: when:
socketrgw.rc == 0 and - socketrgw.rc == 0
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
rgw_group_name in group_names and - rgw_group_name in group_names
is_before_infernalis - is_before_infernalis
- name: restart ceph rgws with systemd - name: restart ceph rgws with systemd
service: service:
name: ceph-rgw@{{ ansible_hostname }} name: ceph-rgw@{{ ansible_hostname }}
state: restarted state: restarted
when: when:
socketrgw.rc == 0 and - socketrgw.rc == 0
use_systemd and - use_systemd
rgw_group_name in group_names and - rgw_group_name in group_names
is_after_hammer - is_after_hammer
- name: restart apache2 - name: restart apache2
service: service:
@ -128,8 +128,8 @@
state: restarted state: restarted
enabled: yes enabled: yes
when: when:
ansible_os_family == 'Debian' and - ansible_os_family == 'Debian'
rgw_group_name in group_names - rgw_group_name in group_names
- name: restart apache2 - name: restart apache2
service: service:
@ -137,5 +137,5 @@
state: restarted state: restarted
enabled: yes enabled: yes
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
rgw_group_name in group_names - rgw_group_name in group_names

View File

@ -10,8 +10,8 @@
debug: debug:
msg: "nmap is not installed, can not test if ceph ports are allowed :(" msg: "nmap is not installed, can not test if ceph ports are allowed :("
when: when:
check_firewall and - check_firewall
nmapexist.rc != 0 - nmapexist.rc != 0
- name: check if monitor port is not filtered - name: check if monitor port is not filtered
local_action: shell set -o pipefail && nmap -p 6789 {{ item }} {{ hostvars[item]['ansible_' + monitor_interface]['ipv4']['address'] }} | grep -sqo filtered local_action: shell set -o pipefail && nmap -p 6789 {{ item }} {{ hostvars[item]['ansible_' + monitor_interface]['ipv4']['address'] }} | grep -sqo filtered
@ -20,20 +20,20 @@
with_items: groups.{{ mon_group_name }} with_items: groups.{{ mon_group_name }}
register: monportstate register: monportstate
when: when:
check_firewall and - check_firewall
mon_group_name in group_names and - mon_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: fail if monitor port is filtered - name: fail if monitor port is filtered
fail: fail:
msg: "Please allow port 6789 on your firewall" msg: "Please allow port 6789 on your firewall"
with_items: monportstate.results with_items: monportstate.results
when: when:
check_firewall and - check_firewall
item.rc == 0 and - item.has_key('rc') and item.rc == 0
mon_group_name is defined and - mon_group_name is defined
mon_group_name in group_names and - mon_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: check if osd and mds range is not filtered - name: check if osd and mds range is not filtered
local_action: shell set -o pipefail && nmap -p 6800-7300 {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered local_action: shell set -o pipefail && nmap -p 6800-7300 {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered
@ -42,20 +42,20 @@
with_items: groups.{{ osd_group_name }} with_items: groups.{{ osd_group_name }}
register: osdrangestate register: osdrangestate
when: when:
check_firewall and - check_firewall
osd_group_name in group_names and - osd_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: fail if osd and mds range is filtered (osd hosts) - name: fail if osd and mds range is filtered (osd hosts)
fail: fail:
msg: "Please allow range from 6800 to 7300 on your firewall" msg: "Please allow range from 6800 to 7300 on your firewall"
with_items: osdrangestate.results with_items: osdrangestate.results
when: when:
check_firewall and - check_firewall
item.rc == 0 and - item.has_key('rc') and item.rc == 0
osd_group_name is defined and - osd_group_name is defined
osd_group_name in group_names and - osd_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: check if osd and mds range is not filtered - name: check if osd and mds range is not filtered
local_action: shell set -o pipefail && nmap -p 6800-7300 {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered local_action: shell set -o pipefail && nmap -p 6800-7300 {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered
@ -64,20 +64,20 @@
with_items: groups.{{ mds_group_name }} with_items: groups.{{ mds_group_name }}
register: mdsrangestate register: mdsrangestate
when: when:
check_firewall and - check_firewall
mds_group_name in group_names and - mds_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: fail if osd and mds range is filtered (mds hosts) - name: fail if osd and mds range is filtered (mds hosts)
fail: fail:
msg: "Please allow range from 6800 to 7300 on your firewall" msg: "Please allow range from 6800 to 7300 on your firewall"
with_items: mdsrangestate.results with_items: mdsrangestate.results
when: when:
check_firewall and - check_firewall
item.rc == 0 and - item.has_key('rc') and item.rc == 0
mds_group_name is defined and - mds_group_name is defined
mds_group_name in group_names and - mds_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: check if rados gateway port is not filtered - name: check if rados gateway port is not filtered
local_action: shell set -o pipefail && nmap -p {{ radosgw_civetweb_port }} {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered local_action: shell set -o pipefail && nmap -p {{ radosgw_civetweb_port }} {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered
@ -86,17 +86,17 @@
with_items: groups.{{ rgw_group_name }} with_items: groups.{{ rgw_group_name }}
register: rgwportstate register: rgwportstate
when: when:
check_firewall and - check_firewall
rgw_group_name in group_names and - rgw_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0
- name: fail if rados gateway port is filtered - name: fail if rados gateway port is filtered
fail: fail:
msg: "Please allow port {{ radosgw_civetweb_port }} on your firewall" msg: "Please allow port {{ radosgw_civetweb_port }} on your firewall"
with_items: rgwportstate.results with_items: rgwportstate.results
when: when:
check_firewall and - check_firewall
item.rc == 0 and - item.has_key('rc') and item.rc == 0
rgw_group_name is defined and - rgw_group_name is defined
rgw_group_name in group_names and - rgw_group_name in group_names
nmapexist.rc == 0 - nmapexist.rc == 0

View File

@ -3,8 +3,8 @@
fail: fail:
msg: "choose an installation origin" msg: "choose an installation origin"
when: when:
ceph_origin != 'upstream' and - ceph_origin != 'upstream'
ceph_origin != 'distro' - ceph_origin != 'distro'
tags: tags:
- package-install - package-install
@ -12,12 +12,12 @@
fail: fail:
msg: "choose an upstream installation source or read https://github.com/ceph/ceph-ansible/wiki" msg: "choose an upstream installation source or read https://github.com/ceph/ceph-ansible/wiki"
when: when:
ceph_origin == 'upstream' and - ceph_origin == 'upstream'
not ceph_stable and - not ceph_stable
not ceph_dev and - not ceph_dev
not ceph_stable_ice and - not ceph_stable_ice
not ceph_stable_rh_storage and - not ceph_stable_rh_storage
not ceph_stable_uca - not ceph_stable_uca
tags: tags:
- package-install - package-install
@ -25,10 +25,10 @@
fail: fail:
msg: "choose between ceph_stable_rh_storage_cdn_install and ceph_stable_rh_storage_iso_install" msg: "choose between ceph_stable_rh_storage_cdn_install and ceph_stable_rh_storage_iso_install"
when: when:
ceph_stable_rh_storage and - ceph_stable_rh_storage
not ceph_stable_rh_storage_cdn_install and - not ceph_stable_rh_storage_cdn_install
not ceph_stable_rh_storage_iso_install and - not ceph_stable_rh_storage_iso_install
ceph_origin == "upstream" - ceph_origin == "upstream"
tags: tags:
- package-install - package-install
@ -36,81 +36,81 @@
fail: fail:
msg: "journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/" msg: "journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/"
when: when:
journal_size|int == 0 and - journal_size|int == 0
osd_objectstore != 'bluestore' and - osd_objectstore != 'bluestore'
osd_group_name in group_names - osd_group_name in group_names
- name: make sure monitor_interface or monitor_address is configured - name: make sure monitor_interface or monitor_address is configured
fail: fail:
msg: "monitor_interface or monitor_address must be configured. Interface for the monitor to listen on or IP address of that interface" msg: "monitor_interface or monitor_address must be configured. Interface for the monitor to listen on or IP address of that interface"
when: when:
monitor_interface == 'interface' and - monitor_interface == 'interface'
monitor_address == '0.0.0.0' and - monitor_address == '0.0.0.0'
mon_group_name in group_names - mon_group_name in group_names
- name: make sure cluster_network configured - name: make sure cluster_network configured
fail: fail:
msg: "cluster_network must be configured. Ceph replication network" msg: "cluster_network must be configured. Ceph replication network"
when: when:
cluster_network == '0.0.0.0/0' and - cluster_network == '0.0.0.0/0'
osd_group_name in group_names - osd_group_name in group_names
- name: make sure public_network configured - name: make sure public_network configured
fail: fail:
msg: "public_network must be configured. Ceph public network" msg: "public_network must be configured. Ceph public network"
when: when:
public_network == '0.0.0.0/0' and - public_network == '0.0.0.0/0'
osd_group_name in group_names - osd_group_name in group_names
- name: make sure an osd scenario was chosen - name: make sure an osd scenario was chosen
fail: fail:
msg: "please choose an osd scenario" msg: "please choose an osd scenario"
when: when:
osd_group_name is defined and - osd_group_name is defined
osd_group_name in group_names and - osd_group_name in group_names
not journal_collocation and - not journal_collocation
not raw_multi_journal and - not raw_multi_journal
not osd_directory and - not osd_directory
not bluestore - not bluestore
- name: verify only one osd scenario was chosen - name: verify only one osd scenario was chosen
fail: fail:
msg: "please select only one osd scenario" msg: "please select only one osd scenario"
when: when:
osd_group_name is defined and - osd_group_name is defined
osd_group_name in group_names and - osd_group_name in group_names
((journal_collocation and raw_multi_journal) or - (journal_collocation and raw_multi_journal)
(journal_collocation and osd_directory) or or (journal_collocation and osd_directory)
(raw_multi_journal and osd_directory) or or (raw_multi_journal and osd_directory)
(bluestore and journal_collocation) or or (bluestore and journal_collocation)
(bluestore and raw_multi_journal) or or (bluestore and raw_multi_journal)
(bluestore and osd_directory)) or (bluestore and osd_directory)
- name: verify devices have been provided - name: verify devices have been provided
fail: fail:
msg: "please provide devices to your osd scenario" msg: "please provide devices to your osd scenario"
when: when:
osd_group_name is defined and - osd_group_name is defined
osd_group_name in group_names and - osd_group_name in group_names
journal_collocation and - journal_collocation
not osd_auto_discovery and - not osd_auto_discovery
devices is not defined - devices is not defined
- name: verify journal devices have been provided - name: verify journal devices have been provided
fail: fail:
msg: "please provide devices to your osd scenario" msg: "please provide devices to your osd scenario"
when: when:
osd_group_name is defined and - osd_group_name is defined
osd_group_name in group_names and - osd_group_name in group_names
raw_multi_journal and - raw_multi_journal
(raw_journal_devices is not defined or - raw_journal_devices is not defined
devices is not defined) or devices is not defined
- name: verify directories have been provided - name: verify directories have been provided
fail: fail:
msg: "please provide directories to your osd scenario" msg: "please provide directories to your osd scenario"
when: when:
osd_group_name is defined and - osd_group_name is defined
osd_group_name in group_names and - osd_group_name in group_names
osd_directory and - osd_directory
osd_directories is not defined - osd_directories is not defined

View File

@ -18,8 +18,8 @@
fail: fail:
msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Storage, only RHEL 7.1" msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Storage, only RHEL 7.1"
when: when:
ceph_stable_rh_storage and - ceph_stable_rh_storage
{{ ansible_distribution_version | version_compare('7.1', '<') }} - ansible_distribution_version | version_compare('7.1', '<')
- name: fail on unsupported distribution for ubuntu cloud archive - name: fail on unsupported distribution for ubuntu cloud archive
fail: fail:
@ -32,5 +32,5 @@
fail: fail:
msg: "Ansible version must be >= 1.9, please update!" msg: "Ansible version must be >= 1.9, please update!"
when: when:
ansible_version.major|int == 1 and - ansible_version.major|int == 1
ansible_version.minor|int < 9 - ansible_version.minor|int < 9

View File

@ -1,5 +1,4 @@
--- ---
- name: get ceph version - name: get ceph version
command: ceph --version command: ceph --version
changed_when: false changed_when: false

View File

@ -1,5 +1,4 @@
--- ---
- name: install the ceph repository stable key - name: install the ceph repository stable key
apt_key: apt_key:
data: "{{ lookup('file', role_path+'/files/cephstable.asc') }}" data: "{{ lookup('file', role_path+'/files/cephstable.asc') }}"

View File

@ -35,13 +35,11 @@
pkg: radosgw pkg: radosgw
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
update_cache: yes update_cache: yes
when: when: rgw_group_name in group_names
rgw_group_name in group_names
- name: install ceph mds - name: install ceph mds
apt: apt:
pkg: ceph-mds pkg: ceph-mds
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
default_release: "{{ ceph_stable_release_uca | default(ansible_distribution_release) }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}" default_release: "{{ ceph_stable_release_uca | default(ansible_distribution_release) }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}"
when: when: mds_group_name in group_names
mds_group_name in group_names

View File

@ -5,8 +5,8 @@
state: present state: present
with_items: redhat_package_dependencies with_items: redhat_package_dependencies
when: when:
ansible_distribution == "RedHat" and - ansible_distribution == "RedHat"
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: install dependencies - name: install dependencies
yum: yum:
@ -14,8 +14,8 @@
state: present state: present
with_items: centos_package_dependencies with_items: centos_package_dependencies
when: when:
ansible_distribution == "CentOS" and - ansible_distribution == "CentOS"
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: install dependencies - name: install dependencies
dnf: dnf:
@ -23,8 +23,8 @@
state: present state: present
with_items: centos_package_dependencies with_items: centos_package_dependencies
when: when:
ansible_distribution == "CentOS" and - ansible_distribution == "CentOS"
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
- name: configure ceph yum repository - name: configure ceph yum repository
include: redhat_ceph_repository.yml include: redhat_ceph_repository.yml
@ -41,40 +41,48 @@
name: "ceph-mon" name: "ceph-mon"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
(ceph_origin == "distro" or ceph_stable_rh_storage or ceph_dev or - mon_group_name in group_names
(ceph_stable and ceph_stable_release not in ceph_stable_releases)) and - ansible_pkg_mgr == "yum"
mon_group_name in group_names and - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
ansible_pkg_mgr == "yum" or ceph_stable_rh_storage
or ceph_dev
or ceph_origin == "distro"
- name: install distro or red hat storage ceph mon - name: install distro or red hat storage ceph mon
dnf: dnf:
name: "ceph-mon" name: "ceph-mon"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
(ceph_origin == "distro" or ceph_stable_rh_storage or ceph_dev or - mon_group_name in group_names
(ceph_stable and ceph_stable_release not in ceph_stable_releases)) and - ansible_pkg_mgr == "dnf"
mon_group_name in group_names and - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
ansible_pkg_mgr == "dnf" or ceph_origin == "distro"
or ceph_stable_rh_storage
or ceph_dev
- name: install distro or red hat storage ceph osd - name: install distro or red hat storage ceph osd
yum: yum:
name: "ceph-osd" name: "ceph-osd"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
(ceph_origin == "distro" or ceph_stable_rh_storage or ceph_dev or - osd_group_name in group_names
(ceph_stable and ceph_stable_release not in ceph_stable_releases)) and - ansible_pkg_mgr == "yum"
osd_group_name in group_names and - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
ansible_pkg_mgr == "yum" or ceph_origin == "distro"
or ceph_stable_rh_storage
or ceph_dev
- name: install distro or red hat storage ceph osd - name: install distro or red hat storage ceph osd
dnf: dnf:
name: "ceph-osd" name: "ceph-osd"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
(ceph_origin == "distro" or ceph_stable_rh_storage or ceph_dev or - osd_group_name in group_names
(ceph_stable and ceph_stable_release not in ceph_stable_releases)) and - ansible_pkg_mgr == "dnf"
osd_group_name in group_names and - (ceph_stable and ceph_stable_release not in ceph_stable_releases)
ansible_pkg_mgr == "dnf" or ceph_origin == "distro"
or ceph_stable_rh_storage
or ceph_dev
- name: install distro or red hat storage ceph mds - name: install distro or red hat storage ceph mds
yum: yum:
@ -101,16 +109,16 @@
name: ceph-test name: ceph-test
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
ceph_test and - ceph_test
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: install ceph-test - name: install ceph-test
dnf: dnf:
name: ceph-test name: ceph-test
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
ceph_test and - ceph_test
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
- name: install Inktank Ceph Enterprise RBD Kernel modules - name: install Inktank Ceph Enterprise RBD Kernel modules
yum: yum:
@ -119,8 +127,8 @@
- "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm" - "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm"
- "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm" - "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm"
when: when:
ceph_stable_ice and - ceph_stable_ice
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: install Inktank Ceph Enterprise RBD Kernel modules - name: install Inktank Ceph Enterprise RBD Kernel modules
dnf: dnf:
@ -129,21 +137,21 @@
- "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm" - "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm"
- "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm" - "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm"
when: when:
ceph_stable_ice and - ceph_stable_ice
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
- name: install rados gateway - name: install rados gateway
yum: yum:
name: ceph-radosgw name: ceph-radosgw
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
rgw_group_name in group_names and - rgw_group_name in group_names
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: install rados gateway - name: install rados gateway
dnf: dnf:
name: ceph-radosgw name: ceph-radosgw
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
rgw_group_name in group_names and - rgw_group_name in group_names
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"

View File

@ -15,8 +15,8 @@
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
- deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse - deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse
when: when:
ansible_lsb.codename in ['precise'] and not - ansible_lsb.codename in ['precise']
http_100_continue - not http_100_continue
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages # NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
- name: disable multiverse repo for precise - name: disable multiverse repo for precise
@ -28,24 +28,24 @@
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
- deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse - deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse
when: when:
ansible_lsb.codename in ['precise'] and - ansible_lsb.codename in ['precise']
http_100_continue - http_100_continue
# NOTE (leseb): needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used # NOTE (leseb): needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
- name: enable multiverse repo for trusty - name: enable multiverse repo for trusty
command: "apt-add-repository multiverse" command: "apt-add-repository multiverse"
changed_when: false changed_when: false
when: when:
ansible_lsb.codename in ['trusty'] and not - ansible_lsb.codename in ['trusty']
http_100_continue - not http_100_continue
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages # NOTE (leseb): 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"
changed_when: false changed_when: false
when: when:
ansible_lsb.codename in ['trusty'] and - ansible_lsb.codename in ['trusty']
http_100_continue - http_100_continue
# NOTE (leseb): if using 100-continue, add Ceph dev key # NOTE (leseb): if using 100-continue, add Ceph dev key
- name: install the ceph development repository key - name: install the ceph development repository key
@ -91,9 +91,7 @@
- apache2.2-bin - apache2.2-bin
- apache2.2-common - apache2.2-common
- libapache2-mod-fastcgi - libapache2-mod-fastcgi
when: when: purge_default_apache.changed or purge_ceph_apache.changed
purge_default_apache.changed or
purge_ceph_apache.changed
- name: install apache and fastcgi - name: install apache and fastcgi
apt: apt:

View File

@ -16,19 +16,16 @@
apt: apt:
name: ceph-mon name: ceph-mon
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when: mon_group_name in group_names
mon_group_name in group_names
- name: install red hat storage ceph osd - name: install red hat storage ceph osd
apt: apt:
name: ceph-osd name: ceph-osd
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when: osd_group_name in group_names
osd_group_name in group_names
- name: install ceph-test - name: install ceph-test
apt: apt:
name: ceph-test name: ceph-test
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when: ceph_test
ceph_test

View File

@ -22,40 +22,40 @@
key: "{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release" key: "{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release"
state: present state: present
when: when:
ceph_stable_rh_storage and - ceph_stable_rh_storage
ceph_stable_rh_storage_iso_install - ceph_stable_rh_storage_iso_install
- name: add ceph stable repository - name: add ceph stable repository
yum: yum:
name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
changed_when: false changed_when: false
when: when:
ceph_stable and - ceph_stable
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: add ceph stable repository - name: add ceph stable repository
dnf: dnf:
name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
changed_when: false changed_when: false
when: when:
ceph_stable and - ceph_stable
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
- name: add ceph development repository - name: add ceph development repository
yum: yum:
name: 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 name: 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
changed_when: false changed_when: false
when: when:
ceph_dev and - ceph_dev
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
- name: add ceph development repository - name: add ceph development repository
dnf: dnf:
name: 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 name: 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
changed_when: false changed_when: false
when: when:
ceph_dev and - ceph_dev
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
- name: add inktank ceph enterprise repository - name: add inktank ceph enterprise repository
template: template:
@ -74,5 +74,5 @@
group: root group: root
mode: 0644 mode: 0644
when: when:
ceph_stable_rh_storage and - ceph_stable_rh_storage
ceph_stable_rh_storage_iso_install - ceph_stable_rh_storage_iso_install

View File

@ -15,17 +15,17 @@
- include: ./pre_requisites/prerequisite_rh_storage_iso_install.yml - include: ./pre_requisites/prerequisite_rh_storage_iso_install.yml
when: when:
ceph_stable_rh_storage and - ceph_stable_rh_storage
ceph_stable_rh_storage_iso_install and - ceph_stable_rh_storage_iso_install
ansible_os_family == "RedHat" - ansible_os_family == "RedHat"
tags: tags:
- package-install - package-install
- include: ./pre_requisites/prerequisite_rh_storage_cdn_install.yml - include: ./pre_requisites/prerequisite_rh_storage_cdn_install.yml
when: when:
ceph_stable_rh_storage and - ceph_stable_rh_storage
ceph_stable_rh_storage_cdn_install and - ceph_stable_rh_storage_cdn_install
ansible_os_family == "RedHat" - ansible_os_family == "RedHat"
tags: tags:
- package-install - package-install
@ -36,31 +36,31 @@
- include: ./installs/install_on_debian.yml - include: ./installs/install_on_debian.yml
when: when:
ansible_os_family == 'Debian' and - ansible_os_family == 'Debian'
not ceph_stable_rh_storage - not ceph_stable_rh_storage
tags: tags:
- package-install - package-install
- include: ./installs/install_rh_storage_on_debian.yml - include: ./installs/install_rh_storage_on_debian.yml
when: when:
ansible_os_family == 'Debian' and - ansible_os_family == 'Debian'
ceph_stable_rh_storage - ceph_stable_rh_storage
tags: tags:
- package-install - package-install
- include: ./installs/install_rgw_on_redhat.yml - include: ./installs/install_rgw_on_redhat.yml
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
radosgw_frontend == 'apache' and - radosgw_frontend == 'apache'
rgw_group_name in group_names - rgw_group_name in group_names
tags: tags:
- package-install - package-install
- include: ./installs/install_rgw_on_debian.yml - include: ./installs/install_rgw_on_debian.yml
when: when:
ansible_os_family == 'Debian' and - ansible_os_family == 'Debian'
radosgw_frontend == 'apache' and - radosgw_frontend == 'apache'
rgw_group_name in group_names - rgw_group_name in group_names
tags: tags:
- package-install - package-install
@ -105,44 +105,44 @@
- set_fact: - set_fact:
rbd_client_directory_owner: root rbd_client_directory_owner: root
when: when:
is_before_infernalis and - is_before_infernalis
(rbd_client_directory_owner is not defined or - rbd_client_directory_owner is not defined
not rbd_client_directory_owner) or not rbd_client_directory_owner
- set_fact: - set_fact:
rbd_client_directory_owner: ceph rbd_client_directory_owner: ceph
when: when:
is_after_hammer and - is_after_hammer
(rbd_client_directory_owner is not defined or - rbd_client_directory_owner is not defined
not rbd_client_directory_owner) or not rbd_client_directory_owner
- set_fact: - set_fact:
rbd_client_directory_group: root rbd_client_directory_group: root
when: when:
is_before_infernalis and - is_before_infernalis
(rbd_client_directory_group is not defined or - rbd_client_directory_group is not defined
not rbd_client_directory_group) or not rbd_client_directory_group
- set_fact: - set_fact:
rbd_client_directory_group: ceph rbd_client_directory_group: ceph
when: when:
is_after_hammer and - is_after_hammer
(rbd_client_directory_group is not defined or - rbd_client_directory_group is not defined
not rbd_client_directory_group) or not rbd_client_directory_group
- set_fact: - set_fact:
rbd_client_directory_mode: "1777" rbd_client_directory_mode: "1777"
when: when:
is_before_infernalis and - is_before_infernalis
(rbd_client_directory_mode is not defined or - rbd_client_directory_mode is not defined
not rbd_client_directory_mode) or not rbd_client_directory_mode
- set_fact: - set_fact:
rbd_client_directory_mode: "0770" rbd_client_directory_mode: "0770"
when: when:
is_after_hammer and - is_after_hammer
(rbd_client_directory_mode is not defined or - rbd_client_directory_mode is not defined
not rbd_client_directory_mode) or not rbd_client_directory_mode
- name: check for a ceph socket - name: check for a ceph socket
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1" shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
@ -161,9 +161,7 @@
changed_when: false changed_when: false
become: false become: false
run_once: true run_once: true
when: when: cephx or generate_fsid
cephx or
generate_fsid
- name: generate cluster uuid - name: generate cluster uuid
local_action: shell python -c 'import uuid; print str(uuid.uuid4())' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf local_action: shell python -c 'import uuid; print str(uuid.uuid4())' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
@ -231,8 +229,7 @@
insertafter: EOF insertafter: EOF
create: yes create: yes
line: "CLUSTER={{ cluster }}" line: "CLUSTER={{ cluster }}"
when: when: ansible_os_family == "RedHat"
ansible_os_family == "RedHat"
- name: configure cluster name - name: configure cluster name
lineinfile: lineinfile:
@ -240,5 +237,4 @@
insertafter: EOF insertafter: EOF
create: yes create: yes
line: "CLUSTER={{ cluster }}" line: "CLUSTER={{ cluster }}"
when: when: ansible_os_family == "Debian"
ansible_os_family == "Debian"

View File

@ -26,8 +26,8 @@
- kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm - kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm
- kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm - kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm
when: when:
ceph_stable_ice and - ceph_stable_ice
ansible_os_family == 'RedHat' - ansible_os_family == 'RedHat'
- name: stat extracted ice repo files - name: stat extracted ice repo files
stat: stat:
@ -41,12 +41,12 @@
chdir: "{{ ceph_stable_ice_temp_path }}" chdir: "{{ ceph_stable_ice_temp_path }}"
changed_when: false changed_when: false
when: when:
ceph_stable_ice and - ceph_stable_ice
repo_exist.stat.exists == False - repo_exist.stat.exists == 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 }}"
changed_when: false changed_when: false
when: when:
ceph_stable_ice and - ceph_stable_ice
repo_exist.stat.exists == False - repo_exist.stat.exists == False

View File

@ -26,8 +26,8 @@
command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-mon-rpms command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-mon-rpms
changed_when: false changed_when: false
when: when:
mon_group_name in group_names and - mon_group_name in group_names
rh_storage_mon_repo.rc != 0 - rh_storage_mon_repo.rc != 0
- name: check if the red hat storage osd repo is already present - name: check if the red hat storage osd repo is already present
shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-osd-rpms shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-osd-rpms
@ -40,8 +40,8 @@
command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-osd-rpms command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-osd-rpms
changed_when: false changed_when: false
when: when:
osd_group_name in group_names and - osd_group_name in group_names
rh_storage_osd_repo.rc != 0 - rh_storage_osd_repo.rc != 0
- name: check if the red hat storage rados gateway repo is already present - name: check if the red hat storage rados gateway repo is already present
shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-tools-rpms shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-tools-rpms
@ -54,5 +54,5 @@
command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-tools-rpms command: subscription-manager repos --enable rhel-7-server-rhceph-1.3-tools-rpms
changed_when: false changed_when: false
when: when:
rgw_group_name in group_names and - rgw_group_name in group_names
rh_storage_rgw_repo.rc != 0 - rh_storage_rgw_repo.rc != 0

View File

@ -15,8 +15,7 @@
- set_fact: - set_fact:
after_hammer=True after_hammer=True
when: when: ceph_version.stdout not in ['firefly','giant', 'hammer']
ceph_version.stdout not in ['firefly','giant', 'hammer']
- name: create bootstrap directories (for or before hammer) - name: create bootstrap directories (for or before hammer)
file: file:

View File

@ -32,8 +32,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
tags: tags:
with_pkg with_pkg
@ -45,8 +45,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
tags: tags:
with_pkg with_pkg

View File

@ -18,8 +18,8 @@
- { name: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true } - { name: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true }
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
when: when:
cephx and - cephx
item.copy_key|bool - item.copy_key|bool
- name: create mds directory - name: create mds directory
file: file:
@ -78,8 +78,8 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: start and add that the metadata service to the init sequence (upstart) - name: start and add that the metadata service to the init sequence (upstart)
command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }} command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }}
@ -95,8 +95,8 @@
args: mds.{{ mds_name }} args: mds.{{ mds_name }}
changed_when: false changed_when: false
when: when:
not use_systemd and - not use_systemd
is_before_infernalis - is_before_infernalis
- name: start and add that the metadata service to the init sequence (systemd after hammer) - name: start and add that the metadata service to the init sequence (systemd after hammer)
service: service:
@ -105,5 +105,5 @@
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer

View File

@ -12,8 +12,8 @@
creates: /etc/ceph/{{ cluster }}.client.restapi.keyring creates: /etc/ceph/{{ cluster }}.client.restapi.keyring
changed_when: false changed_when: false
when: when:
cephx and - cephx
groups[restapi_group_name] is defined - groups[restapi_group_name] is defined
- include: openstack_config.yml - include: openstack_config.yml
when: openstack_config when: openstack_config

View File

@ -49,29 +49,29 @@
args: args:
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
when: when:
cephx and - cephx
is_after_hammer - is_after_hammer
- name: ceph monitor mkfs without keyring (for or after infernalis release) - name: ceph monitor mkfs without keyring (for or after infernalis release)
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }} command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
args: args:
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
when: when:
not cephx and - not cephx
is_after_hammer - is_after_hammer
- name: ceph monitor mkfs with keyring (before infernalis release) - 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 }} command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
args: args:
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
when: when:
cephx and - cephx
is_before_infernalis - is_before_infernalis
- name: ceph monitor mkfs without keyring (before infernalis release) - name: ceph monitor mkfs without keyring (before infernalis release)
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }} command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
args: args:
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
when: when:
not cephx and - not cephx
is_before_infernalis - is_before_infernalis

View File

@ -15,8 +15,8 @@
- include: checks.yml - include: checks.yml
when: when:
ceph_health.rc != 0 and - ceph_health.rc != 0
not mon_containerized_deployment_with_kv - not mon_containerized_deployment_with_kv
- include: pre_requisite.yml - include: pre_requisite.yml
@ -25,8 +25,8 @@
# let the first mon create configs and keyrings # let the first mon create configs and keyrings
- include: create_configs.yml - include: create_configs.yml
when: when:
inventory_hostname == groups.mons[0] and - inventory_hostname == groups.mons[0]
not mon_containerized_default_ceph_conf_with_kv - not mon_containerized_default_ceph_conf_with_kv
- include: fetch_configs.yml - include: fetch_configs.yml
when: not mon_containerized_deployment_with_kv when: not mon_containerized_deployment_with_kv
@ -45,8 +45,8 @@
creates: /etc/ceph/ceph.client.restapi.keyring creates: /etc/ceph/ceph.client.restapi.keyring
changed_when: false changed_when: false
when: when:
cephx and - cephx
mon_containerized_deployment and - mon_containerized_deployment
groups[restapi_group_name] is defined and - groups[restapi_group_name] is defined
inventory_hostname == groups.mons|last and - inventory_hostname == groups.mons|last
not mon_containerized_deployment_with_kv - not mon_containerized_deployment_with_kv

View File

@ -32,8 +32,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
tags: tags:
with_pkg with_pkg
@ -45,8 +45,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
tags: tags:
with_pkg with_pkg

View File

@ -11,9 +11,9 @@
KV_PORT: "{{kv_port}}" KV_PORT: "{{kv_port}}"
run_once: true run_once: true
when: when:
inventory_hostname == groups.mons[0] and - inventory_hostname == groups.mons[0]
mon_containerized_deployment_with_kv and - mon_containerized_deployment_with_kv
mon_containerized_default_ceph_conf_with_kv - mon_containerized_default_ceph_conf_with_kv
- name: populate kv_store with custom ceph.conf - name: populate kv_store with custom ceph.conf
docker: docker:
@ -29,9 +29,9 @@
- /etc/ceph/ceph.conf:/etc/ceph/ceph.defaults - /etc/ceph/ceph.conf:/etc/ceph/ceph.defaults
run_once: true run_once: true
when: when:
inventory_hostname == groups.mons[0] and - inventory_hostname == groups.mons[0]
mon_containerized_deployment_with_kv and - mon_containerized_deployment_with_kv
not mon_containerized_default_ceph_conf_with_kv - not mon_containerized_default_ceph_conf_with_kv
- name: delete populate-kv-store docker - name: delete populate-kv-store docker
docker: docker:
@ -49,34 +49,26 @@
owner: "root" owner: "root"
group: "root" group: "root"
mode: "0644" mode: "0644"
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: link systemd unit file for mon instance - name: link systemd unit file for mon instance
file: file:
src: /var/lib/ceph/ceph-mon@.service src: /var/lib/ceph/ceph-mon@.service
dest: /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service dest: /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service
state: link state: link
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: enable systemd unit file for mon instance - name: enable systemd unit file for mon instance
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service
failed_when: false failed_when: false
changed_when: false changed_when: false
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: reload systemd unit files - name: reload systemd unit files
shell: systemctl daemon-reload shell: systemctl daemon-reload
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: systemd start mon container - name: systemd start mon container
service: service:
@ -84,9 +76,7 @@
state: started state: started
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: wait for ceph.conf exists - name: wait for ceph.conf exists
wait_for: wait_for:
@ -103,9 +93,9 @@
env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}" env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph" volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
when: when:
not is_atomic and - not is_atomic
ansible_os_family != 'CoreOS' and - ansible_os_family != 'CoreOS'
not mon_containerized_deployment_with_kv - not mon_containerized_deployment_with_kv
- name: run the ceph monitor docker image with kv - name: run the ceph monitor docker image with kv
docker: docker:
@ -116,6 +106,6 @@
privileged: "{{ mon_docker_privileged }}" privileged: "{{ mon_docker_privileged }}"
env: "KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}" env: "KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
when: when:
not is_atomic and - not is_atomic
ansible_os_family != 'CoreOS' and - ansible_os_family != 'CoreOS'
mon_containerized_deployment_with_kv - mon_containerized_deployment_with_kv

View File

@ -10,13 +10,13 @@
- include: create_mds_filesystems.yml - include: create_mds_filesystems.yml
when: when:
not mon_containerized_deployment and - not mon_containerized_deployment
groups[mds_group_name] is defined - groups[mds_group_name] is defined
- include: secure_cluster.yml - include: secure_cluster.yml
when: when:
secure_cluster and - secure_cluster
not mon_containerized_deployment - not mon_containerized_deployment
- include: ./docker/main.yml - include: ./docker/main.yml
when: mon_containerized_deployment when: mon_containerized_deployment

View File

@ -24,16 +24,16 @@
command: service ceph start mon command: service ceph start mon
changed_when: false changed_when: false
when: when:
ansible_distribution != "Ubuntu" and - ansible_distribution != "Ubuntu"
is_before_infernalis - is_before_infernalis
- name: start and add that the monitor service to the init sequence (for or after infernalis) - name: start and add that the monitor service to the init sequence (for or after infernalis)
command: systemctl enable ceph-mon@{{ monitor_name }} command: systemctl enable ceph-mon@{{ monitor_name }}
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: start the monitor service (for or after infernalis) - name: start the monitor service (for or after infernalis)
service: service:
@ -42,8 +42,8 @@
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: collect admin and bootstrap keys - name: collect admin and bootstrap keys
command: ceph-create-keys --cluster {{ cluster }} --id {{ monitor_name }} command: ceph-create-keys --cluster {{ cluster }} --id {{ monitor_name }}

View File

@ -7,11 +7,11 @@
ignore_errors: true ignore_errors: true
with_dict: ansible_devices with_dict: ansible_devices
when: when:
ansible_devices is defined and - ansible_devices is defined
item.value.removable == "0" and - item.value.removable == "0"
item.value.partitions|count == 0 and - item.value.partitions|count == 0
journal_collocation and - journal_collocation
osd_auto_discovery - osd_auto_discovery
- name: activate osd(s) when device is a disk - name: activate osd(s) when device is a disk
command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
@ -22,9 +22,9 @@
failed_when: false failed_when: false
register: activate_osd_disk register: activate_osd_disk
when: when:
not item.0.get("skipped") and - not item.0.get("skipped")
item.0.get("rc", 0) != 0 and - item.0.get("rc", 0) != 0
not osd_auto_discovery - not osd_auto_discovery
- name: fail if ceph-disk cannot create an OSD - name: fail if ceph-disk cannot create an OSD
fail: fail:
@ -42,9 +42,9 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
not item.0.get("skipped") and - not item.0.get("skipped")
item.0.get("rc", 0) == 0 and - item.0.get("rc", 0) == 0
not osd_auto_discovery - not osd_auto_discovery
- include: osd_fragment.yml - include: osd_fragment.yml
when: crush_location when: crush_location
@ -54,10 +54,10 @@
policy: targeted policy: targeted
state: permissive state: permissive
when: when:
ansible_selinux != false and - ansible_selinux != false
ansible_selinux['status'] == 'enabled' and - ansible_selinux['status'] == 'enabled'
ansible_selinux['config_mode'] != 'disabled' and - ansible_selinux['config_mode'] != 'disabled'
is_before_infernalis - is_before_infernalis
- name: start and add that the osd service(s) to the init sequence (before infernalis) - name: start and add that the osd service(s) to the init sequence (before infernalis)
service: service:
@ -65,8 +65,8 @@
state: started state: started
enabled: yes enabled: yes
when: when:
ansible_distribution != "Ubuntu" and - ansible_distribution != "Ubuntu"
is_before_infernalis - is_before_infernalis
- name: get osd id (for or after infernalis) - name: get osd id (for or after infernalis)
shell: "ls /var/lib/ceph/osd/ | grep '-' | cut -d '-' -f 2" shell: "ls /var/lib/ceph/osd/ | grep '-' | cut -d '-' -f 2"
@ -74,8 +74,8 @@
failed_when: false failed_when: false
register: osd_id register: osd_id
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: enable osd service instance(s) (for or after infernalis) - name: enable osd service instance(s) (for or after infernalis)
file: file:
@ -85,8 +85,8 @@
with_items: osd_id.stdout_lines with_items: osd_id.stdout_lines
failed_when: false failed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: start and add that the osd service(s) to the init sequence (for or after infernalis) - name: start and add that the osd service(s) to the init sequence (for or after infernalis)
service: service:
@ -96,5 +96,5 @@
with_items: osd_id.stdout_lines with_items: osd_id.stdout_lines
changed_when: false changed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer

View File

@ -25,9 +25,9 @@
failed_when: false failed_when: false
register: ispartition_autodiscover register: ispartition_autodiscover
when: when:
ansible_devices is defined and - ansible_devices is defined
item.value.removable == "0" and - item.value.removable == "0"
osd_auto_discovery - osd_auto_discovery
# NOTE (leseb): we must do this because of # NOTE (leseb): we must do this because of
# https://github.com/ansible/ansible/issues/4297 # https://github.com/ansible/ansible/issues/4297
@ -42,9 +42,8 @@
failed_when: false failed_when: false
register: osd_partition_status register: osd_partition_status
when: when:
journal_collocation or - journal_collocation or raw_multi_journal
raw_multi_journal and not - not osd_auto_discovery
osd_auto_discovery
- name: check the partition status of the osd disks (autodiscover disks) - name: check the partition status of the osd disks (autodiscover disks)
shell: "parted --script /dev/{{ item.key }} print > /dev/null 2>&1" shell: "parted --script /dev/{{ item.key }} print > /dev/null 2>&1"
@ -53,12 +52,11 @@
failed_when: false failed_when: false
register: osd_partition_status_autodiscover register: osd_partition_status_autodiscover
when: when:
journal_collocation or - journal_collocation or raw_multi_journal
raw_multi_journal and - ansible_devices is defined
ansible_devices is defined and - item.value.removable == "0"
item.value.removable == "0" and - item.value.partitions|count == 0
item.value.partitions|count == 0 and - osd_auto_discovery
osd_auto_discovery
# NOTE (leseb): we must do this because of # NOTE (leseb): we must do this because of
# https://github.com/ansible/ansible/issues/4297 # https://github.com/ansible/ansible/issues/4297
@ -86,9 +84,9 @@
- devices - devices
changed_when: false changed_when: false
when: when:
(journal_collocation or raw_multi_journal) and not - journal_collocation or raw_multi_journal
osd_auto_discovery and - not osd_auto_discovery
item.0.rc != 0 - item.0.rc != 0
- name: fix partitions gpt header or labels of the osd disks (autodiscover disks) - name: fix partitions gpt header or labels of the osd disks (autodiscover disks)
shell: "sgdisk --zap-all --clear --mbrtogpt -g -- '/dev/{{ item.1.key }}' || sgdisk --zap-all --clear --mbrtogpt -g -- '/dev/{{ item.1.key }}'" shell: "sgdisk --zap-all --clear --mbrtogpt -g -- '/dev/{{ item.1.key }}' || sgdisk --zap-all --clear --mbrtogpt -g -- '/dev/{{ item.1.key }}'"
@ -97,12 +95,12 @@
- ansible_devices - ansible_devices
changed_when: false changed_when: false
when: when:
journal_collocation and - journal_collocation
osd_auto_discovery and - osd_auto_discovery
ansible_devices is defined and - ansible_devices is defined
item.value.removable == "0" and - item.value.removable == "0"
item.value.partitions|count == 0 and - item.value.partitions|count == 0
item.0.rc != 0 - item.0.rc != 0
- name: fix partitions gpt header or labels of the journal devices - name: fix partitions gpt header or labels of the journal devices
shell: "sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }} || shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}" shell: "sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }} || shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}"
@ -111,8 +109,8 @@
- raw_journal_devices - raw_journal_devices
changed_when: false changed_when: false
when: when:
raw_multi_journal and - raw_multi_journal
item.0.rc != 0 - item.0.rc != 0
- name: check if a partition named 'ceph' exists - name: check if a partition named 'ceph' exists
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'" shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
@ -129,9 +127,9 @@
failed_when: false failed_when: false
register: parted_autodiscover register: parted_autodiscover
when: when:
ansible_devices is defined and - ansible_devices is defined
item.value.removable == "0" and - item.value.removable == "0"
osd_auto_discovery - osd_auto_discovery
# NOTE (leseb): we must do this because of # NOTE (leseb): we must do this because of
# https://github.com/ansible/ansible/issues/4297 # https://github.com/ansible/ansible/issues/4297

View File

@ -15,8 +15,7 @@
- set_fact: - set_fact:
after_hamer=True after_hamer=True
when: when: ceph_version.stdout not in ['firefly','giant', 'hammer']
ceph_version.stdout not in ['firefly','giant', 'hammer']
- name: create bootstrap directories (for or before hammer) - name: create bootstrap directories (for or before hammer)
file: file:

View File

@ -7,8 +7,8 @@
- include: checks.yml - include: checks.yml
when: when:
ceph_health.rc != 0 and - ceph_health.rc != 0
not osd_containerized_deployment_with_kv - not osd_containerized_deployment_with_kv
- name: check if it is Atomic host - name: check if it is Atomic host
stat: path=/run/ostree-booted stat: path=/run/ostree-booted

View File

@ -32,8 +32,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
tags: tags:
with_pkg with_pkg
@ -45,8 +45,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
tags: tags:
with_pkg with_pkg

View File

@ -29,11 +29,11 @@
- ceph_osd_docker_devices - ceph_osd_docker_devices
- osd_prepared.results - osd_prepared.results
when: when:
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
ceph_osd_docker_prepare_env is defined and - ceph_osd_docker_prepare_env is defined
not osd_containerized_deployment_with_kv and - not osd_containerized_deployment_with_kv
not is_atomic and - not is_atomic
not ansible_os_family == 'CoreOS' - not ansible_os_family == 'CoreOS'
- name: prepare ceph osd disk with kv_store - name: prepare ceph osd disk with kv_store
docker: docker:
@ -50,11 +50,11 @@
- ceph_osd_docker_devices - ceph_osd_docker_devices
- osd_prepared.results - osd_prepared.results
when: when:
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
ceph_osd_docker_prepare_env is defined and - ceph_osd_docker_prepare_env is defined
osd_containerized_deployment_with_kv and - osd_containerized_deployment_with_kv
not is_atomic and - not is_atomic
not ansible_os_family == 'CoreOS' - not ansible_os_family == 'CoreOS'
- name: prepare ceph osd disk for container operating systems - name: prepare ceph osd disk for container operating systems
shell: | shell: |
@ -74,10 +74,9 @@
- ceph_osd_docker_devices - ceph_osd_docker_devices
- osd_prepared.results - osd_prepared.results
when: when:
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
is_atomic or - is_atomic or ansible_os_family == 'CoreOS'
ansible_os_family == 'CoreOS' and - not osd_containerized_deployment_with_kv
not osd_containerized_deployment_with_kv
- name: prepare ceph osd disk for container operating systems with kv_store - name: prepare ceph osd disk for container operating systems with kv_store
shell: | shell: |
@ -97,10 +96,9 @@
- ceph_osd_docker_devices - ceph_osd_docker_devices
- osd_prepared.results - osd_prepared.results
when: when:
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
is_atomic or - is_atomic or ansible_os_family == 'CoreOS'
ansible_os_family == 'CoreOS' and - osd_containerized_deployment_with_kv
osd_containerized_deployment_with_kv
# Use systemd to manage container on Atomic host # Use systemd to manage container on Atomic host
- name: generate systemd unit file - name: generate systemd unit file
@ -112,9 +110,7 @@
group: "root" group: "root"
mode: "0644" mode: "0644"
failed_when: false failed_when: false
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: link systemd unit file for osd instance - name: link systemd unit file for osd instance
file: file:
@ -122,26 +118,20 @@
dest: /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service dest: /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service
state: link state: link
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: enable systemd unit file for osd instance - name: enable systemd unit file for osd instance
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item | basename }}.service
failed_when: false failed_when: false
changed_when: false changed_when: false
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: reload systemd unit files - name: reload systemd unit files
shell: systemctl daemon-reload shell: systemctl daemon-reload
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: systemd start osd container - name: systemd start osd container
service: service:
@ -150,9 +140,7 @@
enabled: yes enabled: yes
changed_when: false changed_when: false
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: when: is_atomic or ansible_os_family == 'CoreOS'
is_atomic or
ansible_os_family == 'CoreOS'
- name: run the ceph osd docker image - name: run the ceph osd docker image
docker: docker:
@ -166,9 +154,9 @@
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev:/dev,/run:/run" volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev:/dev,/run:/run"
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: when:
not is_atomic and - not is_atomic
ansible_os_family != 'CoreOS' and - ansible_os_family != 'CoreOS'
not osd_containerized_deployment_with_kv - not osd_containerized_deployment_with_kv
- name: run the ceph osd docker image with kv - name: run the ceph osd docker image with kv
docker: docker:
@ -182,6 +170,6 @@
volumes: "/dev/:/dev/" volumes: "/dev/:/dev/"
with_items: ceph_osd_docker_devices with_items: ceph_osd_docker_devices
when: when:
not is_atomic and - not is_atomic
ansible_os_family != 'CoreOS' and - ansible_os_family != 'CoreOS'
osd_containerized_deployment_with_kv - osd_containerized_deployment_with_kv

View File

@ -4,23 +4,23 @@
- include: ./scenarios/journal_collocation.yml - include: ./scenarios/journal_collocation.yml
when: when:
journal_collocation and - journal_collocation
not osd_containerized_deployment - not osd_containerized_deployment
- include: ./scenarios/raw_multi_journal.yml - include: ./scenarios/raw_multi_journal.yml
when: when:
raw_multi_journal and - raw_multi_journal
not osd_containerized_deployment - not osd_containerized_deployment
- include: ./scenarios/osd_directory.yml - include: ./scenarios/osd_directory.yml
when: when:
osd_directory and - osd_directory
not osd_containerized_deployment - not osd_containerized_deployment
- include: ./scenarios/bluestore.yml - include: ./scenarios/bluestore.yml
when: when:
osd_objectstore == 'bluestore' and - osd_objectstore == 'bluestore'
not osd_containerized_deployment - not osd_containerized_deployment
- include: ./docker/main.yml - include: ./docker/main.yml
when: osd_containerized_deployment when: osd_containerized_deployment

View File

@ -32,5 +32,5 @@
- { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true } - { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
when: when:
cephx and - cephx
item.copy_key|bool - item.copy_key|bool

View File

@ -1,4 +1,3 @@
--- ---
## SCENARIO 4: BLUESTORE ## SCENARIO 4: BLUESTORE
@ -16,11 +15,11 @@
register: prepared_osds register: prepared_osds
with_dict: ansible_devices with_dict: ansible_devices
when: when:
ansible_devices is defined and - ansible_devices is defined
item.value.removable == "0" and - item.value.removable == "0"
item.value.partitions|count == 0 and - item.value.partitions|count == 0
bluestore and - bluestore
osd_auto_discovery - osd_auto_discovery
- name: manually prepare osd disk(s) - name: manually prepare osd disk(s)
command: ceph-disk prepare --bluestore --cluster "{{ cluster }}" "{{ item.2 }}" command: ceph-disk prepare --bluestore --cluster "{{ cluster }}" "{{ item.2 }}"
@ -30,11 +29,11 @@
- combined_ispartition_results.results - combined_ispartition_results.results
- devices - devices
when: when:
not item.0.get("skipped") and - not item.0.get("skipped")
not item.1.get("skipped") and - not item.1.get("skipped")
item.0.get("rc", 0) != 0 and - item.0.get("rc", 0) != 0
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
bluestore and not - bluestore
osd_auto_discovery - not osd_auto_discovery
- include: ../activate_osds.yml - include: ../activate_osds.yml

View File

@ -15,11 +15,11 @@
register: prepared_osds register: prepared_osds
with_dict: ansible_devices with_dict: ansible_devices
when: when:
ansible_devices is defined and - ansible_devices is defined
item.value.removable == "0" and - item.value.removable == "0"
item.value.partitions|count == 0 and - item.value.partitions|count == 0
journal_collocation and - journal_collocation
osd_auto_discovery - osd_auto_discovery
- name: manually prepare osd disk(s) - name: manually prepare osd disk(s)
command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }}" command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }}"
@ -29,11 +29,11 @@
- combined_ispartition_results.results - combined_ispartition_results.results
- devices - devices
when: when:
not item.0.get("skipped") and - not item.0.get("skipped")
not item.1.get("skipped") and - not item.1.get("skipped")
item.0.get("rc", 0) != 0 and - item.0.get("rc", 0) != 0
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
journal_collocation and not - journal_collocation
osd_auto_discovery - not osd_auto_discovery
- include: ../activate_osds.yml - include: ../activate_osds.yml

View File

@ -19,11 +19,11 @@
changed_when: false changed_when: false
ignore_errors: true ignore_errors: true
when: when:
not item.0.get("skipped") and - not item.0.get("skipped")
not item.1.get("skipped") and - not item.1.get("skipped")
item.0.get("rc", 0) != 0 and - item.0.get("rc", 0) != 0
item.1.get("rc", 0) != 0 and - item.1.get("rc", 0) != 0
raw_multi_journal and - raw_multi_journal
not osd_auto_discovery - not osd_auto_discovery
- include: ../activate_osds.yml - include: ../activate_osds.yml

View File

@ -24,5 +24,4 @@
owner: "{{ key_owner }}" owner: "{{ key_owner }}"
group: "{{ key_group }}" group: "{{ key_group }}"
mode: "{{ key_mode }}" mode: "{{ key_mode }}"
when: when: cephx
cephx

View File

@ -11,8 +11,8 @@
command: service ceph start ceph-rbd-mirror command: service ceph start ceph-rbd-mirror
changed_when: false changed_when: false
when: when:
use_systemd and - use_systemd
is_before_infernalis - is_before_infernalis
- name: enable systemd unit file for the rbd mirror service (systemd after hammer) - name: enable systemd unit file for the rbd mirror service (systemd after hammer)
file: file:
@ -22,8 +22,8 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: start and add that the rbd mirror service to the init sequence (systemd after hammer) - name: start and add that the rbd mirror service to the init sequence (systemd after hammer)
service: service:
@ -32,5 +32,5 @@
enabled: yes enabled: yes
changed_when: false changed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer

View File

@ -8,8 +8,7 @@
- set_fact: - set_fact:
after_hammer=True after_hammer=True
when: when: ceph_version.stdout not in ['firefly','giant', 'hammer']
ceph_version.stdout not in ['firefly','giant', 'hammer']
- name: create bootstrap directories (for or before hammer) - name: create bootstrap directories (for or before hammer)
file: file:

View File

@ -32,8 +32,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
tags: tags:
with_pkg with_pkg
@ -45,8 +45,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
tags: tags:
with_pkg with_pkg

View File

@ -15,8 +15,7 @@
- set_fact: - set_fact:
after_hammer=True after_hammer=True
when: when: ceph_version.stdout not in ['firefly','giant', 'hammer']
ceph_version.stdout not in ['firefly','giant', 'hammer']
- name: create bootstrap directories (for or before hammer) - name: create bootstrap directories (for or before hammer)
file: file:

View File

@ -32,8 +32,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "yum" - ansible_pkg_mgr == "yum"
tags: tags:
with_pkg with_pkg
@ -45,8 +45,8 @@
- python-pip - python-pip
- docker-engine - docker-engine
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
ansible_pkg_mgr == "dnf" - ansible_pkg_mgr == "dnf"
tags: tags:
with_pkg with_pkg

View File

@ -23,8 +23,8 @@
- { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true } - { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
when: when:
cephx and - cephx
item.copy_key|bool - item.copy_key|bool
- name: create rados gateway keyring - name: create rados gateway keyring
command: ceph --cluster {{ cluster }} --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring command: ceph --cluster {{ cluster }} --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring

View File

@ -8,10 +8,10 @@
- name: start rgw - name: start rgw
command: /etc/init.d/radosgw start command: /etc/init.d/radosgw start
when: when:
rgwstatus.rc != 0 and - rgwstatus.rc != 0
ansible_distribution != "Ubuntu" and - ansible_distribution != "Ubuntu"
ansible_os_family != 'RedHat' and - ansible_os_family != 'RedHat'
not use_systemd - not use_systemd
- name: start and add that the rados gateway service to the init sequence (ubuntu) - name: start and add that the rados gateway service to the init sequence (ubuntu)
command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }} command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
@ -25,8 +25,8 @@
state: started state: started
enabled: yes enabled: yes
when: when:
ansible_os_family == 'RedHat' and - ansible_os_family == 'RedHat'
is_before_infernalis - is_before_infernalis
- name: enable systemd unit file for rgw instance (for or after infernalis) - name: enable systemd unit file for rgw instance (for or after infernalis)
file: file:
@ -36,8 +36,8 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer
- name: start rgw with systemd (for or after infernalis) - name: start rgw with systemd (for or after infernalis)
service: service:
@ -45,5 +45,5 @@
state: started state: started
enabled: yes enabled: yes
when: when:
use_systemd and - use_systemd
is_after_hammer - is_after_hammer