###########
# INSTALL #
###########
-
+#ceph_rhcs_cdn_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'cdn' if ceph_rhcs_cdn_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs_iso_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'iso' if ceph_rhcs_iso_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_dev: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable_uca: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_custom: False # backward compatibility with stable-2.2, will disappear in stable 3.1
# ORIGIN SOURCE
#
# - 'distro' means that no separate repo file will be added
# you will get whatever version of Ceph is included in your Linux distro.
# 'local' means that the ceph binaries will be copied over from the local machine
-#ceph_origin: 'dummy'
+#ceph_origin: "{{ 'repository' if ceph_rhcs or ceph_stable or ceph_dev or ceph_stable_uca or ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
#valid_ceph_origins:
# - repository
# - distro
# - local
-#ceph_repository: dummy
+#ceph_repository: "{{ 'community' if ceph_stable else 'rhcs' if ceph_rhcs else 'dev' if ceph_dev else 'uca' if ceph_stable_uca else 'custom' if ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
#valid_ceph_repository:
# - community
# - rhcs
# To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6)
#monitor_interface: interface
#monitor_address: 0.0.0.0
-#monitor_address_block: []
+#monitor_address_block: subnet
# set to either ipv4 or ipv6, whichever your network is using
#ip_version: ipv4
#mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
# Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined.
# To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
#radosgw_interface: interface
-#radosgw_address: 0.0.0.0
-#radosgw_address_block: []
+#radosgw_address: "{{ '0.0.0.0' if rgw_containerized_deployment else 'address' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#radosgw_address_block: subnet
#radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
# Rados Gateway options
#email_address: foo@bar.com
#docker: false
#ceph_docker_image: "ceph/daemon"
#ceph_docker_image_tag: latest
-
-# Do not comment the following variables containerized_deployment_* here. These variables are being used
-# by ceph.conf.j2 template. so it should always be defined
-#containerized_deployment_with_kv: false
-#containerized_deployment: false
-#mon_containerized_default_ceph_conf_with_kv: false
#ceph_docker_registry: docker.io
#ceph_docker_enable_centos_extra_repo: false
#ceph_docker_on_openstack: false
+#ceph_mon_docker_interface: "{{ monitor_interface }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_mon_docker_subnet: "{{ public_network }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mon_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#osd_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mds_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#rgw_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#containerized_deployment: "{{ True if mon_containerized_deployment or osd_containerized_deployment or mds_containerized_deployment or rgw_containerized_deployment else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
############
# KV store #
############
+#containerized_deployment_with_kv: false
+#mon_containerized_default_ceph_conf_with_kv: false
#kv_type: etcd
#kv_endpoint: 127.0.0.1
#kv_port: 2379
# do not ever change this here
#rolling_update: false
+
# You can override default vars defined in defaults/main.yml here,
# but I would advice to use host or group vars instead
+#raw_journal_devices: "{{ dedicated_devices }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#raw_multi_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#dmcrytpt_journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#dmcrypt_dedicated_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+
###########
# GENERAL #
# Encrypt your OSD device using dmcrypt
# If set to True, no matter which osd_objecstore and osd_scenario you use the data will be encrypted
-#dmcrypt: false
+#dmcrypt: "{{ True if dmcrytpt_journal_collocation or dmcrypt_dedicated_journal else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
# I. First scenario: collocated
# /dev/sda2: PARTLABEL="ceph block" PARTUUID="e6ca3e1d-4702-4569-abfa-e285de328e9d"
#
-#osd_scenario: dummy
+#osd_scenario: "{{ 'collocated' if journal_collocation or dmcrytpt_journal_collocation else 'non-collocated' if raw_multi_journal or dmcrypt_dedicated_journal else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
#valid_osd_scenarios:
# - collocated
# - non-collocated
###########
# INSTALL #
###########
-
+#ceph_rhcs_cdn_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'cdn' if ceph_rhcs_cdn_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs_iso_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_repository_type: "{{ 'iso' if ceph_rhcs_iso_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_rhcs: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_dev: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_stable_uca: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_custom: False # backward compatibility with stable-2.2, will disappear in stable 3.1
# ORIGIN SOURCE
#
# To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6)
#monitor_interface: interface
#monitor_address: 0.0.0.0
-#monitor_address_block: []
+#monitor_address_block: subnet
# set to either ipv4 or ipv6, whichever your network is using
#ip_version: ipv4
#mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
# Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined.
# To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
#radosgw_interface: interface
-#radosgw_address: 0.0.0.0
-#radosgw_address_block: []
+#radosgw_address: "{{ '0.0.0.0' if rgw_containerized_deployment else 'address' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#radosgw_address_block: subnet
#radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
# Rados Gateway options
#email_address: foo@bar.com
#docker: false
#ceph_docker_image: "ceph/daemon"
#ceph_docker_image_tag: latest
-
-# Do not comment the following variables containerized_deployment_* here. These variables are being used
-# by ceph.conf.j2 template. so it should always be defined
-#containerized_deployment_with_kv: false
-#containerized_deployment: false
-#mon_containerized_default_ceph_conf_with_kv: false
#ceph_docker_registry: docker.io
#ceph_docker_enable_centos_extra_repo: false
#ceph_docker_on_openstack: false
+#ceph_mon_docker_interface: "{{ monitor_interface }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#ceph_mon_docker_subnet: "{{ public_network }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mon_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#osd_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#mds_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#rgw_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+#containerized_deployment: "{{ True if mon_containerized_deployment or osd_containerized_deployment or mds_containerized_deployment or rgw_containerized_deployment else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
############
# KV store #
############
+#containerized_deployment_with_kv: false
+#mon_containerized_default_ceph_conf_with_kv: false
#kv_type: etcd
#kv_endpoint: 127.0.0.1
#kv_port: 2379
# do not ever change this here
#rolling_update: false
+
- name: confirm whether user really meant to upgrade the cluster
hosts: localhost
+ vars:
+ - mgr_group_name: mgrs
vars_prompt:
- name: ireallymeanit
private: no
tasks:
- - name: exit playbook, if user did not mean to upgrade cluster
- fail:
- msg: >
- "Exiting rolling_update.yml playbook, cluster was NOT upgraded.
- To upgrade the cluster, either say 'yes' on the prompt or
- use `-e ireallymeanit=yes` on the command line when
- invoking the playbook"
- when: ireallymeanit != 'yes'
+ - name: exit playbook, if user did not mean to upgrade cluster
+ fail:
+ msg: >
+ "Exiting rolling_update.yml playbook, cluster was NOT upgraded.
+ To upgrade the cluster, either say 'yes' on the prompt or
+ use `-e ireallymeanit=yes` on the command line when
+ invoking the playbook"
+ when: ireallymeanit != 'yes'
+
+ - name: fail if no mgr host is present in the inventory
+ fail:
+ msg: "Please add a mgr host to your inventory."
+ when:
+ - groups.get(mgr_group_name, []) | length == 0
- name: gather facts and check the init system
- "{{ client_group_name|default('clients') }}"
become: True
+ gather_facts: False
+ vars:
+ delegate_facts_host: True
tasks:
- debug: msg="gather facts on all Ceph hosts for following reference"
+ - name: gather facts
+ setup:
+ when:
+ - not delegate_facts_host | bool
+
+ - name: gather and delegate facts
+ setup:
+ delegate_to: "{{ item }}"
+ delegate_facts: True
+ with_items: "{{ groups['all'] }}"
+ when:
+ - delegate_facts_host | bool
+
- set_fact: rolling_update=true
- name: upgrade ceph mon cluster
roles:
- ceph-defaults
- - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
+ - ceph-config
- ceph-mon
post_tasks:
roles:
- ceph-defaults
- - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
+ - ceph-config
- ceph-osd
post_tasks:
roles:
- ceph-defaults
- - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
+ - ceph-config
- ceph-mds
post_tasks:
roles:
- ceph-defaults
- - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
+ - ceph-config
- ceph-rgw
post_tasks:
roles:
- ceph-defaults
- - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
+ - ceph-config
- ceph-rbd-mirror
post_tasks:
roles:
- ceph-defaults
- - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
+ - ceph-config
- ceph-client
tags:
- package-install
-- name: make sure monitor_interface or monitor_address is defined
+- name: make sure monitor_interface, monitor_address or monitor_address_block is defined
fail:
- msg: "you must set monitor_interface or monitor_address"
+ msg: "you must set monitor_interface, monitor_address or monitor_address_block"
when:
+ - mon_group_name in group_names
- monitor_interface == 'interface'
- monitor_address == "0.0.0.0"
- - mon_group_name in group_names
+ - monitor_address_block == 'subnet'
-- name: make sure radosgw_interface or radosgw_address is defined
+- name: make sure radosgw_interface, radosgw_address or radosgw_address_block is defined
fail:
- msg: "you must set radosgw_interface or radosgw_address"
+ msg: "you must set radosgw_interface, radosgw_address or radosgw_address_block"
when:
- - radosgw_interface == 'interface'
- - radosgw_address == "0.0.0.0"
- rgw_group_name in group_names
+ - radosgw_interface == 'interface'
+ - radosgw_address == 'address'
+ - radosgw_address_block == 'subnet'
{% if not containerized_deployment and not containerized_deployment_with_kv -%}
mon host = {% if nb_mon > 0 %}
{% for host in groups[mon_group_name] -%}
- {% if monitor_address_block | length > 0 %}
+ {% if monitor_address_block != 'subnet' %}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
{%- elif ip_version == 'ipv6' -%}
fsid = {{ fsid }}
mon host = {% if nb_mon > 0 %}
{% for host in groups[mon_group_name] -%}
- {% if monitor_address_block | length > 0 %}
+ {% if monitor_address_block != 'subnet' %}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
{%- elif ip_version == 'ipv6' -%}
host = {{ hostvars[host]['ansible_hostname'] }}
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}/keyring
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
-{% if hostvars[host]['radosgw_address_block'] is defined and hostvars[host]['radosgw_address_block'] | length > 0 %}
+{% if hostvars[host]['radosgw_address_block'] is defined and hostvars[host]['radosgw_address_block'] != 'subnet' %}
{% if ip_version == 'ipv4' %}
rgw frontends = civetweb port={{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% elif ip_version == 'ipv6' %}
rgw frontends = civetweb port=[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% endif %}
-{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != '0.0.0.0' -%}
+{% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
+ {% if ip_version == 'ipv4' %}
+rgw frontends = civetweb port={{ radosgw_address_block | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+ {% elif ip_version == 'ipv6' %}
+rgw frontends = civetweb port=[{{ radosgw_address_block | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+ {% endif %}
+{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != 'address' -%}
{% if ip_version == 'ipv4' %}
rgw frontends = civetweb port={{ hostvars[host]['radosgw_address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% elif ip_version == 'ipv6' %}
rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% endif %}
-{% else %}
+{% elif radosgw_address is defined and radosgw_address != 'address' -%}
+ {% if ip_version == 'ipv4' %}
+rgw frontends = civetweb port={{ radosgw_address }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+ {% elif ip_version == 'ipv6' %}
+rgw frontends = civetweb port=[{{ radosgw_address }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+ {% endif %}
+{% elif hostvars[host]['radosgw_interface'] is defined -%}
{% if ip_version == 'ipv4' %}
rgw frontends = civetweb port={{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% elif ip_version == 'ipv6' %}
rgw frontends = civetweb port=[{{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% endif %}
+{% else %}
+ {% if ip_version == 'ipv4' %}
+rgw frontends = civetweb port={{ ['ansible_' + radosgw_interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+ {% elif ip_version == 'ipv6' %}
+rgw frontends = civetweb port=[{{ ['ansible_' + radosgw_interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+ {% endif %}
{% endif %}
{% endif %}
{% endfor %}
###########
# INSTALL #
###########
-
+ceph_rhcs_cdn_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_repository_type: "{{ 'cdn' if ceph_rhcs_cdn_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_rhcs_iso_install: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_repository_type: "{{ 'iso' if ceph_rhcs_iso_install else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_rhcs: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_stable: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_dev: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_stable_uca: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_custom: False # backward compatibility with stable-2.2, will disappear in stable 3.1
# ORIGIN SOURCE
#
# - 'distro' means that no separate repo file will be added
# you will get whatever version of Ceph is included in your Linux distro.
# 'local' means that the ceph binaries will be copied over from the local machine
-ceph_origin: 'dummy'
+ceph_origin: "{{ 'repository' if ceph_rhcs or ceph_stable or ceph_dev or ceph_stable_uca or ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
valid_ceph_origins:
- repository
- distro
- local
-ceph_repository: dummy
+ceph_repository: "{{ 'community' if ceph_stable else 'rhcs' if ceph_rhcs else 'dev' if ceph_dev else 'uca' if ceph_stable_uca else 'custom' if ceph_custom else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
valid_ceph_repository:
- community
- rhcs
# To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6)
monitor_interface: interface
monitor_address: 0.0.0.0
-monitor_address_block: []
+monitor_address_block: subnet
# set to either ipv4 or ipv6, whichever your network is using
ip_version: ipv4
mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
# Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined.
# To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
radosgw_interface: interface
-radosgw_address: 0.0.0.0
-radosgw_address_block: []
+radosgw_address: "{{ '0.0.0.0' if rgw_containerized_deployment else 'address' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+radosgw_address_block: subnet
radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
# Rados Gateway options
email_address: foo@bar.com
docker: false
ceph_docker_image: "ceph/daemon"
ceph_docker_image_tag: latest
-
-# Do not comment the following variables containerized_deployment_* here. These variables are being used
-# by ceph.conf.j2 template. so it should always be defined
-containerized_deployment_with_kv: false
-containerized_deployment: false
-mon_containerized_default_ceph_conf_with_kv: false
ceph_docker_registry: docker.io
ceph_docker_enable_centos_extra_repo: false
ceph_docker_on_openstack: false
+ceph_mon_docker_interface: "{{ monitor_interface }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+ceph_mon_docker_subnet: "{{ public_network }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+mon_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+osd_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+mds_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+rgw_containerized_deployment: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+containerized_deployment: "{{ True if mon_containerized_deployment or osd_containerized_deployment or mds_containerized_deployment or rgw_containerized_deployment else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
############
# KV store #
############
+containerized_deployment_with_kv: false
+mon_containerized_default_ceph_conf_with_kv: false
kv_type: etcd
kv_endpoint: 127.0.0.1
kv_port: 2379
# this is only here for usage with the rolling_update.yml playbook
# do not ever change this here
rolling_update: false
+
{% if containerized_deployment %}
DOCKER_EXEC="docker exec ceph-rgw-{{ ansible_hostname }}"
{% endif %}
-
-{% if radosgw_address_block | length > 0 %}
- {% if ip_version == 'ipv4' -%}
-RGW_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}
- {%- elif ip_version == 'ipv6' -%}
-RGW_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]
- {%- endif %}
-{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != '0.0.0.0' -%}
- {% if ip_version == 'ipv4' -%}
-RGW_IP={{ hostvars[inventory_hostname]['radosgw_address'] }}
- {%- elif ip_version == 'ipv6' -%}
-RGW_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}]
- {% endif %}
-{%- else -%}
- {% set interface = ["ansible_",radosgw_interface]|join %}
- {% if ip_version == 'ipv6' -%}
-RGW_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}]
- {%- elif ip_version == 'ipv4' -%}
-RGW_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }}
- {% endif %}
-{%- endif %}
+{% if hostvars[inventory_hostname]['radosgw_address_block'] is defined and hostvars[inventory_hostname]['radosgw_address_block'] != 'subnet' %}
+ {% if ip_version == 'ipv4' %}
+RGW_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+ {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+ {% endif %}
+{% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
+ {% if ip_version == 'ipv4' %}
+RGW_IP={{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+ {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+ {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != 'address' -%}
+ {% if ip_version == 'ipv4' %}
+RGW_IP={{ hostvars[inventory_hostname]['radosgw_address'] }} \
+ {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \
+ {% endif %}
+{% elif radosgw_address is defined and radosgw_address != 'address' -%}
+ {% if ip_version == 'ipv4' %}
+RGW_IP={{ radosgw_address }} \
+ {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ radosgw_address }}] \
+ {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_interface'] is defined -%}
+ {% set interface = 'ansible_' + hostvars[inventory_hostname]['radosgw_interface'] %}
+ {% if ip_version == 'ipv4' %}
+RGW_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
+ {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
+ {% endif %}
+{% else %}
+ {% set interface = 'ansible_' + radosgw_interface %}
+ {% if ip_version == 'ipv4' %}
+RGW_IP={{ [interface][ip_version]['address'] }} \
+ {% elif ip_version == 'ipv6' %}
+RGW_IP=[{{ [interface][ip_version][0]['address'] }}] \
+ {% endif %}
+{% endif %}
check_for_curl_or_wget() {
if $DOCKER_EXEC command -v wget &>/dev/null; then
--- /dev/null
+---
+- name: make sure monitor_interface, monitor_address or monitor_address_block is defined
+ fail:
+ msg: "you must set monitor_interface, monitor_address or monitor_address_block"
+ when:
+ - mon_group_name in group_names
+ - monitor_interface == 'interface'
+ - monitor_address == "0.0.0.0"
+ - monitor_address_block == 'subnet'
+
+- name: make sure radosgw_interface, radosgw_address or radosgw_address_block is defined
+ fail:
+ msg: "you must set radosgw_interface, radosgw_address or radosgw_address_block"
+ when:
+ - rgw_group_name in group_names
+ - radosgw_interface == 'interface'
+ - radosgw_address == 'address'
+ - radosgw_address_block == 'subnet'
- name: include system_checks.yml
include: system_checks.yml
+- name: include check_mandatory_vars.yml
+ include: check_mandatory_vars.yml
+
- name: check if it is atomic host
stat:
path: /run/ostree-booted
when:
- monitor_interface == 'interface'
- monitor_address == '0.0.0.0'
- - monitor_address_block | length == 0
+ - monitor_address_block == 'subnet'
- not containerized_deployment_with_kv
- ip_version == 'ipv4'
- hostvars[groups[mon_group_name][0]]['monitor_address_block'] is defined
- - hostvars[groups[mon_group_name][0]]['monitor_address_block'] | length > 0
+ - hostvars[groups[mon_group_name][0]]['monitor_address_block'] != 'subnet'
- name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup - monitor_interface
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[groups[mon_group_name][0]]['ansible_' + monitor_interface].ipv6[0].address }}]
- not containerized_deployment_with_kv
- ip_version == 'ipv6'
- hostvars[groups[mon_group_name][0]]['monitor_address_block'] is defined
- - hostvars[groups[mon_group_name][0]]['monitor_address_block'] | length > 0
+ - hostvars[groups[mon_group_name][0]]['monitor_address_block'] != 'subnet'
- name: include fetch_configs.yml
include: fetch_configs.yml
--net=host \
{% endif -%}
-e IP_VERSION={{ ip_version[-1:] }} \
- {% if monitor_address_block | length > 0 %}
+ {% if monitor_address_block != 'subnet' %}
{% if ip_version == 'ipv4' -%}
-e MON_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }} \
{% elif ip_version == 'ipv6' -%}
# You can override default vars defined in defaults/main.yml here,
# but I would advice to use host or group vars instead
+raw_journal_devices: "{{ dedicated_devices }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
+journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+raw_multi_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+dmcrytpt_journal_collocation: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+dmcrypt_dedicated_journal: False # backward compatibility with stable-2.2, will disappear in stable 3.1
+
###########
# GENERAL #
# Encrypt your OSD device using dmcrypt
# If set to True, no matter which osd_objecstore and osd_scenario you use the data will be encrypted
-dmcrypt: false
+dmcrypt: "{{ True if dmcrytpt_journal_collocation or dmcrypt_dedicated_journal else False }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
# I. First scenario: collocated
# /dev/sda2: PARTLABEL="ceph block" PARTUUID="e6ca3e1d-4702-4569-abfa-e285de328e9d"
#
-osd_scenario: dummy
+osd_scenario: "{{ 'collocated' if journal_collocation or dmcrytpt_journal_collocation else 'non-collocated' if raw_multi_journal or dmcrypt_dedicated_journal else 'dummy' }}" # backward compatibility with stable-2.2, will disappear in stable 3.1
valid_osd_scenarios:
- collocated
- non-collocated
-e KV_IP={{ kv_endpoint }} \
-e KV_PORT={{ kv_port }} \
{% endif -%}
- {% if radosgw_address_block | length > 0 %}
- {% if ip_version == 'ipv4' -%}
+{% if hostvars[inventory_hostname]['radosgw_address_block'] is defined and hostvars[inventory_hostname]['radosgw_address_block'] != 'subnet' %}
+ {% if ip_version == 'ipv4' %}
-e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
- {% elif ip_version == 'ipv6' -%}
+ {% elif ip_version == 'ipv6' %}
-e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
- {% endif -%}
- {% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != '0.0.0.0' -%}
- {% if ip_version == 'ipv4' -%}
+ {% endif %}
+{% elif radosgw_address_block is defined and radosgw_address_block != 'subnet' -%}
+ {% if ip_version == 'ipv4' %}
+ -e RGW_CIVETWEB_IP={{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
+ {% elif ip_version == 'ipv6' %}
+ -e RGW_CIVETWEB_IP=[{{ ['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
+ {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != 'address' -%}
+ {% if ip_version == 'ipv4' %}
-e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname]['radosgw_address'] }} \
- {% elif ip_version == 'ipv6' -%}
+ {% elif ip_version == 'ipv6' %}
-e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \
- {% endif -%}
- {% else -%}
+ {% endif %}
+{% elif radosgw_address is defined and radosgw_address != 'address' -%}
+ {% if ip_version == 'ipv4' %}
+ -e RGW_CIVETWEB_IP={{ radosgw_address }} \
+ {% elif ip_version == 'ipv6' %}
+ -e RGW_CIVETWEB_IP=[{{ radosgw_address }}] \
+ {% endif %}
+{% elif hostvars[inventory_hostname]['radosgw_interface'] is defined -%}
{% set interface = 'ansible_' + hostvars[inventory_hostname]['radosgw_interface'] %}
- {% if ip_version == 'ipv6' -%}
- -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
- {% elif ip_version == 'ipv4' -%}
+ {% if ip_version == 'ipv4' %}
-e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
- {% endif -%}
- {% endif -%}
-
+ {% elif ip_version == 'ipv6' %}
+ -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
+ {% endif %}
+{% else %}
+ {% set interface = 'ansible_' + radosgw_interface %}
+ {% if ip_version == 'ipv4' %}
+ -e RGW_CIVETWEB_IP={{ [interface][ip_version]['address'] }} \
+ {% elif ip_version == 'ipv6' %}
+ -e RGW_CIVETWEB_IP=[{{ [interface][ip_version][0]['address'] }}] \
+ {% endif %}
+{% endif %}
-v /etc/localtime:/etc/localtime:ro \
-e CEPH_DAEMON=RGW \
-e CLUSTER={{ cluster }} \