mirror of https://github.com/ceph/ceph-ansible.git
Use ansible_facts
It has come to our attention that using ansible_* vars that are
populated with INJECT_FACTS_AS_VARS=True is not very performant. In
order to be able to support setting that to off, we need to update the
references to use ansible_facts[<thing>] instead of ansible_<thing>.
Related: ansible#73654
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1935406
Signed-off-by: Alex Schultz <aschultz@redhat.com>
(cherry picked from commit a7f2fa73e6
)
pull/6389/head
parent
697e5823f3
commit
7ddbe74712
|
@ -80,7 +80,7 @@ dummy:
|
||||||
|
|
||||||
#centos_package_dependencies:
|
#centos_package_dependencies:
|
||||||
# - epel-release
|
# - epel-release
|
||||||
# - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}"
|
# - "{{ (ansible_facts['distribution_major_version'] is version('8', '>=')) | ternary('python3-libselinux', 'libselinux-python') }}"
|
||||||
|
|
||||||
#redhat_package_dependencies: []
|
#redhat_package_dependencies: []
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ dummy:
|
||||||
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
|
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
|
||||||
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
|
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
|
||||||
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
|
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
|
||||||
#ceph_stable_distro_source: "{{ ansible_distribution_release }}"
|
#ceph_stable_distro_source: "{{ ansible_facts['distribution_release'] }}"
|
||||||
|
|
||||||
|
|
||||||
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 4.0)
|
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 4.0)
|
||||||
|
@ -178,7 +178,7 @@ dummy:
|
||||||
#
|
#
|
||||||
#ceph_stable_repo_uca: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
|
#ceph_stable_repo_uca: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
|
||||||
#ceph_stable_openstack_release_uca: queens
|
#ceph_stable_openstack_release_uca: queens
|
||||||
#ceph_stable_release_uca: "{{ ansible_distribution_release }}-updates/{{ ceph_stable_openstack_release_uca }}"
|
#ceph_stable_release_uca: "{{ ansible_facts['distribution_release'] }}-updates/{{ ceph_stable_openstack_release_uca }}"
|
||||||
|
|
||||||
# REPOSITORY: openSUSE OBS
|
# REPOSITORY: openSUSE OBS
|
||||||
#
|
#
|
||||||
|
@ -188,7 +188,7 @@ dummy:
|
||||||
# usually has newer Ceph releases than the normal distro repository.
|
# usually has newer Ceph releases than the normal distro repository.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/{{ ceph_stable_release }}/openSUSE_Leap_{{ ansible_distribution_version }}/"
|
#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/{{ ceph_stable_release }}/openSUSE_Leap_{{ ansible_facts['distribution_version'] }}/"
|
||||||
|
|
||||||
# REPOSITORY: DEV
|
# REPOSITORY: DEV
|
||||||
#
|
#
|
||||||
|
@ -251,7 +251,7 @@ dummy:
|
||||||
|
|
||||||
#ceph_conf_key_directory: /etc/ceph
|
#ceph_conf_key_directory: /etc/ceph
|
||||||
|
|
||||||
#ceph_uid: "{{ '64045' if not containerized_deployment | bool and ansible_os_family == 'Debian' else '167' }}"
|
#ceph_uid: "{{ '64045' if not containerized_deployment | bool and ansible_facts['os_family'] == 'Debian' else '167' }}"
|
||||||
|
|
||||||
# Permissions for keyring files in /etc/ceph
|
# Permissions for keyring files in /etc/ceph
|
||||||
#ceph_keyring_permissions: '0600'
|
#ceph_keyring_permissions: '0600'
|
||||||
|
@ -549,7 +549,7 @@ dummy:
|
||||||
# global:
|
# global:
|
||||||
# foo: 1234
|
# foo: 1234
|
||||||
# bar: 5678
|
# bar: 5678
|
||||||
# "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_hostname'] }}":
|
# "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
|
||||||
# rgw_zone: zone1
|
# rgw_zone: zone1
|
||||||
#
|
#
|
||||||
#ceph_conf_overrides: {}
|
#ceph_conf_overrides: {}
|
||||||
|
|
|
@ -43,14 +43,14 @@ dummy:
|
||||||
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
||||||
|
|
||||||
# TCMU_RUNNER resource limitation
|
# TCMU_RUNNER resource limitation
|
||||||
#ceph_tcmu_runner_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_tcmu_runner_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_tcmu_runner_docker_cpu_limit: 1
|
#ceph_tcmu_runner_docker_cpu_limit: 1
|
||||||
|
|
||||||
# RBD_TARGET_GW resource limitation
|
# RBD_TARGET_GW resource limitation
|
||||||
#ceph_rbd_target_gw_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_rbd_target_gw_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_rbd_target_gw_docker_cpu_limit: 1
|
#ceph_rbd_target_gw_docker_cpu_limit: 1
|
||||||
|
|
||||||
# RBD_TARGET_API resource limitation
|
# RBD_TARGET_API resource limitation
|
||||||
#ceph_rbd_target_api_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_rbd_target_api_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_rbd_target_api_docker_cpu_limit: 1
|
#ceph_rbd_target_api_docker_cpu_limit: 1
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,13 @@ dummy:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
||||||
#ceph_mds_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_mds_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_mds_docker_cpu_limit: 4
|
#ceph_mds_docker_cpu_limit: 4
|
||||||
|
|
||||||
# we currently for MDS_NAME to hostname because of a bug in ceph-docker
|
# we currently for MDS_NAME to hostname because of a bug in ceph-docker
|
||||||
# fix here: https://github.com/ceph/ceph-docker/pull/770
|
# fix here: https://github.com/ceph/ceph-docker/pull/770
|
||||||
# this will go away soon.
|
# this will go away soon.
|
||||||
#ceph_mds_docker_extra_env: -e MDS_NAME={{ ansible_hostname }}
|
#ceph_mds_docker_extra_env: -e MDS_NAME={{ ansible_facts['hostname'] }}
|
||||||
#ceph_config_keys: [] # DON'T TOUCH ME
|
#ceph_config_keys: [] # DON'T TOUCH ME
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ dummy:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_mgr_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mgr_docker_extra_env' variable.
|
||||||
#ceph_mgr_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_mgr_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_mgr_docker_cpu_limit: 1
|
#ceph_mgr_docker_cpu_limit: 1
|
||||||
|
|
||||||
#ceph_mgr_docker_extra_env:
|
#ceph_mgr_docker_extra_env:
|
||||||
|
|
|
@ -45,7 +45,7 @@ dummy:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_mon_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mon_docker_extra_env' variable.
|
||||||
#ceph_mon_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_mon_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_mon_docker_cpu_limit: 1
|
#ceph_mon_docker_cpu_limit: 1
|
||||||
#ceph_mon_container_listen_port: 3300
|
#ceph_mon_container_listen_port: 3300
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ dummy:
|
||||||
#ceph_nfs_enable_service: true
|
#ceph_nfs_enable_service: true
|
||||||
|
|
||||||
# ceph-nfs systemd service uses ansible's hostname as an instance id,
|
# ceph-nfs systemd service uses ansible's hostname as an instance id,
|
||||||
# so service name is ceph-nfs@{{ ansible_hostname }}, this is not
|
# so service name is ceph-nfs@{{ ansible_facts['hostname'] }}, this is not
|
||||||
# ideal when ceph-nfs is managed by pacemaker across multiple hosts - in
|
# ideal when ceph-nfs is managed by pacemaker across multiple hosts - in
|
||||||
# such case it's better to have constant instance id instead which
|
# such case it's better to have constant instance id instead which
|
||||||
# can be set by 'ceph_nfs_service_suffix'
|
# can be set by 'ceph_nfs_service_suffix'
|
||||||
|
@ -95,7 +95,7 @@ dummy:
|
||||||
# they must be configered.
|
# they must be configered.
|
||||||
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
|
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
|
||||||
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
|
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
|
||||||
#rgw_client_name: client.rgw.{{ ansible_hostname }}
|
#rgw_client_name: client.rgw.{{ ansible_facts['hostname'] }}
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# CONFIG OVERRIDE #
|
# CONFIG OVERRIDE #
|
||||||
|
|
|
@ -169,7 +169,7 @@ dummy:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_osd_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_osd_docker_extra_env' variable.
|
||||||
#ceph_osd_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_osd_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_osd_docker_cpu_limit: 4
|
#ceph_osd_docker_cpu_limit: 4
|
||||||
|
|
||||||
# The next two variables are undefined, and thus, unused by default.
|
# The next two variables are undefined, and thus, unused by default.
|
||||||
|
|
|
@ -50,7 +50,7 @@ dummy:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_rbd_mirror_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_rbd_mirror_docker_extra_env' variable.
|
||||||
#ceph_rbd_mirror_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
#ceph_rbd_mirror_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
#ceph_rbd_mirror_docker_cpu_limit: 1
|
#ceph_rbd_mirror_docker_cpu_limit: 1
|
||||||
|
|
||||||
#ceph_rbd_mirror_docker_extra_env:
|
#ceph_rbd_mirror_docker_extra_env:
|
||||||
|
|
|
@ -80,7 +80,7 @@ dummy:
|
||||||
|
|
||||||
#centos_package_dependencies:
|
#centos_package_dependencies:
|
||||||
# - epel-release
|
# - epel-release
|
||||||
# - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}"
|
# - "{{ (ansible_facts['distribution_major_version'] is version('8', '>=')) | ternary('python3-libselinux', 'libselinux-python') }}"
|
||||||
|
|
||||||
#redhat_package_dependencies: []
|
#redhat_package_dependencies: []
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ ceph_repository: rhcs
|
||||||
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
|
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
|
||||||
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
|
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
|
||||||
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
|
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
|
||||||
#ceph_stable_distro_source: "{{ ansible_distribution_release }}"
|
#ceph_stable_distro_source: "{{ ansible_facts['distribution_release'] }}"
|
||||||
|
|
||||||
|
|
||||||
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 4.0)
|
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 4.0)
|
||||||
|
@ -178,7 +178,7 @@ ceph_rhcs_version: 4
|
||||||
#
|
#
|
||||||
#ceph_stable_repo_uca: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
|
#ceph_stable_repo_uca: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
|
||||||
#ceph_stable_openstack_release_uca: queens
|
#ceph_stable_openstack_release_uca: queens
|
||||||
#ceph_stable_release_uca: "{{ ansible_distribution_release }}-updates/{{ ceph_stable_openstack_release_uca }}"
|
#ceph_stable_release_uca: "{{ ansible_facts['distribution_release'] }}-updates/{{ ceph_stable_openstack_release_uca }}"
|
||||||
|
|
||||||
# REPOSITORY: openSUSE OBS
|
# REPOSITORY: openSUSE OBS
|
||||||
#
|
#
|
||||||
|
@ -188,7 +188,7 @@ ceph_rhcs_version: 4
|
||||||
# usually has newer Ceph releases than the normal distro repository.
|
# usually has newer Ceph releases than the normal distro repository.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/{{ ceph_stable_release }}/openSUSE_Leap_{{ ansible_distribution_version }}/"
|
#ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/{{ ceph_stable_release }}/openSUSE_Leap_{{ ansible_facts['distribution_version'] }}/"
|
||||||
|
|
||||||
# REPOSITORY: DEV
|
# REPOSITORY: DEV
|
||||||
#
|
#
|
||||||
|
@ -251,7 +251,7 @@ ceph_iscsi_config_dev: false
|
||||||
|
|
||||||
#ceph_conf_key_directory: /etc/ceph
|
#ceph_conf_key_directory: /etc/ceph
|
||||||
|
|
||||||
#ceph_uid: "{{ '64045' if not containerized_deployment | bool and ansible_os_family == 'Debian' else '167' }}"
|
#ceph_uid: "{{ '64045' if not containerized_deployment | bool and ansible_facts['os_family'] == 'Debian' else '167' }}"
|
||||||
|
|
||||||
# Permissions for keyring files in /etc/ceph
|
# Permissions for keyring files in /etc/ceph
|
||||||
#ceph_keyring_permissions: '0600'
|
#ceph_keyring_permissions: '0600'
|
||||||
|
@ -549,7 +549,7 @@ ceph_iscsi_config_dev: false
|
||||||
# global:
|
# global:
|
||||||
# foo: 1234
|
# foo: 1234
|
||||||
# bar: 5678
|
# bar: 5678
|
||||||
# "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_hostname'] }}":
|
# "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
|
||||||
# rgw_zone: zone1
|
# rgw_zone: zone1
|
||||||
#
|
#
|
||||||
#ceph_conf_overrides: {}
|
#ceph_conf_overrides: {}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
- name: set_fact container_run_cmd, container_exec_cmd
|
- name: set_fact container_run_cmd, container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment | bool else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else '' }}"
|
container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment | bool else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else '' }}"
|
||||||
container_exec_cmd: "{{ container_binary + ' exec ceph-mon-' + hostvars[groups[mon_group_name][0]]['ansible_hostname'] if containerized_deployment | bool else '' }}"
|
container_exec_cmd: "{{ container_binary + ' exec ceph-mon-' + hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] if containerized_deployment | bool else '' }}"
|
||||||
|
|
||||||
- name: get ceph osd tree data
|
- name: get ceph osd tree data
|
||||||
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} osd tree -f json"
|
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} osd tree -f json"
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: get all nfs-ganesha mount points
|
- name: get all nfs-ganesha mount points
|
||||||
command: grep "{{ hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" /proc/mounts
|
command: grep "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" /proc/mounts
|
||||||
register: nfs_ganesha_mount_points
|
register: nfs_ganesha_mount_points
|
||||||
failed_when: false
|
failed_when: false
|
||||||
with_items: "{{ groups[nfs_group_name] }}"
|
with_items: "{{ groups[nfs_group_name] }}"
|
||||||
|
@ -127,7 +127,7 @@
|
||||||
name: nfs-ganesha
|
name: nfs-ganesha
|
||||||
state: stopped
|
state: stopped
|
||||||
failed_when: false
|
failed_when: false
|
||||||
when: ansible_service_mgr == 'systemd'
|
when: ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: purge node-exporter
|
- name: purge node-exporter
|
||||||
hosts:
|
hosts:
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
|
|
||||||
- name: stop ceph mdss with systemd
|
- name: stop ceph mdss with systemd
|
||||||
service:
|
service:
|
||||||
name: ceph-mds@{{ ansible_hostname }}
|
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -270,11 +270,11 @@
|
||||||
|
|
||||||
- name: stop ceph mgrs with systemd
|
- name: stop ceph mgrs with systemd
|
||||||
service:
|
service:
|
||||||
name: ceph-mgr@{{ ansible_hostname }}
|
name: ceph-mgr@{{ ansible_facts['hostname'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
when: ansible_service_mgr == 'systemd'
|
when: ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: purge rgwloadbalancer cluster
|
- name: purge rgwloadbalancer cluster
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@
|
||||||
|
|
||||||
- name: stop ceph rgws with systemd
|
- name: stop ceph rgws with systemd
|
||||||
service:
|
service:
|
||||||
name: "ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
|
name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -340,7 +340,7 @@
|
||||||
|
|
||||||
- name: stop ceph rbd mirror with systemd
|
- name: stop ceph rbd mirror with systemd
|
||||||
service:
|
service:
|
||||||
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@
|
||||||
become: false
|
become: false
|
||||||
wait_for:
|
wait_for:
|
||||||
port: 22
|
port: 22
|
||||||
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
|
host: "{{ hostvars[inventory_hostname]['ansible_facts']['default_ipv4']['address'] }}"
|
||||||
state: started
|
state: started
|
||||||
delay: 10
|
delay: 10
|
||||||
timeout: 500
|
timeout: 500
|
||||||
|
@ -398,7 +398,7 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
with_items: "{{ osd_ids.stdout_lines }}"
|
with_items: "{{ osd_ids.stdout_lines }}"
|
||||||
when: ansible_service_mgr == 'systemd'
|
when: ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: remove ceph udev rules
|
- name: remove ceph udev rules
|
||||||
file:
|
file:
|
||||||
|
@ -613,7 +613,7 @@
|
||||||
|
|
||||||
- name: stop ceph mons with systemd
|
- name: stop ceph mons with systemd
|
||||||
service:
|
service:
|
||||||
name: "ceph-{{ item }}@{{ ansible_hostname }}"
|
name: "ceph-{{ item }}@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -732,27 +732,27 @@
|
||||||
yum:
|
yum:
|
||||||
name: "{{ ceph_packages }}"
|
name: "{{ ceph_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_pkg_mgr == 'yum'
|
when: ansible_facts['pkg_mgr'] == 'yum'
|
||||||
|
|
||||||
- name: purge ceph packages with dnf
|
- name: purge ceph packages with dnf
|
||||||
dnf:
|
dnf:
|
||||||
name: "{{ ceph_packages }}"
|
name: "{{ ceph_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_pkg_mgr == 'dnf'
|
when: ansible_facts['pkg_mgr'] == 'dnf'
|
||||||
|
|
||||||
- name: purge ceph packages with apt
|
- name: purge ceph packages with apt
|
||||||
apt:
|
apt:
|
||||||
name: "{{ ceph_packages }}"
|
name: "{{ ceph_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
purge: true
|
purge: true
|
||||||
when: ansible_pkg_mgr == 'apt'
|
when: ansible_facts['pkg_mgr'] == 'apt'
|
||||||
|
|
||||||
- name: purge remaining ceph packages with yum
|
- name: purge remaining ceph packages with yum
|
||||||
yum:
|
yum:
|
||||||
name: "{{ ceph_remaining_packages }}"
|
name: "{{ ceph_remaining_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'yum'
|
- ansible_facts['pkg_mgr'] == 'yum'
|
||||||
- purge_all_packages | bool
|
- purge_all_packages | bool
|
||||||
|
|
||||||
- name: purge remaining ceph packages with dnf
|
- name: purge remaining ceph packages with dnf
|
||||||
|
@ -760,7 +760,7 @@
|
||||||
name: "{{ ceph_remaining_packages }}"
|
name: "{{ ceph_remaining_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'dnf'
|
- ansible_facts['pkg_mgr'] == 'dnf'
|
||||||
- purge_all_packages | bool
|
- purge_all_packages | bool
|
||||||
|
|
||||||
- name: purge remaining ceph packages with apt
|
- name: purge remaining ceph packages with apt
|
||||||
|
@ -768,7 +768,7 @@
|
||||||
name: "{{ ceph_remaining_packages }}"
|
name: "{{ ceph_remaining_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'apt'
|
- ansible_facts['pkg_mgr'] == 'apt'
|
||||||
- purge_all_packages | bool
|
- purge_all_packages | bool
|
||||||
|
|
||||||
- name: purge extra packages with yum
|
- name: purge extra packages with yum
|
||||||
|
@ -776,7 +776,7 @@
|
||||||
name: "{{ extra_packages }}"
|
name: "{{ extra_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'yum'
|
- ansible_facts['pkg_mgr'] == 'yum'
|
||||||
- purge_all_packages | bool
|
- purge_all_packages | bool
|
||||||
|
|
||||||
- name: purge extra packages with dnf
|
- name: purge extra packages with dnf
|
||||||
|
@ -784,7 +784,7 @@
|
||||||
name: "{{ extra_packages }}"
|
name: "{{ extra_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'dnf'
|
- ansible_facts['pkg_mgr'] == 'dnf'
|
||||||
- purge_all_packages | bool
|
- purge_all_packages | bool
|
||||||
|
|
||||||
- name: purge extra packages with apt
|
- name: purge extra packages with apt
|
||||||
|
@ -792,7 +792,7 @@
|
||||||
name: "{{ extra_packages }}"
|
name: "{{ extra_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'apt'
|
- ansible_facts['pkg_mgr'] == 'apt'
|
||||||
- purge_all_packages | bool
|
- purge_all_packages | bool
|
||||||
|
|
||||||
- name: remove config and any ceph socket left
|
- name: remove config and any ceph socket left
|
||||||
|
@ -818,7 +818,7 @@
|
||||||
|
|
||||||
- name: purge dnf cache
|
- name: purge dnf cache
|
||||||
command: dnf clean all
|
command: dnf clean all
|
||||||
when: ansible_pkg_mgr == 'dnf'
|
when: ansible_facts['pkg_mgr'] == 'dnf'
|
||||||
|
|
||||||
- name: purge rpm cache in /tmp
|
- name: purge rpm cache in /tmp
|
||||||
file:
|
file:
|
||||||
|
@ -827,7 +827,7 @@
|
||||||
|
|
||||||
- name: clean apt
|
- name: clean apt
|
||||||
command: apt-get clean # noqa 303
|
command: apt-get clean # noqa 303
|
||||||
when: ansible_pkg_mgr == 'apt'
|
when: ansible_facts['pkg_mgr'] == 'apt'
|
||||||
|
|
||||||
- name: purge ceph repo file in /etc/yum.repos.d
|
- name: purge ceph repo file in /etc/yum.repos.d
|
||||||
file:
|
file:
|
||||||
|
@ -837,7 +837,7 @@
|
||||||
- ceph-dev
|
- ceph-dev
|
||||||
- ceph_stable
|
- ceph_stable
|
||||||
- rh_storage
|
- rh_storage
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_facts['os_family'] == 'RedHat'
|
||||||
|
|
||||||
- name: check for anything running ceph
|
- name: check for anything running ceph
|
||||||
command: "ps -u ceph -U ceph"
|
command: "ps -u ceph -U ceph"
|
||||||
|
@ -858,7 +858,7 @@
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items: "{{ systemd_files.files }}"
|
with_items: "{{ systemd_files.files }}"
|
||||||
when: ansible_service_mgr == 'systemd'
|
when: ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
|
|
||||||
- name: purge fetch directory
|
- name: purge fetch directory
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: get all nfs-ganesha mount points
|
- name: get all nfs-ganesha mount points
|
||||||
command: grep "{{ hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" /proc/mounts
|
command: grep "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}" /proc/mounts
|
||||||
register: nfs_ganesha_mount_points
|
register: nfs_ganesha_mount_points
|
||||||
failed_when: false
|
failed_when: false
|
||||||
with_items: "{{ groups[nfs_group_name] }}"
|
with_items: "{{ groups[nfs_group_name] }}"
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
|
|
||||||
- name: disable ceph nfs service
|
- name: disable ceph nfs service
|
||||||
service:
|
service:
|
||||||
name: "ceph-nfs@{{ ansible_hostname }}"
|
name: "ceph-nfs@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
path: /etc/systemd/system/ceph-nfs@.service
|
path: /etc/systemd/system/ceph-nfs@.service
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: remove ceph nfs directories for "{{ ansible_hostname }}"
|
- name: remove ceph nfs directories for "{{ ansible_facts['hostname'] }}"
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
|
|
||||||
- name: disable ceph mds service
|
- name: disable ceph mds service
|
||||||
service:
|
service:
|
||||||
name: "ceph-mds@{{ ansible_hostname }}"
|
name: "ceph-mds@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
|
|
||||||
- name: disable ceph mgr service
|
- name: disable ceph mgr service
|
||||||
service:
|
service:
|
||||||
name: "ceph-mgr@{{ ansible_hostname }}"
|
name: "ceph-mgr@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
|
|
||||||
- name: disable ceph rgw service
|
- name: disable ceph rgw service
|
||||||
service:
|
service:
|
||||||
name: "ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
|
name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -230,7 +230,7 @@
|
||||||
|
|
||||||
- name: disable ceph rbd-mirror service
|
- name: disable ceph rbd-mirror service
|
||||||
service:
|
service:
|
||||||
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -352,8 +352,8 @@
|
||||||
enabled: no
|
enabled: no
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
with_items:
|
with_items:
|
||||||
- "ceph-mgr@{{ ansible_hostname }}"
|
- "ceph-mgr@{{ ansible_facts['hostname'] }}"
|
||||||
- "ceph-mon@{{ ansible_hostname }}"
|
- "ceph-mon@{{ ansible_facts['hostname'] }}"
|
||||||
|
|
||||||
- name: remove ceph mon and mgr service
|
- name: remove ceph mon and mgr service
|
||||||
file:
|
file:
|
||||||
|
@ -486,7 +486,7 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: stop ceph-crash container
|
- name: stop ceph-crash container
|
||||||
service:
|
service:
|
||||||
name: "ceph-crash@{{ ansible_hostname }}"
|
name: "ceph-crash@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -595,7 +595,7 @@
|
||||||
state: absent
|
state: absent
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: red hat based systems tasks
|
- name: red hat based systems tasks
|
||||||
block:
|
block:
|
||||||
|
@ -616,7 +616,7 @@
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: no
|
||||||
when:
|
when:
|
||||||
ansible_pkg_mgr == "yum"
|
ansible_facts['pkg_mgr'] == "yum"
|
||||||
|
|
||||||
- name: dnf related tasks on red hat
|
- name: dnf related tasks on red hat
|
||||||
block:
|
block:
|
||||||
|
@ -635,9 +635,9 @@
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: no
|
||||||
when:
|
when:
|
||||||
ansible_pkg_mgr == "dnf"
|
ansible_facts['pkg_mgr'] == "dnf"
|
||||||
when:
|
when:
|
||||||
ansible_os_family == 'RedHat' and
|
ansible_facts['os_family'] == 'RedHat' and
|
||||||
not is_atomic
|
not is_atomic
|
||||||
|
|
||||||
- name: find any service-cid file left
|
- name: find any service-cid file left
|
||||||
|
@ -677,7 +677,7 @@
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: purge ceph directories for "{{ ansible_hostname }}" and ceph socket
|
- name: purge ceph directories for "{{ ansible_facts['hostname'] }}" and ceph socket
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: get iscsi gateway list
|
- name: get iscsi gateway list
|
||||||
|
|
|
@ -194,7 +194,7 @@
|
||||||
# after the package gets upgraded
|
# after the package gets upgraded
|
||||||
- name: stop ceph mon - shortname
|
- name: stop ceph mon - shortname
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mon@{{ ansible_hostname }}
|
name: ceph-mon@{{ ansible_facts['hostname'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -204,7 +204,7 @@
|
||||||
# after the package gets upgraded
|
# after the package gets upgraded
|
||||||
- name: stop ceph mon - fqdn
|
- name: stop ceph mon - fqdn
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mon@{{ ansible_fqdn }}
|
name: ceph-mon@{{ ansible_facts['fqdn'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -214,7 +214,7 @@
|
||||||
# after ALL monitors, even when collocated
|
# after ALL monitors, even when collocated
|
||||||
- name: mask the mgr service
|
- name: mask the mgr service
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mgr@{{ ansible_hostname }}
|
name: ceph-mgr@{{ ansible_facts['hostname'] }}
|
||||||
masked: yes
|
masked: yes
|
||||||
when: inventory_hostname in groups[mgr_group_name] | default([])
|
when: inventory_hostname in groups[mgr_group_name] | default([])
|
||||||
or groups[mgr_group_name] | default([]) | length == 0
|
or groups[mgr_group_name] | default([]) | length == 0
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
|
|
||||||
- name: start ceph mgr
|
- name: start ceph mgr
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mgr@{{ ansible_hostname }}
|
name: ceph-mgr@{{ ansible_facts['hostname'] }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
ignore_errors: True # if no mgr collocated with mons
|
ignore_errors: True # if no mgr collocated with mons
|
||||||
|
@ -244,20 +244,20 @@
|
||||||
register: ceph_health_raw
|
register: ceph_health_raw
|
||||||
until:
|
until:
|
||||||
- ceph_health_raw.rc == 0
|
- ceph_health_raw.rc == 0
|
||||||
- (hostvars[inventory_hostname]['ansible_hostname'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"] or
|
- (hostvars[inventory_hostname]['ansible_facts']['hostname'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"] or
|
||||||
hostvars[inventory_hostname]['ansible_fqdn'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"])
|
hostvars[inventory_hostname]['ansible_facts']['fqdn'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"])
|
||||||
retries: "{{ health_mon_check_retries }}"
|
retries: "{{ health_mon_check_retries }}"
|
||||||
delay: "{{ health_mon_check_delay }}"
|
delay: "{{ health_mon_check_delay }}"
|
||||||
when: not containerized_deployment | bool
|
when: not containerized_deployment | bool
|
||||||
|
|
||||||
- name: container | waiting for the containerized monitor to join the quorum...
|
- name: container | waiting for the containerized monitor to join the quorum...
|
||||||
command: >
|
command: >
|
||||||
{{ container_binary }} exec ceph-mon-{{ ansible_hostname }} ceph --cluster "{{ cluster }}" -m "{{ hostvars[groups[mon_group_name][0]]['_current_monitor_address'] }}" quorum_status --format json
|
{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }} ceph --cluster "{{ cluster }}" -m "{{ hostvars[groups[mon_group_name][0]]['_current_monitor_address'] }}" quorum_status --format json
|
||||||
register: ceph_health_raw
|
register: ceph_health_raw
|
||||||
until:
|
until:
|
||||||
- ceph_health_raw.rc == 0
|
- ceph_health_raw.rc == 0
|
||||||
- (hostvars[inventory_hostname]['ansible_hostname'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"] or
|
- (hostvars[inventory_hostname]['ansible_facts']['hostname'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"] or
|
||||||
hostvars[inventory_hostname]['ansible_fqdn'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"])
|
hostvars[inventory_hostname]['ansible_facts']['fqdn'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"])
|
||||||
retries: "{{ health_mon_check_retries }}"
|
retries: "{{ health_mon_check_retries }}"
|
||||||
delay: "{{ health_mon_check_delay }}"
|
delay: "{{ health_mon_check_delay }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
@ -289,7 +289,7 @@
|
||||||
block:
|
block:
|
||||||
- name: stop ceph mgr
|
- name: stop ceph mgr
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mgr@{{ ansible_hostname }}
|
name: ceph-mgr@{{ ansible_facts['hostname'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
masked: yes
|
masked: yes
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@
|
||||||
# or if we run a Ceph cluster before Luminous
|
# or if we run a Ceph cluster before Luminous
|
||||||
- name: stop ceph mgr
|
- name: stop ceph mgr
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mgr@{{ ansible_hostname }}
|
name: ceph-mgr@{{ ansible_facts['hostname'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -389,7 +389,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd_osd
|
- name: set_fact container_exec_cmd_osd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: stop ceph osd
|
- name: stop ceph osd
|
||||||
|
@ -477,7 +477,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd_osd
|
- name: set_fact container_exec_cmd_osd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: get osd versions
|
- name: get osd versions
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
mds_active_host: "{{ [hostvars[item]['inventory_hostname']] }}"
|
mds_active_host: "{{ [hostvars[item]['inventory_hostname']] }}"
|
||||||
with_items: "{{ groups[mds_group_name] }}"
|
with_items: "{{ groups[mds_group_name] }}"
|
||||||
when: hostvars[item]['ansible_hostname'] == mds_active_name
|
when: hostvars[item]['ansible_facts']['hostname'] == mds_active_name
|
||||||
|
|
||||||
- name: create standby_mdss group
|
- name: create standby_mdss group
|
||||||
add_host:
|
add_host:
|
||||||
|
@ -551,7 +551,7 @@
|
||||||
|
|
||||||
- name: stop standby ceph mds
|
- name: stop standby ceph mds
|
||||||
systemd:
|
systemd:
|
||||||
name: "ceph-mds@{{ hostvars[item]['ansible_hostname'] }}"
|
name: "ceph-mds@{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
|
@ -562,7 +562,7 @@
|
||||||
# somehow, having a single task doesn't work in containerized context
|
# somehow, having a single task doesn't work in containerized context
|
||||||
- name: mask systemd units for standby ceph mds
|
- name: mask systemd units for standby ceph mds
|
||||||
systemd:
|
systemd:
|
||||||
name: "ceph-mds@{{ hostvars[item]['ansible_hostname'] }}"
|
name: "ceph-mds@{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
masked: yes
|
masked: yes
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
with_items: "{{ groups['standby_mdss'] }}"
|
with_items: "{{ groups['standby_mdss'] }}"
|
||||||
|
@ -598,7 +598,7 @@
|
||||||
|
|
||||||
- name: prevent restart from the packaging
|
- name: prevent restart from the packaging
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mds@{{ ansible_hostname }}
|
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
when: not containerized_deployment | bool
|
when: not containerized_deployment | bool
|
||||||
|
@ -618,14 +618,14 @@
|
||||||
|
|
||||||
- name: restart ceph mds
|
- name: restart ceph mds
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mds@{{ ansible_hostname }}
|
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
when: not containerized_deployment | bool
|
when: not containerized_deployment | bool
|
||||||
|
|
||||||
- name: restart active mds
|
- name: restart active mds
|
||||||
command: "{{ container_binary }} stop ceph-mds-{{ ansible_hostname }}"
|
command: "{{ container_binary }} stop ceph-mds-{{ ansible_facts['hostname'] }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@
|
||||||
|
|
||||||
- name: prevent restarts from the packaging
|
- name: prevent restarts from the packaging
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mds@{{ ansible_hostname }}
|
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
when: not containerized_deployment | bool
|
when: not containerized_deployment | bool
|
||||||
|
@ -684,7 +684,7 @@
|
||||||
|
|
||||||
- name: stop ceph rgw when upgrading from stable-3.2
|
- name: stop ceph rgw when upgrading from stable-3.2
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-radosgw@rgw.{{ ansible_hostname }}
|
name: ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -692,7 +692,7 @@
|
||||||
|
|
||||||
- name: stop ceph rgw
|
- name: stop ceph rgw
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}
|
name: ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -721,7 +721,7 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: stop ceph rbd mirror
|
- name: stop ceph rbd mirror
|
||||||
systemd:
|
systemd:
|
||||||
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -765,7 +765,7 @@
|
||||||
|
|
||||||
- name: systemd stop nfs container
|
- name: systemd stop nfs container
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}
|
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_facts['hostname']) }}
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
masked: yes
|
masked: yes
|
||||||
|
@ -899,7 +899,7 @@
|
||||||
name: ceph-facts
|
name: ceph-facts
|
||||||
|
|
||||||
- name: container | disallow pre-nautilus OSDs and enable all new nautilus-only functionality
|
- name: container | disallow pre-nautilus OSDs and enable all new nautilus-only functionality
|
||||||
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release nautilus"
|
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release nautilus"
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
when:
|
when:
|
||||||
|
@ -915,7 +915,7 @@
|
||||||
- groups.get(mon_group_name, []) | length > 0
|
- groups.get(mon_group_name, []) | length > 0
|
||||||
|
|
||||||
- name: container | enable msgr2 protocol
|
- name: container | enable msgr2 protocol
|
||||||
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} mon enable-msgr2"
|
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} mon enable-msgr2"
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
when:
|
when:
|
||||||
|
@ -1036,7 +1036,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd_status
|
- name: set_fact container_exec_cmd_status
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd_status: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
container_exec_cmd_status: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: show ceph status
|
- name: show ceph status
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd for mon0
|
- name: set_fact container_exec_cmd for mon0
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: exit playbook, if can not connect to the cluster
|
- name: exit playbook, if can not connect to the cluster
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
- name: set_fact mds_to_kill_hostname
|
- name: set_fact mds_to_kill_hostname
|
||||||
set_fact:
|
set_fact:
|
||||||
mds_to_kill_hostname: "{{ hostvars[mds_to_kill]['ansible_hostname'] }}"
|
mds_to_kill_hostname: "{{ hostvars[mds_to_kill]['ansible_facts']['hostname'] }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
# get rid of this as soon as "systemctl stop ceph-msd@$HOSTNAME" also
|
# get rid of this as soon as "systemctl stop ceph-msd@$HOSTNAME" also
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
|
|
||||||
- name: exit playbook, if can not connect to the cluster
|
- name: exit playbook, if can not connect to the cluster
|
||||||
command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} health"
|
command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} health"
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
- name: set_fact mgr_to_kill_hostname
|
- name: set_fact mgr_to_kill_hostname
|
||||||
set_fact:
|
set_fact:
|
||||||
mgr_to_kill_hostname: "{{ hostvars[mgr_to_kill]['ansible_hostname'] }}"
|
mgr_to_kill_hostname: "{{ hostvars[mgr_to_kill]['ansible_facts']['hostname'] }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: stop manager services and verify it
|
- name: stop manager services and verify it
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
- name: "set_fact container_exec_cmd build {{ container_binary }} exec command (containerized)"
|
- name: "set_fact container_exec_cmd build {{ container_binary }} exec command (containerized)"
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[mon_host]['ansible_facts']['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: exit playbook, if can not connect to the cluster
|
- name: exit playbook, if can not connect to the cluster
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
- name: set_fact mon_to_kill_hostname
|
- name: set_fact mon_to_kill_hostname
|
||||||
set_fact:
|
set_fact:
|
||||||
mon_to_kill_hostname: "{{ hostvars[mon_to_kill]['ansible_hostname'] }}"
|
mon_to_kill_hostname: "{{ hostvars[mon_to_kill]['ansible_facts']['hostname'] }}"
|
||||||
|
|
||||||
- name: stop monitor service(s)
|
- name: stop monitor service(s)
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: set_fact container_exec_cmd build docker exec command (containerized)
|
- name: set_fact container_exec_cmd build docker exec command (containerized)
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: set_fact container_run_cmd
|
- name: set_fact container_run_cmd
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
with_nested:
|
with_nested:
|
||||||
- "{{ groups.get(osd_group_name) }}"
|
- "{{ groups.get(osd_group_name) }}"
|
||||||
- "{{ osd_hosts }}"
|
- "{{ osd_hosts }}"
|
||||||
when: hostvars[item.0]['ansible_hostname'] == item.1
|
when: hostvars[item.0]['ansible_facts']['hostname'] == item.1
|
||||||
|
|
||||||
- name: get ceph-volume lvm list data
|
- name: get ceph-volume lvm list data
|
||||||
command: "{{ container_run_cmd }} lvm list --format json"
|
command: "{{ container_run_cmd }} lvm list --format json"
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
- name: set_fact container_exec_cmd for mon0
|
- name: set_fact container_exec_cmd for mon0
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
|
|
||||||
- name: exit playbook, if can not connect to the cluster
|
- name: exit playbook, if can not connect to the cluster
|
||||||
command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} service dump -f json"
|
command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} service dump -f json"
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
- name: set_fact rbdmirror_to_kill_hostname
|
- name: set_fact rbdmirror_to_kill_hostname
|
||||||
set_fact:
|
set_fact:
|
||||||
rbdmirror_to_kill_hostname: "{{ hostvars[rbdmirror_to_kill]['ansible_hostname'] }}"
|
rbdmirror_to_kill_hostname: "{{ hostvars[rbdmirror_to_kill]['ansible_facts']['hostname'] }}"
|
||||||
|
|
||||||
- name: set_fact rbdmirror_gids
|
- name: set_fact rbdmirror_gids
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd for mon0
|
- name: set_fact container_exec_cmd for mon0
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: exit playbook, if can not connect to the cluster
|
- name: exit playbook, if can not connect to the cluster
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
rgw_host: '{{ item }}'
|
rgw_host: '{{ item }}'
|
||||||
with_items: '{{ groups[rgw_group_name] }}'
|
with_items: '{{ groups[rgw_group_name] }}'
|
||||||
when: hostvars[item]['ansible_hostname'] == rgw_to_kill.split('.')[0]
|
when: hostvars[item]['ansible_facts']['hostname'] == rgw_to_kill.split('.')[0]
|
||||||
|
|
||||||
- name: stop rgw service
|
- name: stop rgw service
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
- name: stop non-containerized ceph mon
|
- name: stop non-containerized ceph mon
|
||||||
service:
|
service:
|
||||||
name: "ceph-mon@{{ ansible_hostname }}"
|
name: "ceph-mon@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
when: ldb_files.rc == 0
|
when: ldb_files.rc == 0
|
||||||
|
|
||||||
- name: copy mon initial keyring in /etc/ceph to satisfy fetch config task in ceph-container-common
|
- name: copy mon initial keyring in /etc/ceph to satisfy fetch config task in ceph-container-common
|
||||||
command: cp /var/lib/ceph/mon/{{ cluster }}-{{ ansible_hostname }}/keyring /etc/ceph/{{ cluster }}.mon.keyring
|
command: cp /var/lib/ceph/mon/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring /etc/ceph/{{ cluster }}.mon.keyring
|
||||||
args:
|
args:
|
||||||
creates: /etc/ceph/{{ cluster }}.mon.keyring
|
creates: /etc/ceph/{{ cluster }}.mon.keyring
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
@ -137,8 +137,8 @@
|
||||||
- name: waiting for the monitor to join the quorum...
|
- name: waiting for the monitor to join the quorum...
|
||||||
command: "{{ container_binary }} run --rm -v /etc/ceph:/etc/ceph:z --entrypoint=ceph {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --cluster {{ cluster }} quorum_status --format json"
|
command: "{{ container_binary }} run --rm -v /etc/ceph:/etc/ceph:z --entrypoint=ceph {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --cluster {{ cluster }} quorum_status --format json"
|
||||||
register: ceph_health_raw
|
register: ceph_health_raw
|
||||||
until: ansible_hostname in (ceph_health_raw.stdout | trim | from_json)["quorum_names"]
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
until: hostvars[mon_host]['ansible_facts']['hostname'] in (ceph_health_raw.stdout | from_json)["quorum_names"]
|
||||||
retries: "{{ health_mon_check_retries }}"
|
retries: "{{ health_mon_check_retries }}"
|
||||||
delay: "{{ health_mon_check_delay }}"
|
delay: "{{ health_mon_check_delay }}"
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@
|
||||||
# will not exist
|
# will not exist
|
||||||
- name: stop non-containerized ceph mgr(s)
|
- name: stop non-containerized ceph mgr(s)
|
||||||
service:
|
service:
|
||||||
name: "ceph-mgr@{{ ansible_hostname }}"
|
name: "ceph-mgr@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -338,14 +338,14 @@
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: get num_pgs
|
- name: get num_pgs
|
||||||
command: >
|
command: >
|
||||||
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} pg stat --format json
|
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} pg stat --format json
|
||||||
register: ceph_pgs
|
register: ceph_pgs
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: container - waiting for clean pgs...
|
- name: container - waiting for clean pgs...
|
||||||
command: >
|
command: >
|
||||||
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} pg stat --format json
|
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} pg stat --format json
|
||||||
register: ceph_health_post
|
register: ceph_health_post
|
||||||
until: >
|
until: >
|
||||||
(((ceph_health_post.stdout | from_json).pg_summary.num_pg_by_state | length) > 0)
|
(((ceph_health_post.stdout | from_json).pg_summary.num_pg_by_state | length) > 0)
|
||||||
|
@ -393,7 +393,7 @@
|
||||||
|
|
||||||
- name: stop non-containerized ceph mds(s)
|
- name: stop non-containerized ceph mds(s)
|
||||||
service:
|
service:
|
||||||
name: "ceph-mds@{{ ansible_hostname }}"
|
name: "ceph-mds@{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: stop non-containerized ceph rgw(s)
|
- name: stop non-containerized ceph rgw(s)
|
||||||
service:
|
service:
|
||||||
name: "ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
|
name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
with_items: "{{ rgw_instances }}"
|
with_items: "{{ rgw_instances }}"
|
||||||
|
@ -506,7 +506,7 @@
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: stop non-containerized ceph rbd mirror(s)
|
- name: stop non-containerized ceph rbd mirror(s)
|
||||||
service:
|
service:
|
||||||
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_facts['hostname'] }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
|
|
||||||
|
|
|
@ -19,31 +19,31 @@
|
||||||
|
|
||||||
- name: Check if the node has be migrated already
|
- name: Check if the node has be migrated already
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/migration_completed
|
path=/var/lib/ceph/mon/ceph-{{ ansible_facts['hostname'] }}/migration_completed
|
||||||
register: migration_completed
|
register: migration_completed
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Check for failed run
|
- name: Check for failed run
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/{{ ansible_hostname }}.tar
|
path=/var/lib/ceph/{{ ansible_facts['hostname'] }}.tar
|
||||||
register: mon_archive_leftover
|
register: mon_archive_leftover
|
||||||
|
|
||||||
- fail: msg="Looks like an archive is already there, please remove it!"
|
- fail: msg="Looks like an archive is already there, please remove it!"
|
||||||
when: migration_completed.stat.exists == False and mon_archive_leftover.stat.exists == True
|
when: migration_completed.stat.exists == False and mon_archive_leftover.stat.exists == True
|
||||||
|
|
||||||
- name: Compress the store as much as possible
|
- name: Compress the store as much as possible
|
||||||
command: ceph tell mon.{{ ansible_hostname }} compact
|
command: ceph tell mon.{{ ansible_facts['hostname'] }} compact
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Check if sysvinit
|
- name: Check if sysvinit
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/sysvinit
|
path=/var/lib/ceph/mon/ceph-{{ ansible_facts['hostname'] }}/sysvinit
|
||||||
register: monsysvinit
|
register: monsysvinit
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: Check if upstart
|
- name: Check if upstart
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/upstart
|
path=/var/lib/ceph/mon/ceph-{{ ansible_facts['hostname'] }}/upstart
|
||||||
register: monupstart
|
register: monupstart
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
service: >
|
service: >
|
||||||
name=ceph-mon
|
name=ceph-mon
|
||||||
state=restarted
|
state=restarted
|
||||||
args=id={{ ansible_hostname }}
|
args=id={{ ansible_facts['hostname'] }}
|
||||||
when: monupstart.stat.exists == True and migration_completed.stat.exists == False
|
when: monupstart.stat.exists == True and migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Restart the Monitor after compaction (Sysvinit)
|
- name: Restart the Monitor after compaction (Sysvinit)
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
service: >
|
service: >
|
||||||
name=ceph-mon
|
name=ceph-mon
|
||||||
state=stopped
|
state=stopped
|
||||||
args=id={{ ansible_hostname }}
|
args=id={{ ansible_facts['hostname'] }}
|
||||||
when: monupstart.stat.exists == True and migration_completed.stat.exists == False
|
when: monupstart.stat.exists == True and migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Stop the monitor (Sysvinit)
|
- name: Stop the monitor (Sysvinit)
|
||||||
|
@ -125,15 +125,15 @@
|
||||||
# NOTE (leseb): should we convert upstart to sysvinit here already?
|
# NOTE (leseb): should we convert upstart to sysvinit here already?
|
||||||
- name: Archive monitor stores
|
- name: Archive monitor stores
|
||||||
shell: >
|
shell: >
|
||||||
tar -cpvzf - --one-file-system . /etc/ceph/* | cat > {{ ansible_hostname }}.tar
|
tar -cpvzf - --one-file-system . /etc/ceph/* | cat > {{ ansible_facts['hostname'] }}.tar
|
||||||
chdir=/var/lib/ceph/
|
chdir=/var/lib/ceph/
|
||||||
creates={{ ansible_hostname }}.tar
|
creates={{ ansible_facts['hostname'] }}.tar
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Scp the Monitor store
|
- name: Scp the Monitor store
|
||||||
fetch: >
|
fetch: >
|
||||||
src=/var/lib/ceph/{{ ansible_hostname }}.tar
|
src=/var/lib/ceph/{{ ansible_facts['hostname'] }}.tar
|
||||||
dest={{ backup_dir }}/monitors-backups/{{ ansible_hostname }}.tar
|
dest={{ backup_dir }}/monitors-backups/{{ ansible_facts['hostname'] }}.tar
|
||||||
flat=yes
|
flat=yes
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
|
||||||
|
@ -155,13 +155,13 @@
|
||||||
|
|
||||||
- name: Check if sysvinit
|
- name: Check if sysvinit
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/sysvinit
|
path=/var/lib/ceph/mon/ceph-{{ ansible_facts['hostname'] }}/sysvinit
|
||||||
register: monsysvinit
|
register: monsysvinit
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: Check if upstart
|
- name: Check if upstart
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/upstart
|
path=/var/lib/ceph/mon/ceph-{{ ansible_facts['hostname'] }}/upstart
|
||||||
register: monupstart
|
register: monupstart
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
service: >
|
service: >
|
||||||
name=ceph-mon
|
name=ceph-mon
|
||||||
state=stopped
|
state=stopped
|
||||||
args=id={{ ansible_hostname }}
|
args=id={{ ansible_facts['hostname'] }}
|
||||||
when: monupstart.stat.exists == True and migration_completed.stat.exists == False
|
when: monupstart.stat.exists == True and migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Make sure the monitor is stopped (Sysvinit)
|
- name: Make sure the monitor is stopped (Sysvinit)
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
# NOTE (leseb): 'creates' was added in Ansible 1.6
|
# NOTE (leseb): 'creates' was added in Ansible 1.6
|
||||||
- name: Copy and unarchive the monitor store
|
- name: Copy and unarchive the monitor store
|
||||||
unarchive: >
|
unarchive: >
|
||||||
src={{ backup_dir }}/monitors-backups/{{ ansible_hostname }}.tar
|
src={{ backup_dir }}/monitors-backups/{{ ansible_facts['hostname'] }}.tar
|
||||||
dest=/var/lib/ceph/
|
dest=/var/lib/ceph/
|
||||||
copy=yes
|
copy=yes
|
||||||
mode=0600
|
mode=0600
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
|
|
||||||
- name: Waiting for the monitor to join the quorum...
|
- name: Waiting for the monitor to join the quorum...
|
||||||
shell: >
|
shell: >
|
||||||
ceph -s | grep monmap | sed 's/.*quorum//' | egrep -q {{ ansible_hostname }}
|
ceph -s | grep monmap | sed 's/.*quorum//' | egrep -q {{ ansible_facts['hostname'] }}
|
||||||
register: result
|
register: result
|
||||||
until: result.rc == 0
|
until: result.rc == 0
|
||||||
retries: 5
|
retries: 5
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
|
|
||||||
- name: Done moving to the next monitor
|
- name: Done moving to the next monitor
|
||||||
file: >
|
file: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/migration_completed
|
path=/var/lib/ceph/mon/ceph-{{ ansible_facts['hostname'] }}/migration_completed
|
||||||
state=touch
|
state=touch
|
||||||
owner=root
|
owner=root
|
||||||
group=root
|
group=root
|
||||||
|
@ -252,7 +252,7 @@
|
||||||
|
|
||||||
- name: Check for failed run
|
- name: Check for failed run
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/{{ ansible_hostname }}.tar
|
path=/var/lib/ceph/{{ ansible_facts['hostname'] }}.tar
|
||||||
register: osd_archive_leftover
|
register: osd_archive_leftover
|
||||||
|
|
||||||
- fail: msg="Looks like an archive is already there, please remove it!"
|
- fail: msg="Looks like an archive is already there, please remove it!"
|
||||||
|
@ -297,9 +297,9 @@
|
||||||
|
|
||||||
- name: Archive ceph configs
|
- name: Archive ceph configs
|
||||||
shell: >
|
shell: >
|
||||||
tar -cpvzf - --one-file-system . /etc/ceph/ceph.conf | cat > {{ ansible_hostname }}.tar
|
tar -cpvzf - --one-file-system . /etc/ceph/ceph.conf | cat > {{ ansible_facts['hostname'] }}.tar
|
||||||
chdir=/var/lib/ceph/
|
chdir=/var/lib/ceph/
|
||||||
creates={{ ansible_hostname }}.tar
|
creates={{ ansible_facts['hostname'] }}.tar
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Create backup directory
|
- name: Create backup directory
|
||||||
|
@ -315,7 +315,7 @@
|
||||||
|
|
||||||
- name: Scp OSDs dirs and configs
|
- name: Scp OSDs dirs and configs
|
||||||
fetch: >
|
fetch: >
|
||||||
src=/var/lib/ceph/{{ ansible_hostname }}.tar
|
src=/var/lib/ceph/{{ ansible_facts['hostname'] }}.tar
|
||||||
dest={{ backup_dir }}/osds-backups/
|
dest={{ backup_dir }}/osds-backups/
|
||||||
flat=yes
|
flat=yes
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
@ -371,7 +371,7 @@
|
||||||
# NOTE (leseb): 'creates' was added in Ansible 1.6
|
# NOTE (leseb): 'creates' was added in Ansible 1.6
|
||||||
- name: Copy and unarchive the OSD configs
|
- name: Copy and unarchive the OSD configs
|
||||||
unarchive: >
|
unarchive: >
|
||||||
src={{ backup_dir }}/osds-backups/{{ ansible_hostname }}.tar
|
src={{ backup_dir }}/osds-backups/{{ ansible_facts['hostname'] }}.tar
|
||||||
dest=/var/lib/ceph/
|
dest=/var/lib/ceph/
|
||||||
copy=yes
|
copy=yes
|
||||||
mode=0600
|
mode=0600
|
||||||
|
@ -446,7 +446,7 @@
|
||||||
|
|
||||||
- name: Check for failed run
|
- name: Check for failed run
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/{{ ansible_hostname }}.tar
|
path=/var/lib/ceph/{{ ansible_facts['hostname'] }}.tar
|
||||||
register: rgw_archive_leftover
|
register: rgw_archive_leftover
|
||||||
|
|
||||||
- fail: msg="Looks like an archive is already there, please remove it!"
|
- fail: msg="Looks like an archive is already there, please remove it!"
|
||||||
|
@ -454,9 +454,9 @@
|
||||||
|
|
||||||
- name: Archive rados gateway configs
|
- name: Archive rados gateway configs
|
||||||
shell: >
|
shell: >
|
||||||
tar -cpvzf - --one-file-system . /etc/ceph/* | cat > {{ ansible_hostname }}.tar
|
tar -cpvzf - --one-file-system . /etc/ceph/* | cat > {{ ansible_facts['hostname'] }}.tar
|
||||||
chdir=/var/lib/ceph/
|
chdir=/var/lib/ceph/
|
||||||
creates={{ ansible_hostname }}.tar
|
creates={{ ansible_facts['hostname'] }}.tar
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
|
||||||
- name: Create backup directory
|
- name: Create backup directory
|
||||||
|
@ -472,7 +472,7 @@
|
||||||
|
|
||||||
- name: Scp RGWs dirs and configs
|
- name: Scp RGWs dirs and configs
|
||||||
fetch: >
|
fetch: >
|
||||||
src=/var/lib/ceph/{{ ansible_hostname }}.tar
|
src=/var/lib/ceph/{{ ansible_facts['hostname'] }}.tar
|
||||||
dest={{ backup_dir }}/rgws-backups/
|
dest={{ backup_dir }}/rgws-backups/
|
||||||
flat=yes
|
flat=yes
|
||||||
when: migration_completed.stat.exists == False
|
when: migration_completed.stat.exists == False
|
||||||
|
@ -512,7 +512,7 @@
|
||||||
# NOTE (leseb): 'creates' was added in Ansible 1.6
|
# NOTE (leseb): 'creates' was added in Ansible 1.6
|
||||||
- name: Copy and unarchive the OSD configs
|
- name: Copy and unarchive the OSD configs
|
||||||
unarchive: >
|
unarchive: >
|
||||||
src={{ backup_dir }}/rgws-backups/{{ ansible_hostname }}.tar
|
src={{ backup_dir }}/rgws-backups/{{ ansible_facts['hostname'] }}.tar
|
||||||
dest=/var/lib/ceph/
|
dest=/var/lib/ceph/
|
||||||
copy=yes
|
copy=yes
|
||||||
mode=0600
|
mode=0600
|
||||||
|
|
|
@ -35,13 +35,13 @@
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "host_vars/{{ ansible_hostname }}.yml"
|
- "host_vars/{{ ansible_facts['hostname'] }}.yml"
|
||||||
- "host_vars/default.yml"
|
- "host_vars/default.yml"
|
||||||
skip: true
|
skip: true
|
||||||
|
|
||||||
- name: exit playbook, if devices not defined
|
- name: exit playbook, if devices not defined
|
||||||
fail:
|
fail:
|
||||||
msg: "devices must be define in host_vars/default.yml or host_vars/{{ ansible_hostname }}.yml"
|
msg: "devices must be define in host_vars/default.yml or host_vars/{{ ansible_facts['hostname'] }}.yml"
|
||||||
when: devices is not defined
|
when: devices is not defined
|
||||||
|
|
||||||
- name: install sgdisk(gdisk)
|
- name: install sgdisk(gdisk)
|
||||||
|
@ -67,12 +67,12 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
owner: 167
|
owner: 167
|
||||||
group: 167
|
group: 167
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_facts['os_family'] == "RedHat"
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
owner: 64045
|
owner: 64045
|
||||||
group: 64045
|
group: 64045
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_facts['os_family'] == "Debian"
|
||||||
|
|
||||||
- name: change partitions ownership
|
- name: change partitions ownership
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
post_tasks:
|
post_tasks:
|
||||||
- name: set_fact container_exec_cmd build docker exec command (containerized)
|
- name: set_fact container_exec_cmd build docker exec command (containerized)
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
container_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: exit playbook, if can not connect to the cluster
|
- name: exit playbook, if can not connect to the cluster
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
ceph_conf_overrides:
|
ceph_conf_overrides:
|
||||||
"client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}":
|
"client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
|
||||||
"rgw keystone api version": "2"
|
"rgw keystone api version": "2"
|
||||||
"rgw keystone url": "http://192.168.0.1:35357"
|
"rgw keystone url": "http://192.168.0.1:35357"
|
||||||
"rgw keystone admin token": "password"
|
"rgw keystone admin token": "password"
|
||||||
|
@ -16,7 +16,7 @@ ceph_conf_overrides:
|
||||||
"rgw keystone token cache size": "10000"
|
"rgw keystone token cache size": "10000"
|
||||||
"rgw keystone revocation interval": "900"
|
"rgw keystone revocation interval": "900"
|
||||||
"rgw s3 auth use keystone": "true"
|
"rgw s3 auth use keystone": "true"
|
||||||
"nss db path": "/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_hostname }}/nss"
|
"nss db path": "/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_facts['hostname'] }}/nss"
|
||||||
|
|
||||||
|
|
||||||
# NOTE (leseb): to authentivate with Keystone you have two options:
|
# NOTE (leseb): to authentivate with Keystone you have two options:
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
ceph_conf_overrides:
|
ceph_conf_overrides:
|
||||||
"client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}":
|
"client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
|
||||||
"rgw keystone api version": "3"
|
"rgw keystone api version": "3"
|
||||||
"rgw keystone url": "http://192.168.0.1:35357"
|
"rgw keystone url": "http://192.168.0.1:35357"
|
||||||
"rgw keystone admin token": "password"
|
"rgw keystone admin token": "password"
|
||||||
|
@ -17,7 +17,7 @@ ceph_conf_overrides:
|
||||||
"rgw keystone token cache size": "10000"
|
"rgw keystone token cache size": "10000"
|
||||||
"rgw keystone revocation interval": "900"
|
"rgw keystone revocation interval": "900"
|
||||||
"rgw s3 auth use keystone": "true"
|
"rgw s3 auth use keystone": "true"
|
||||||
"nss db path": "/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_hostname }}/nss"
|
"nss db path": "/var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_facts['hostname'] }}/nss"
|
||||||
|
|
||||||
|
|
||||||
# NOTE (leseb): to authentivate with Keystone you have two options:
|
# NOTE (leseb): to authentivate with Keystone you have two options:
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
# The double quotes are important, do NOT remove them.
|
# The double quotes are important, do NOT remove them.
|
||||||
|
|
||||||
ceph_conf_overrides:
|
ceph_conf_overrides:
|
||||||
"client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}":
|
"client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
|
||||||
rgw enable static website = true
|
rgw enable static website = true
|
||||||
rgw dns s3website name = objects-website-region.domain.com
|
rgw dns s3website name = objects-website-region.domain.com
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# The double quotes are important, do NOT remove them.
|
# The double quotes are important, do NOT remove them.
|
||||||
|
|
||||||
ceph_conf_overrides:
|
ceph_conf_overrides:
|
||||||
"client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}":
|
"client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}":
|
||||||
rgw enable usage log = true
|
rgw enable usage log = true
|
||||||
rgw usage log tick interval = 30
|
rgw usage log tick interval = 30
|
||||||
rgw usage log flush threshold = 1024
|
rgw usage log flush threshold = 1024
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
groups: _filtered_clients
|
groups: _filtered_clients
|
||||||
with_items: "{{ groups[client_group_name] | intersect(ansible_play_batch) }}"
|
with_items: "{{ groups[client_group_name] | intersect(ansible_play_batch) }}"
|
||||||
when: (hostvars[item]['ansible_architecture'] == 'x86_64') or (not containerized_deployment | bool)
|
when: (hostvars[item]['ansible_facts']['architecture'] == 'x86_64') or (not containerized_deployment | bool)
|
||||||
|
|
||||||
- name: set_fact delegated_node
|
- name: set_fact delegated_node
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
create: yes
|
create: yes
|
||||||
line: "CLUSTER={{ cluster }}"
|
line: "CLUSTER={{ cluster }}"
|
||||||
regexp: "^CLUSTER="
|
regexp: "^CLUSTER="
|
||||||
when: ansible_os_family in ["RedHat", "Suse"]
|
when: ansible_facts['os_family'] in ["RedHat", "Suse"]
|
||||||
|
|
||||||
# NOTE(leseb): we are performing the following check
|
# NOTE(leseb): we are performing the following check
|
||||||
# to ensure any Jewel installation will not fail.
|
# to ensure any Jewel installation will not fail.
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
# - All previous versions from Canonical
|
# - All previous versions from Canonical
|
||||||
# - Infernalis from ceph.com
|
# - Infernalis from ceph.com
|
||||||
- name: debian based systems - configure cluster name
|
- name: debian based systems - configure cluster name
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_facts['os_family'] == "Debian"
|
||||||
block:
|
block:
|
||||||
- name: check /etc/default/ceph exist
|
- name: check /etc/default/ceph exist
|
||||||
stat:
|
stat:
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
|
regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
|
||||||
line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
|
line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Debian'
|
- ansible_facts['os_family'] == 'Debian'
|
||||||
- etc_default_ceph.stat.exists
|
- etc_default_ceph.stat.exists
|
||||||
notify: restart ceph osds
|
notify: restart ceph osds
|
||||||
|
|
||||||
|
@ -18,5 +18,5 @@
|
||||||
create: yes
|
create: yes
|
||||||
regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
|
regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
|
||||||
line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
|
line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_facts['os_family'] == 'RedHat'
|
||||||
notify: restart ceph osds
|
notify: restart ceph osds
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: no
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: ansible_pkg_mgr == 'yum'
|
when: ansible_facts['pkg_mgr'] == 'yum'
|
||||||
|
|
|
@ -15,6 +15,6 @@
|
||||||
|
|
||||||
- name: configure debian ceph stable community repository
|
- name: configure debian ceph stable community repository
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_distribution_release) }} main"
|
repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_facts['distribution_release']) }} main"
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
- name: configure debian custom repository
|
- name: configure debian custom repository
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "deb {{ ceph_custom_repo }} {{ ansible_distribution_release }} main"
|
repo: "deb {{ ceph_custom_repo }} {{ ansible_facts['distribution_release'] }} main"
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: fetch ceph debian development repository
|
- name: fetch ceph debian development repository
|
||||||
uri:
|
uri:
|
||||||
url: https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_release }}/repo
|
url: https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_facts['distribution'] | lower }}/{{ ansible_facts['distribution_release'] }}/repo
|
||||||
return_content: yes
|
return_content: yes
|
||||||
register: ceph_dev_deb_repo
|
register: ceph_dev_deb_repo
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
name: "{{ debian_ceph_pkgs | unique }}"
|
name: "{{ debian_ceph_pkgs | unique }}"
|
||||||
update_cache: no
|
update_cache: no
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}"
|
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_facts['distribution_release'] ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: ansible_distribution == 'RedHat'
|
when: ansible_facts['distribution'] == 'RedHat'
|
||||||
|
|
||||||
- name: install centos dependencies
|
- name: install centos dependencies
|
||||||
yum:
|
yum:
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: ansible_distribution == 'CentOS'
|
when: ansible_facts['distribution'] == 'CentOS'
|
||||||
|
|
||||||
- name: install redhat ceph packages
|
- name: install redhat ceph packages
|
||||||
package:
|
package:
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: "rhcs {{ ceph_rhcs_version }} on rhel 8"
|
- name: "rhcs {{ ceph_rhcs_version }} on rhel 8"
|
||||||
when: ansible_distribution_major_version | int == 8
|
when: ansible_facts['distribution_major_version'] | int == 8
|
||||||
block:
|
block:
|
||||||
- name: enable red hat storage monitor repository
|
- name: enable red hat storage monitor repository
|
||||||
rhsm_repository:
|
rhsm_repository:
|
||||||
name: "rhceph-{{ ceph_rhcs_version }}-mon-for-rhel-8-{{ ansible_architecture }}-rpms"
|
name: "rhceph-{{ ceph_rhcs_version }}-mon-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms"
|
||||||
when: (mon_group_name in group_names or mgr_group_name in group_names)
|
when: (mon_group_name in group_names or mgr_group_name in group_names)
|
||||||
|
|
||||||
- name: enable red hat storage osd repository
|
- name: enable red hat storage osd repository
|
||||||
rhsm_repository:
|
rhsm_repository:
|
||||||
name: "rhceph-{{ ceph_rhcs_version }}-osd-for-rhel-8-{{ ansible_architecture }}-rpms"
|
name: "rhceph-{{ ceph_rhcs_version }}-osd-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms"
|
||||||
when: osd_group_name in group_names
|
when: osd_group_name in group_names
|
||||||
|
|
||||||
- name: enable red hat storage tools repository
|
- name: enable red hat storage tools repository
|
||||||
rhsm_repository:
|
rhsm_repository:
|
||||||
name: "rhceph-{{ ceph_rhcs_version }}-tools-for-rhel-8-{{ ansible_architecture }}-rpms"
|
name: "rhceph-{{ ceph_rhcs_version }}-tools-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms"
|
||||||
when: (mgr_group_name in group_names or rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names or iscsi_gw_group_name in group_names or client_group_name in group_names or monitoring_group_name in group_names)
|
when: (mgr_group_name in group_names or rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names or iscsi_gw_group_name in group_names or client_group_name in group_names or monitoring_group_name in group_names)
|
||||||
|
|
||||||
- name: "rhcs {{ ceph_rhcs_version }} on rhel 7"
|
- name: "rhcs {{ ceph_rhcs_version }} on rhel 7"
|
||||||
when: ansible_distribution_major_version | int == 7
|
when: ansible_facts['distribution_major_version'] | int == 7
|
||||||
block:
|
block:
|
||||||
- name: enable red hat storage monitor repository
|
- name: enable red hat storage monitor repository
|
||||||
rhsm_repository:
|
rhsm_repository:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
tags: with_pkg
|
tags: with_pkg
|
||||||
when: ansible_distribution_major_version | int == 7
|
when: ansible_facts['distribution_major_version'] | int == 7
|
||||||
|
|
||||||
- name: configure red hat ceph community repository stable key
|
- name: configure red hat ceph community repository stable key
|
||||||
rpm_key:
|
rpm_key:
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
gpgcheck: yes
|
gpgcheck: yes
|
||||||
state: present
|
state: present
|
||||||
gpgkey: "{{ ceph_stable_key }}"
|
gpgkey: "{{ ceph_stable_key }}"
|
||||||
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_distribution_major_version }}/$basearch"
|
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_facts['distribution_major_version'] }}/$basearch"
|
||||||
file: ceph_stable
|
file: ceph_stable
|
||||||
priority: 2
|
priority: 2
|
||||||
register: result
|
register: result
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
gpgcheck: yes
|
gpgcheck: yes
|
||||||
state: present
|
state: present
|
||||||
gpgkey: "{{ ceph_stable_key }}"
|
gpgkey: "{{ ceph_stable_key }}"
|
||||||
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_distribution_major_version }}/noarch"
|
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_facts['distribution_major_version'] }}/noarch"
|
||||||
file: ceph_stable
|
file: ceph_stable
|
||||||
priority: 2
|
priority: 2
|
||||||
register: result
|
register: result
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: get latest available build
|
- name: get latest available build
|
||||||
uri:
|
uri:
|
||||||
url: "https://shaman.ceph.com/api/search/?status=ready&project=ceph&flavor=default&distros=centos/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}&ref={{ ceph_dev_branch }}&sha1={{ ceph_dev_sha1 }}"
|
url: "https://shaman.ceph.com/api/search/?status=ready&project=ceph&flavor=default&distros=centos/{{ ansible_facts['distribution_major_version'] }}/{{ ansible_facts['architecture'] }}&ref={{ ceph_dev_branch }}&sha1={{ ceph_dev_sha1 }}"
|
||||||
return_content: yes
|
return_content: yes
|
||||||
run_once: true
|
run_once: true
|
||||||
register: latest_build
|
register: latest_build
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
---
|
---
|
||||||
- name: include_tasks installs/install_on_redhat.yml
|
- name: include_tasks installs/install_on_redhat.yml
|
||||||
include_tasks: installs/install_on_redhat.yml
|
include_tasks: installs/install_on_redhat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_facts['os_family'] == 'RedHat'
|
||||||
tags: package-install
|
tags: package-install
|
||||||
|
|
||||||
- name: include_tasks installs/install_on_suse.yml
|
- name: include_tasks installs/install_on_suse.yml
|
||||||
include_tasks: installs/install_on_suse.yml
|
include_tasks: installs/install_on_suse.yml
|
||||||
when: ansible_os_family == 'Suse'
|
when: ansible_facts['os_family'] == 'Suse'
|
||||||
tags: package-install
|
tags: package-install
|
||||||
|
|
||||||
- name: include installs/install_on_debian.yml
|
- name: include installs/install_on_debian.yml
|
||||||
include_tasks: installs/install_on_debian.yml
|
include_tasks: installs/install_on_debian.yml
|
||||||
tags: package-install
|
tags: package-install
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: include_tasks installs/install_on_clear.yml
|
- name: include_tasks installs/install_on_clear.yml
|
||||||
include_tasks: installs/install_on_clear.yml
|
include_tasks: installs/install_on_clear.yml
|
||||||
when: ansible_os_family == 'ClearLinux'
|
when: ansible_facts['os_family'] == 'ClearLinux'
|
||||||
tags: package-install
|
tags: package-install
|
||||||
|
|
||||||
- name: get ceph version
|
- name: get ceph version
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: create rados gateway instance directories
|
- name: create rados gateway instance directories
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
|
path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
- name: generate environment file
|
- name: generate environment file
|
||||||
copy:
|
copy:
|
||||||
dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/EnvironmentFile"
|
dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}/EnvironmentFile"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
group: "root"
|
group: "root"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
|
@ -24,10 +24,10 @@ osd crush chooseleaf type = 0
|
||||||
|
|
||||||
{% if nb_mon > 0 and inventory_hostname in groups.get(mon_group_name, []) %}
|
{% if nb_mon > 0 and inventory_hostname in groups.get(mon_group_name, []) %}
|
||||||
mon initial members = {% for host in groups[mon_group_name] %}
|
mon initial members = {% for host in groups[mon_group_name] %}
|
||||||
{% if hostvars[host]['ansible_fqdn'] is defined and mon_use_fqdn -%}
|
{% if hostvars[host]['ansible_facts']['fqdn'] is defined and mon_use_fqdn -%}
|
||||||
{{ hostvars[host]['ansible_fqdn'] }}
|
{{ hostvars[host]['ansible_facts']['fqdn'] }}
|
||||||
{%- elif hostvars[host]['ansible_hostname'] is defined -%}
|
{%- elif hostvars[host]['ansible_facts']['hostname'] is defined -%}
|
||||||
{{ hostvars[host]['ansible_hostname'] }}
|
{{ hostvars[host]['ansible_facts']['hostname'] }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if not loop.last %},{% endif %}
|
{%- if not loop.last %},{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -92,13 +92,13 @@ filestore xattr use omap = true
|
||||||
[osd]
|
[osd]
|
||||||
{% if is_hci | bool and _num_osds > 0 %}
|
{% if is_hci | bool and _num_osds > 0 %}
|
||||||
{# hci_safety_factor is the safety factor for HCI deployments #}
|
{# hci_safety_factor is the safety factor for HCI deployments #}
|
||||||
{% if ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds > osd_memory_target %}
|
{% if ansible_facts['memtotal_mb'] * 1048576 * hci_safety_factor / _num_osds > osd_memory_target %}
|
||||||
{% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds) | int %}
|
{% set _osd_memory_target = (ansible_facts['memtotal_mb'] * 1048576 * hci_safety_factor / _num_osds) | int %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif _num_osds > 0 %}
|
{% elif _num_osds > 0 %}
|
||||||
{# non_hci_safety_factor is the safety factor for dedicated nodes #}
|
{# non_hci_safety_factor is the safety factor for dedicated nodes #}
|
||||||
{% if ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds > osd_memory_target %}
|
{% if ansible_facts['memtotal_mb'] * 1048576 * non_hci_safety_factor / _num_osds > osd_memory_target %}
|
||||||
{% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds) | int %}
|
{% set _osd_memory_target = (ansible_facts['memtotal_mb'] * 1048576 * non_hci_safety_factor / _num_osds) | int %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
|
osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
|
||||||
|
@ -106,14 +106,14 @@ osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if inventory_hostname in groups.get(rgw_group_name, []) %}
|
{% if inventory_hostname in groups.get(rgw_group_name, []) %}
|
||||||
{% set _rgw_hostname = hostvars[inventory_hostname]['rgw_hostname'] | default(hostvars[inventory_hostname]['ansible_hostname']) %}
|
{% set _rgw_hostname = hostvars[inventory_hostname]['rgw_hostname'] | default(hostvars[inventory_hostname]['ansible_facts']['hostname']) %}
|
||||||
{# {{ hostvars[host]['rgw_hostname'] }} for backward compatibility, fqdn issues. See bz1580408 #}
|
{# {{ hostvars[host]['rgw_hostname'] }} for backward compatibility, fqdn issues. See bz1580408 #}
|
||||||
{% if hostvars[inventory_hostname]['rgw_instances'] is defined %}
|
{% if hostvars[inventory_hostname]['rgw_instances'] is defined %}
|
||||||
{% for instance in hostvars[inventory_hostname]['rgw_instances'] %}
|
{% for instance in hostvars[inventory_hostname]['rgw_instances'] %}
|
||||||
[client.rgw.{{ _rgw_hostname + '.' + instance['instance_name'] }}]
|
[client.rgw.{{ _rgw_hostname + '.' + instance['instance_name'] }}]
|
||||||
host = {{ _rgw_hostname }}
|
host = {{ _rgw_hostname }}
|
||||||
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ _rgw_hostname + '.' + instance['instance_name'] }}/keyring
|
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ _rgw_hostname + '.' + instance['instance_name'] }}/keyring
|
||||||
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[inventory_hostname]['ansible_hostname'] + '.' + instance['instance_name'] }}.log
|
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] + '.' + instance['instance_name'] }}.log
|
||||||
{% set _rgw_binding_socket = instance['radosgw_address'] | default(_radosgw_address) | string + ':' + instance['radosgw_frontend_port'] | default(radosgw_frontend_port) | string %}
|
{% set _rgw_binding_socket = instance['radosgw_address'] | default(_radosgw_address) | string + ':' + instance['radosgw_frontend_port'] | default(radosgw_frontend_port) | string %}
|
||||||
{%- macro frontend_line(frontend_type) -%}
|
{%- macro frontend_line(frontend_type) -%}
|
||||||
{%- if frontend_type == 'civetweb' -%}
|
{%- if frontend_type == 'civetweb' -%}
|
||||||
|
@ -139,12 +139,12 @@ rgw_zone = {{ instance['rgw_zone'] }}
|
||||||
|
|
||||||
{% if inventory_hostname in groups.get(nfs_group_name, []) and inventory_hostname not in groups.get(rgw_group_name, []) %}
|
{% if inventory_hostname in groups.get(nfs_group_name, []) and inventory_hostname not in groups.get(rgw_group_name, []) %}
|
||||||
{% for host in groups[nfs_group_name] %}
|
{% for host in groups[nfs_group_name] %}
|
||||||
{% set _rgw_hostname = hostvars[host]['rgw_hostname'] | default(hostvars[host]['ansible_hostname']) %}
|
{% set _rgw_hostname = hostvars[host]['rgw_hostname'] | default(hostvars[host]['ansible_facts']['hostname']) %}
|
||||||
{% if nfs_obj_gw %}
|
{% if nfs_obj_gw | bool %}
|
||||||
[client.rgw.{{ _rgw_hostname }}]
|
[client.rgw.{{ _rgw_hostname }}]
|
||||||
host = {{ _rgw_hostname }}
|
host = {{ _rgw_hostname }}
|
||||||
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ _rgw_hostname }}/keyring
|
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ _rgw_hostname }}/keyring
|
||||||
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
|
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_facts']['hostname'] }}.log
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
|
|
||||||
- name: add docker's gpg key
|
- name: add docker's gpg key
|
||||||
apt_key:
|
apt_key:
|
||||||
url: 'https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg'
|
url: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: container_package_name == 'docker-ce'
|
when: container_package_name == 'docker-ce'
|
||||||
|
|
||||||
- name: add docker repository
|
- name: add docker repository
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "deb https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
|
repo: "deb https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] }} stable"
|
||||||
when: container_package_name == 'docker-ce'
|
when: container_package_name == 'docker-ce'
|
||||||
|
|
||||||
- name: add podman ppa repository
|
- name: add podman ppa repository
|
||||||
|
@ -29,4 +29,4 @@
|
||||||
repo: "ppa:projectatomic/ppa"
|
repo: "ppa:projectatomic/ppa"
|
||||||
when:
|
when:
|
||||||
- container_package_name == 'podman'
|
- container_package_name == 'podman'
|
||||||
- ansible_distribution == 'Ubuntu'
|
- ansible_facts['distribution'] == 'Ubuntu'
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
- name: include specific variables
|
- name: include specific variables
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
|
||||||
- "{{ ansible_os_family }}.yml"
|
- "{{ ansible_facts['os_family'] }}.yml"
|
||||||
|
|
||||||
- name: debian based systems tasks
|
- name: debian based systems tasks
|
||||||
include_tasks: debian_prerequisites.yml
|
include_tasks: debian_prerequisites.yml
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Debian'
|
- ansible_facts['os_family'] == 'Debian'
|
||||||
tags: with_pkg
|
tags: with_pkg
|
||||||
|
|
||||||
# ensure extras enabled for docker
|
# ensure extras enabled for docker
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
state: present
|
state: present
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'CentOS'
|
- ansible_facts['distribution'] == 'CentOS'
|
||||||
- ceph_docker_enable_centos_extra_repo | bool
|
- ceph_docker_enable_centos_extra_repo | bool
|
||||||
tags:
|
tags:
|
||||||
with_pkg
|
with_pkg
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
- name: start the ceph-crash service
|
- name: start the ceph-crash service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ 'ceph-crash@' + ansible_hostname if containerized_deployment | bool else 'ceph-crash.service' }}"
|
name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: set_fact container_run_cmd
|
- name: set_fact container_run_cmd
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
- name: add iscsi gateways - ipv4
|
- name: add iscsi gateways - ipv4
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} dashboard iscsi-gateway-add -i -" # noqa 304
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} dashboard iscsi-gateway-add -i -" # noqa 304
|
||||||
args:
|
args:
|
||||||
stdin: "{{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
stdin: "{{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
||||||
stdin_add_newline: no
|
stdin_add_newline: no
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
|
@ -389,7 +389,7 @@
|
||||||
- dashboard_password_from_stdin | bool
|
- dashboard_password_from_stdin | bool
|
||||||
|
|
||||||
- name: add iscsi gateways - ipv4 (legacy)
|
- name: add iscsi gateways - ipv4 (legacy)
|
||||||
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-add {{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-add {{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
||||||
|
@ -401,7 +401,7 @@
|
||||||
- name: add iscsi gateways - ipv6
|
- name: add iscsi gateways - ipv6
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} dashboard iscsi-gateway-add -i -" # noqa 304
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} dashboard iscsi-gateway-add -i -" # noqa 304
|
||||||
args:
|
args:
|
||||||
stdin: "{{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
stdin: "{{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
||||||
stdin_add_newline: no
|
stdin_add_newline: no
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
|
@ -412,7 +412,7 @@
|
||||||
- dashboard_password_from_stdin | bool
|
- dashboard_password_from_stdin | bool
|
||||||
|
|
||||||
- name: add iscsi gateways - ipv6 (legacy)
|
- name: add iscsi gateways - ipv6 (legacy)
|
||||||
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-add {{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-add {{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}:{{ hostvars[item]['api_port'] | default(5000) }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: get current mgr backend - ipv4
|
- name: get current mgr backend - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
mgr_server_addr: "{{ hostvars[dashboard_backend]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
mgr_server_addr: "{{ hostvars[dashboard_backend]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
||||||
when: ip_version == 'ipv4'
|
when: ip_version == 'ipv4'
|
||||||
|
|
||||||
- name: get current mgr backend - ipv6
|
- name: get current mgr backend - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
mgr_server_addr: "{{ hostvars[dashboard_backend]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last }}"
|
mgr_server_addr: "{{ hostvars[dashboard_backend]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last }}"
|
||||||
when: ip_version == 'ipv6'
|
when: ip_version == 'ipv6'
|
||||||
|
|
||||||
- name: config the current dashboard backend
|
- name: config the current dashboard backend
|
||||||
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/{{ hostvars[dashboard_backend]['ansible_hostname'] }}/server_addr {{ mgr_server_addr }}"
|
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/{{ hostvars[dashboard_backend]['ansible_facts']['hostname'] }}/server_addr {{ mgr_server_addr }}"
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
|
|
||||||
- name: print dashboard URL
|
- name: print dashboard URL
|
||||||
debug:
|
debug:
|
||||||
msg: "The dashboard has been deployed! You can access your dashboard web UI at {{ dashboard_protocol }}://{{ ansible_fqdn }}:{{ dashboard_port }}/ as an '{{ dashboard_admin_user }}' user with '{{ dashboard_admin_password }}' password."
|
msg: "The dashboard has been deployed! You can access your dashboard web UI at {{ dashboard_protocol }}://{{ ansible_facts['fqdn'] }}:{{ dashboard_port }}/ as an '{{ dashboard_admin_user }}' user with '{{ dashboard_admin_password }}' password."
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
|
@ -72,7 +72,7 @@ debian_package_dependencies: []
|
||||||
|
|
||||||
centos_package_dependencies:
|
centos_package_dependencies:
|
||||||
- epel-release
|
- epel-release
|
||||||
- "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}"
|
- "{{ (ansible_facts['distribution_major_version'] is version('8', '>=')) | ternary('python3-libselinux', 'libselinux-python') }}"
|
||||||
|
|
||||||
redhat_package_dependencies: []
|
redhat_package_dependencies: []
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ nfs_ganesha_stable_deb_repo: "{{ ceph_mirror }}/nfs-ganesha/deb-{{ nfs_ganesha_s
|
||||||
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
|
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
|
||||||
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
|
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
|
||||||
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
|
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
|
||||||
#ceph_stable_distro_source: "{{ ansible_distribution_release }}"
|
#ceph_stable_distro_source: "{{ ansible_facts['distribution_release'] }}"
|
||||||
|
|
||||||
|
|
||||||
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 4.0)
|
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 4.0)
|
||||||
|
@ -170,7 +170,7 @@ ceph_rhcs_repository_path: "{{ ceph_stable_rh_storage_repository_path | default(
|
||||||
#
|
#
|
||||||
ceph_stable_repo_uca: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
|
ceph_stable_repo_uca: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
|
||||||
ceph_stable_openstack_release_uca: queens
|
ceph_stable_openstack_release_uca: queens
|
||||||
ceph_stable_release_uca: "{{ ansible_distribution_release }}-updates/{{ ceph_stable_openstack_release_uca }}"
|
ceph_stable_release_uca: "{{ ansible_facts['distribution_release'] }}-updates/{{ ceph_stable_openstack_release_uca }}"
|
||||||
|
|
||||||
# REPOSITORY: openSUSE OBS
|
# REPOSITORY: openSUSE OBS
|
||||||
#
|
#
|
||||||
|
@ -180,7 +180,7 @@ ceph_stable_release_uca: "{{ ansible_distribution_release }}-updates/{{ ceph_sta
|
||||||
# usually has newer Ceph releases than the normal distro repository.
|
# usually has newer Ceph releases than the normal distro repository.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/{{ ceph_stable_release }}/openSUSE_Leap_{{ ansible_distribution_version }}/"
|
ceph_obs_repo: "https://download.opensuse.org/repositories/filesystems:/ceph:/{{ ceph_stable_release }}/openSUSE_Leap_{{ ansible_facts['distribution_version'] }}/"
|
||||||
|
|
||||||
# REPOSITORY: DEV
|
# REPOSITORY: DEV
|
||||||
#
|
#
|
||||||
|
@ -243,7 +243,7 @@ generate_fsid: true
|
||||||
|
|
||||||
ceph_conf_key_directory: /etc/ceph
|
ceph_conf_key_directory: /etc/ceph
|
||||||
|
|
||||||
ceph_uid: "{{ '64045' if not containerized_deployment | bool and ansible_os_family == 'Debian' else '167' }}"
|
ceph_uid: "{{ '64045' if not containerized_deployment | bool and ansible_facts['os_family'] == 'Debian' else '167' }}"
|
||||||
|
|
||||||
# Permissions for keyring files in /etc/ceph
|
# Permissions for keyring files in /etc/ceph
|
||||||
ceph_keyring_permissions: '0600'
|
ceph_keyring_permissions: '0600'
|
||||||
|
@ -541,7 +541,7 @@ rgw_zone: default
|
||||||
# global:
|
# global:
|
||||||
# foo: 1234
|
# foo: 1234
|
||||||
# bar: 5678
|
# bar: 5678
|
||||||
# "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_hostname'] }}":
|
# "client.rgw.{{ hostvars[groups.get(rgw_group_name)[0]]['ansible_facts']['hostname'] }}":
|
||||||
# rgw_zone: zone1
|
# rgw_zone: zone1
|
||||||
#
|
#
|
||||||
ceph_conf_overrides: {}
|
ceph_conf_overrides: {}
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
|
|
||||||
- name: set_fact container_binary
|
- name: set_fact container_binary
|
||||||
set_fact:
|
set_fact:
|
||||||
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_distribution == 'Fedora') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8') else 'docker' }}"
|
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '8') else 'docker' }}"
|
|
@ -28,9 +28,9 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
ceph_release: "{{ ceph_stable_release }}"
|
ceph_release: "{{ ceph_stable_release }}"
|
||||||
|
|
||||||
- name: set_fact monitor_name ansible_hostname
|
- name: set_fact monitor_name ansible_facts['hostname']
|
||||||
set_fact:
|
set_fact:
|
||||||
monitor_name: "{{ hostvars[item]['ansible_hostname'] }}"
|
monitor_name: "{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
delegate_facts: true
|
delegate_facts: true
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
|
@ -39,9 +39,9 @@
|
||||||
- groups.get(mon_group_name, []) | length > 0
|
- groups.get(mon_group_name, []) | length > 0
|
||||||
- not mon_use_fqdn | bool
|
- not mon_use_fqdn | bool
|
||||||
|
|
||||||
- name: set_fact monitor_name ansible_fqdn
|
- name: set_fact monitor_name ansible_facts['fqdn']
|
||||||
set_fact:
|
set_fact:
|
||||||
monitor_name: "{{ hostvars[item]['ansible_fqdn'] }}"
|
monitor_name: "{{ hostvars[item]['ansible_facts']['fqdn'] }}"
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
delegate_facts: true
|
delegate_facts: true
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
|
@ -55,12 +55,12 @@
|
||||||
block:
|
block:
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if not rolling_update else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] if not rolling_update | bool else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_facts']['hostname'] }}"
|
||||||
when:
|
when:
|
||||||
- containerized_deployment | bool
|
- containerized_deployment | bool
|
||||||
|
|
||||||
- name: find a running mon container
|
- name: find a running mon container
|
||||||
command: "{{ container_binary }} ps -q --filter name=ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
|
command: "{{ container_binary }} ps -q --filter name=ceph-mon-{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
register: find_running_mon_container
|
register: find_running_mon_container
|
||||||
failed_when: false
|
failed_when: false
|
||||||
run_once: true
|
run_once: true
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
- name: set_fact _container_exec_cmd
|
- name: set_fact _container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
_container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0] if running_mon is undefined else running_mon]['ansible_hostname'] }}"
|
_container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0] if running_mon is undefined else running_mon]['ansible_facts']['hostname'] }}"
|
||||||
when:
|
when:
|
||||||
- containerized_deployment | bool
|
- containerized_deployment | bool
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
when: rolling_update or groups.get(mon_group_name, []) | length == 0
|
when: rolling_update or groups.get(mon_group_name, []) | length == 0
|
||||||
|
|
||||||
- name: get current fsid
|
- name: get current fsid
|
||||||
command: "{{ timeout_command }} {{ container_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}.asok config get fsid"
|
command: "{{ timeout_command }} {{ container_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_facts']['hostname'] }}.asok config get fsid"
|
||||||
register: rolling_update_fsid
|
register: rolling_update_fsid
|
||||||
delegate_to: "{{ mon_host | default(groups[mon_group_name][0]) }}"
|
delegate_to: "{{ mon_host | default(groups[mon_group_name][0]) }}"
|
||||||
until: rolling_update_fsid is succeeded
|
until: rolling_update_fsid is succeeded
|
||||||
|
@ -179,14 +179,14 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
fsid: "{{ cluster_uuid.stdout }}"
|
fsid: "{{ cluster_uuid.stdout }}"
|
||||||
|
|
||||||
- name: set_fact mds_name ansible_hostname
|
- name: set_fact mds_name ansible_facts['hostname']
|
||||||
set_fact:
|
set_fact:
|
||||||
mds_name: "{{ ansible_hostname }}"
|
mds_name: "{{ ansible_facts['hostname'] }}"
|
||||||
when: not mds_use_fqdn | bool
|
when: not mds_use_fqdn | bool
|
||||||
|
|
||||||
- name: set_fact mds_name ansible_fqdn
|
- name: set_fact mds_name ansible_facts['fqdn']
|
||||||
set_fact:
|
set_fact:
|
||||||
mds_name: "{{ ansible_fqdn }}"
|
mds_name: "{{ ansible_facts['fqdn'] }}"
|
||||||
when: mds_use_fqdn | bool
|
when: mds_use_fqdn | bool
|
||||||
|
|
||||||
- name: resolve device link(s)
|
- name: resolve device link(s)
|
||||||
|
@ -276,10 +276,10 @@
|
||||||
- name: set_fact devices generate device list when osd_auto_discovery
|
- name: set_fact devices generate device list when osd_auto_discovery
|
||||||
set_fact:
|
set_fact:
|
||||||
devices: "{{ (devices | default([]) + [ item.key | regex_replace('^', '/dev/') ]) | unique }}"
|
devices: "{{ (devices | default([]) + [ item.key | regex_replace('^', '/dev/') ]) | unique }}"
|
||||||
with_dict: "{{ ansible_devices }}"
|
with_dict: "{{ ansible_facts['devices'] }}"
|
||||||
when:
|
when:
|
||||||
- osd_auto_discovery | default(False) | bool
|
- osd_auto_discovery | default(False) | bool
|
||||||
- ansible_devices is defined
|
- ansible_facts['devices'] is defined
|
||||||
- item.value.removable == "0"
|
- item.value.removable == "0"
|
||||||
- item.value.sectors != "0"
|
- item.value.sectors != "0"
|
||||||
- item.value.partitions|count == 0
|
- item.value.partitions|count == 0
|
||||||
|
@ -308,9 +308,9 @@
|
||||||
|
|
||||||
- name: set_fact rgw_hostname
|
- name: set_fact rgw_hostname
|
||||||
set_fact:
|
set_fact:
|
||||||
rgw_hostname: "{% set _value = ansible_hostname -%}
|
rgw_hostname: "{% set _value = ansible_facts['hostname'] -%}
|
||||||
{% for key in (ceph_current_status['services']['rgw']['daemons'] | list) -%}
|
{% for key in (ceph_current_status['services']['rgw']['daemons'] | list) -%}
|
||||||
{% if key == ansible_fqdn -%}
|
{% if key == ansible_facts['fqdn'] -%}
|
||||||
{% set _value = key -%}
|
{% set _value = key -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
|
@ -378,24 +378,24 @@
|
||||||
- name: set ntp service name for Debian family
|
- name: set ntp service name for Debian family
|
||||||
set_fact:
|
set_fact:
|
||||||
ntp_service_name: ntp
|
ntp_service_name: ntp
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: set ntp service name for Red Hat family
|
- name: set ntp service name for Red Hat family
|
||||||
set_fact:
|
set_fact:
|
||||||
ntp_service_name: ntpd
|
ntp_service_name: ntpd
|
||||||
when: ansible_os_family in ['RedHat', 'Suse']
|
when: ansible_facts['os_family'] in ['RedHat', 'Suse']
|
||||||
|
|
||||||
- name: set chrony daemon name RedHat and Ubuntu based OSs
|
- name: set chrony daemon name RedHat and Ubuntu based OSs
|
||||||
block:
|
block:
|
||||||
- name: set chronyd daemon name for RedHat based OSs
|
- name: set chronyd daemon name for RedHat based OSs
|
||||||
set_fact:
|
set_fact:
|
||||||
chrony_daemon_name: chronyd
|
chrony_daemon_name: chronyd
|
||||||
when: ansible_os_family in ["RedHat", "Suse"]
|
when: ansible_facts['os_family'] in ["RedHat", "Suse"]
|
||||||
|
|
||||||
- name: set chronyd daemon name for Ubuntu based OSs
|
- name: set chronyd daemon name for Ubuntu based OSs
|
||||||
set_fact:
|
set_fact:
|
||||||
chrony_daemon_name: chrony
|
chrony_daemon_name: chrony
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_facts['os_family'] == "Debian"
|
||||||
|
|
||||||
- name: set_fact use_new_ceph_iscsi package or old ceph-iscsi-config/cli
|
- name: set_fact use_new_ceph_iscsi package or old ceph-iscsi-config/cli
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: set grafana_server_addr fact - ipv4
|
- name: set grafana_server_addr fact - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(grafana_server_group_name, []) | length > 0
|
||||||
- ip_version == 'ipv4'
|
- ip_version == 'ipv4'
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
- name: set grafana_server_addr fact - ipv6
|
- name: set grafana_server_addr fact - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}"
|
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(grafana_server_group_name, []) | length > 0
|
||||||
- ip_version == 'ipv6'
|
- ip_version == 'ipv6'
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
- name: set grafana_server_addrs fact - ipv4
|
- name: set grafana_server_addrs fact - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}"
|
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}"
|
||||||
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(grafana_server_group_name, []) | length > 0
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
- name: set grafana_server_addrs fact - ipv6
|
- name: set grafana_server_addrs fact - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}"
|
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}"
|
||||||
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(grafana_server_group_name, []) | length > 0
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: set_fact _monitor_address to monitor_address_block ipv4
|
- name: set_fact _monitor_address to monitor_address_block ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | first }] }}"
|
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | first }] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: set_fact _monitor_address to monitor_address_block ipv6
|
- name: set_fact _monitor_address to monitor_address_block ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | last | ipwrap }] }}"
|
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | last | ipwrap }] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
- name: set_fact _monitor_address to monitor_interface - ipv4
|
- name: set_fact _monitor_address to monitor_interface - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_' + (hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version]['address'] | ipwrap }] }}"
|
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version]['address'] | ipwrap }] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
- name: set_fact _monitor_address to monitor_interface - ipv6
|
- name: set_fact _monitor_address to monitor_interface - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_' + (hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version][0]['address'] | ipwrap }] }}"
|
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version][0]['address'] | ipwrap }] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: set_fact _radosgw_address to radosgw_address_block ipv4
|
- name: set_fact _radosgw_address to radosgw_address_block ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | first }}"
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | first }}"
|
||||||
when:
|
when:
|
||||||
- radosgw_address_block is defined
|
- radosgw_address_block is defined
|
||||||
- radosgw_address_block != 'subnet'
|
- radosgw_address_block != 'subnet'
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
- name: set_fact _radosgw_address to radosgw_address_block ipv6
|
- name: set_fact _radosgw_address to radosgw_address_block ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | last | ipwrap }}"
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | last | ipwrap }}"
|
||||||
when:
|
when:
|
||||||
- radosgw_address_block is defined
|
- radosgw_address_block is defined
|
||||||
- radosgw_address_block != 'subnet'
|
- radosgw_address_block != 'subnet'
|
||||||
|
@ -30,16 +30,16 @@
|
||||||
block:
|
block:
|
||||||
- name: set_fact _interface
|
- name: set_fact _interface
|
||||||
set_fact:
|
set_fact:
|
||||||
_interface: "{{ 'ansible_' + (radosgw_interface | replace('-', '_')) }}"
|
_interface: "{{ (radosgw_interface | replace('-', '_')) }}"
|
||||||
|
|
||||||
- name: set_fact _radosgw_address to radosgw_interface - ipv4
|
- name: set_fact _radosgw_address to radosgw_interface - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
_radosgw_address: "{{ hostvars[inventory_hostname][_interface][ip_version]['address'] }}"
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts'][_interface][ip_version]['address'] }}"
|
||||||
when: ip_version == 'ipv4'
|
when: ip_version == 'ipv4'
|
||||||
|
|
||||||
- name: set_fact _radosgw_address to radosgw_interface - ipv6
|
- name: set_fact _radosgw_address to radosgw_interface - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
_radosgw_address: "{{ hostvars[inventory_hostname][_interface][ip_version][0]['address'] | ipwrap }}"
|
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts'][_interface][ip_version][0]['address'] | ipwrap }}"
|
||||||
when: ip_version == 'ipv6'
|
when: ip_version == 'ipv6'
|
||||||
|
|
||||||
- name: set_fact rgw_instances without rgw multisite
|
- name: set_fact rgw_instances without rgw multisite
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when:
|
when:
|
||||||
- not containerized_deployment | bool
|
- not containerized_deployment | bool
|
||||||
- ansible_os_family in ['RedHat', 'Suse']
|
- ansible_facts['os_family'] in ['RedHat', 'Suse']
|
||||||
tags: package-install
|
tags: package-install
|
||||||
|
|
||||||
- name: make sure grafana is down
|
- name: make sure grafana is down
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
with_items: "{{ grafana_dashboard_files }}"
|
with_items: "{{ grafana_dashboard_files }}"
|
||||||
when:
|
when:
|
||||||
- not containerized_deployment | bool
|
- not containerized_deployment | bool
|
||||||
- not ansible_os_family in ['RedHat', 'Suse']
|
- not ansible_facts['os_family'] in ['RedHat', 'Suse']
|
||||||
|
|
||||||
- name: write grafana.ini
|
- name: write grafana.ini
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -18,7 +18,7 @@ org_role = Viewer
|
||||||
[server]
|
[server]
|
||||||
cert_file = /etc/grafana/ceph-dashboard.crt
|
cert_file = /etc/grafana/ceph-dashboard.crt
|
||||||
cert_key = /etc/grafana/ceph-dashboard.key
|
cert_key = /etc/grafana/ceph-dashboard.key
|
||||||
domain = {{ ansible_fqdn }}
|
domain = {{ ansible_facts['fqdn'] }}
|
||||||
protocol = {{ dashboard_protocol }}
|
protocol = {{ dashboard_protocol }}
|
||||||
http_port = {{ grafana_port }}
|
http_port = {{ grafana_port }}
|
||||||
http_addr = {{ grafana_server_addr }}
|
http_addr = {{ grafana_server_addr }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: check for a mon container
|
- name: check for a mon container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-mon-{{ ansible_hostname }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-mon-{{ ansible_facts['hostname'] }}'"
|
||||||
register: ceph_mon_container_stat
|
register: ceph_mon_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
when: inventory_hostname in groups.get(osd_group_name, [])
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
||||||
|
|
||||||
- name: check for a mds container
|
- name: check for a mds container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-mds-{{ ansible_hostname }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-mds-{{ ansible_facts['hostname'] }}'"
|
||||||
register: ceph_mds_container_stat
|
register: ceph_mds_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
when: inventory_hostname in groups.get(mds_group_name, [])
|
when: inventory_hostname in groups.get(mds_group_name, [])
|
||||||
|
|
||||||
- name: check for a rgw container
|
- name: check for a rgw container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-rgw-{{ ansible_hostname }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-rgw-{{ ansible_facts['hostname'] }}'"
|
||||||
register: ceph_rgw_container_stat
|
register: ceph_rgw_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
when: inventory_hostname in groups.get(rgw_group_name, [])
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
||||||
|
|
||||||
- name: check for a mgr container
|
- name: check for a mgr container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-mgr-{{ ansible_hostname }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-mgr-{{ ansible_facts['hostname'] }}'"
|
||||||
register: ceph_mgr_container_stat
|
register: ceph_mgr_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
when: inventory_hostname in groups.get(mgr_group_name, [])
|
when: inventory_hostname in groups.get(mgr_group_name, [])
|
||||||
|
|
||||||
- name: check for a rbd mirror container
|
- name: check for a rbd mirror container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-rbd-mirror-{{ ansible_hostname }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-rbd-mirror-{{ ansible_facts['hostname'] }}'"
|
||||||
register: ceph_rbd_mirror_container_stat
|
register: ceph_rbd_mirror_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
|
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
|
||||||
|
|
||||||
- name: check for a nfs container
|
- name: check for a nfs container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_facts['hostname']) }}'"
|
||||||
register: ceph_nfs_container_stat
|
register: ceph_nfs_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
|
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
|
||||||
|
|
||||||
- name: check for a ceph-crash container
|
- name: check for a ceph-crash container
|
||||||
command: "{{ container_binary }} ps -q --filter='name=ceph-crash-{{ ansible_hostname }}'"
|
command: "{{ container_binary }} ps -q --filter='name=ceph-crash-{{ ansible_facts['hostname'] }}'"
|
||||||
register: ceph_crash_container_stat
|
register: ceph_crash_container_stat
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: restart the ceph-crash service
|
- name: restart the ceph-crash service
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-crash@{{ ansible_hostname }}
|
name: ceph-crash@{{ ansible_facts['hostname'] }}
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
RETRIES="{{ handler_health_mds_check_retries }}"
|
RETRIES="{{ handler_health_mds_check_retries }}"
|
||||||
DELAY="{{ handler_health_mds_check_delay }}"
|
DELAY="{{ handler_health_mds_check_delay }}"
|
||||||
MDS_NAME="{{ mds_name }}"
|
MDS_NAME="{{ mds_name }}"
|
||||||
{% if containerized_deployment %}
|
{% if containerized_deployment | bool %}
|
||||||
DOCKER_EXEC="{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
|
DOCKER_EXEC="{{ container_binary }} exec ceph-mds-{{ ansible_facts['hostname'] }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Backward compatibility
|
# Backward compatibility
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['fqdn'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['fqdn'] }}.asok
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['hostname'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['hostname'] }}.asok
|
||||||
|
|
||||||
# First, restart the daemon
|
# First, restart the daemon
|
||||||
systemctl restart ceph-mds@${MDS_NAME}
|
systemctl restart ceph-mds@${MDS_NAME}
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
RETRIES="{{ handler_health_mgr_check_retries }}"
|
RETRIES="{{ handler_health_mgr_check_retries }}"
|
||||||
DELAY="{{ handler_health_mgr_check_delay }}"
|
DELAY="{{ handler_health_mgr_check_delay }}"
|
||||||
MGR_NAME="{{ ansible_hostname }}"
|
MGR_NAME="{{ ansible_facts['hostname'] }}"
|
||||||
{% if containerized_deployment %}
|
{% if containerized_deployment | bool %}
|
||||||
DOCKER_EXEC="{{ container_binary }} exec ceph-mgr-{{ ansible_hostname }}"
|
DOCKER_EXEC="{{ container_binary }} exec ceph-mgr-{{ ansible_facts['hostname'] }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Backward compatibility
|
# Backward compatibility
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mgr.{{ ansible_fqdn }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mgr.{{ ansible_fqdn }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mgr.{{ ansible_facts['fqdn'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mgr.{{ ansible_facts['fqdn'] }}.asok
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mgr.{{ ansible_hostname }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mgr.{{ ansible_hostname }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mgr.{{ ansible_facts['hostname'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mgr.{{ ansible_facts['hostname'] }}.asok
|
||||||
|
|
||||||
systemctl reset-failed ceph-mgr@${MGR_NAME}
|
systemctl reset-failed ceph-mgr@${MGR_NAME}
|
||||||
# First, restart the daemon
|
# First, restart the daemon
|
||||||
|
|
|
@ -3,19 +3,19 @@
|
||||||
RETRIES="{{ handler_health_mon_check_retries }}"
|
RETRIES="{{ handler_health_mon_check_retries }}"
|
||||||
DELAY="{{ handler_health_mon_check_delay }}"
|
DELAY="{{ handler_health_mon_check_delay }}"
|
||||||
MONITOR_NAME="{{ monitor_name }}"
|
MONITOR_NAME="{{ monitor_name }}"
|
||||||
{% if containerized_deployment %}
|
{% if containerized_deployment | bool %}
|
||||||
DOCKER_EXEC="{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
DOCKER_EXEC="{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# if daemon is uninstalled, no restarting is needed; so exit with success
|
# if daemon is uninstalled, no restarting is needed; so exit with success
|
||||||
systemctl status ceph-mon@{{ ansible_hostname }} > /dev/null
|
systemctl status ceph-mon@{{ ansible_facts['hostname'] }} > /dev/null
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Backward compatibility
|
# Backward compatibility
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mon.{{ ansible_fqdn }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mon.{{ ansible_fqdn }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mon.{{ ansible_facts['fqdn'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mon.{{ ansible_facts['fqdn'] }}.asok
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mon.{{ ansible_hostname }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mon.{{ ansible_hostname }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mon.{{ ansible_facts['hostname'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mon.{{ ansible_facts['hostname'] }}.asok
|
||||||
|
|
||||||
check_quorum() {
|
check_quorum() {
|
||||||
while [ $RETRIES -ne 0 ]; do
|
while [ $RETRIES -ne 0 ]; do
|
||||||
|
@ -34,7 +34,7 @@ exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# First, restart the daemon
|
# First, restart the daemon
|
||||||
systemctl restart ceph-mon@{{ ansible_hostname }}
|
systemctl restart ceph-mon@{{ ansible_facts['hostname'] }}
|
||||||
|
|
||||||
COUNT=10
|
COUNT=10
|
||||||
# Wait and ensure the socket exists after restarting the daemon
|
# Wait and ensure the socket exists after restarting the daemon
|
||||||
|
@ -45,5 +45,5 @@ while [ $COUNT -ne 0 ]; do
|
||||||
done
|
done
|
||||||
# If we reach this point, it means the socket is not present.
|
# If we reach this point, it means the socket is not present.
|
||||||
echo "Socket file ${SOCKET} could not be found, which means the monitor is not running. Showing ceph-mon unit logs now:"
|
echo "Socket file ${SOCKET} could not be found, which means the monitor is not running. Showing ceph-mon unit logs now:"
|
||||||
journalctl -u ceph-mon@{{ ansible_hostname }}
|
journalctl -u ceph-mon@{{ ansible_facts['hostname'] }}
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
RETRIES="{{ handler_health_nfs_check_retries }}"
|
RETRIES="{{ handler_health_nfs_check_retries }}"
|
||||||
DELAY="{{ handler_health_nfs_check_delay }}"
|
DELAY="{{ handler_health_nfs_check_delay }}"
|
||||||
NFS_NAME="ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}"
|
NFS_NAME="ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_facts['hostname']) }}"
|
||||||
PID=/var/run/ganesha.pid
|
PID=/var/run/ganesha.pid
|
||||||
{% if containerized_deployment %}
|
{% if containerized_deployment | bool %}
|
||||||
DOCKER_EXEC="{{ container_binary }} exec ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }}"
|
DOCKER_EXEC="{{ container_binary }} exec ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_facts['hostname']) }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# First, restart the daemon
|
# First, restart the daemon
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
RETRIES="{{ handler_health_rbd_mirror_check_retries }}"
|
RETRIES="{{ handler_health_rbd_mirror_check_retries }}"
|
||||||
DELAY="{{ handler_health_rbd_mirror_check_delay }}"
|
DELAY="{{ handler_health_rbd_mirror_check_delay }}"
|
||||||
RBD_MIRROR_NAME="{{ ansible_hostname }}"
|
RBD_MIRROR_NAME="{{ ansible_facts['hostname'] }}"
|
||||||
{% if containerized_deployment %}
|
{% if containerized_deployment %}
|
||||||
DOCKER_EXEC="{{ container_binary }} exec ceph-rbd-mirror-{{ ansible_hostname }}"
|
DOCKER_EXEC="{{ container_binary }} exec ceph-rbd-mirror-{{ ansible_facts['hostname'] }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Backward compatibility
|
# Backward compatibility
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_fqdn }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_fqdn }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_facts['fqdn'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_facts['fqdn'] }}.asok
|
||||||
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_hostname }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_hostname }}.asok
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_facts['hostname'] }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-client.rbd-mirror.{{ ansible_facts['hostname'] }}.asok
|
||||||
|
|
||||||
# First, restart the daemon
|
# First, restart the daemon
|
||||||
systemctl restart ceph-rbd-mirror@rbd-mirror.${RBD_MIRROR_NAME}
|
systemctl restart ceph-rbd-mirror@rbd-mirror.${RBD_MIRROR_NAME}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
RETRIES="{{ handler_health_rgw_check_retries }}"
|
RETRIES="{{ handler_health_rgw_check_retries }}"
|
||||||
DELAY="{{ handler_health_rgw_check_delay }}"
|
DELAY="{{ handler_health_rgw_check_delay }}"
|
||||||
HOST_NAME="{{ ansible_hostname }}"
|
HOST_NAME="{{ ansible_facts['hostname'] }}"
|
||||||
RGW_NUMS={{ rgw_instances | length | int }}
|
RGW_NUMS={{ rgw_instances | length | int }}
|
||||||
RGW_FRONTEND_SSL_CERT={{ radosgw_frontend_ssl_certificate }}
|
RGW_FRONTEND_SSL_CERT={{ radosgw_frontend_ssl_certificate }}
|
||||||
if [ -n "$RGW_FRONTEND_SSL_CERT" ]; then
|
if [ -n "$RGW_FRONTEND_SSL_CERT" ]; then
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
block:
|
block:
|
||||||
- name: install firewalld python binding
|
- name: install firewalld python binding
|
||||||
package:
|
package:
|
||||||
name: "python{{ ansible_python.version.major }}-firewall"
|
name: "python{{ ansible_facts['python']['version']['major'] }}-firewall"
|
||||||
tags: with_pkg
|
tags: with_pkg
|
||||||
when: not is_atomic | bool
|
when: not is_atomic | bool
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
- name: update cache for Debian based OSs
|
- name: update cache for Debian based OSs
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_facts['os_family'] == "Debian"
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
include_tasks: configure_firewall.yml
|
include_tasks: configure_firewall.yml
|
||||||
when:
|
when:
|
||||||
- configure_firewall | bool
|
- configure_firewall | bool
|
||||||
- ansible_os_family in ['RedHat', 'Suse']
|
- ansible_facts['os_family'] in ['RedHat', 'Suse']
|
||||||
tags: configure_firewall
|
tags: configure_firewall
|
||||||
|
|
||||||
- name: include_tasks setup_ntp.yml
|
- name: include_tasks setup_ntp.yml
|
||||||
|
|
|
@ -35,13 +35,13 @@ trusted_ip_list: 192.168.122.1
|
||||||
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
||||||
|
|
||||||
# TCMU_RUNNER resource limitation
|
# TCMU_RUNNER resource limitation
|
||||||
ceph_tcmu_runner_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_tcmu_runner_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_tcmu_runner_docker_cpu_limit: 1
|
ceph_tcmu_runner_docker_cpu_limit: 1
|
||||||
|
|
||||||
# RBD_TARGET_GW resource limitation
|
# RBD_TARGET_GW resource limitation
|
||||||
ceph_rbd_target_gw_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_rbd_target_gw_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_rbd_target_gw_docker_cpu_limit: 1
|
ceph_rbd_target_gw_docker_cpu_limit: 1
|
||||||
|
|
||||||
# RBD_TARGET_API resource limitation
|
# RBD_TARGET_API resource limitation
|
||||||
ceph_rbd_target_api_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_rbd_target_api_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_rbd_target_api_docker_cpu_limit: 1
|
ceph_rbd_target_api_docker_cpu_limit: 1
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
- name: add mgr ip address to trusted list with dashboard - ipv4
|
- name: add mgr ip address to trusted list with dashboard - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
trusted_ip_list: '{{ trusted_ip_list }},{{ hostvars[item]["ansible_all_ipv4_addresses"] | ips_in_ranges(public_network.split(",")) | first }}'
|
trusted_ip_list: '{{ trusted_ip_list }},{{ hostvars[item]["ansible_facts"]["all_ipv4_addresses"] | ips_in_ranges(public_network.split(",")) | first }}'
|
||||||
with_items: '{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}'
|
with_items: '{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}'
|
||||||
when:
|
when:
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
- name: add mgr ip address to trusted list with dashboard - ipv6
|
- name: add mgr ip address to trusted list with dashboard - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
trusted_ip_list: '{{ trusted_ip_list }},{{ hostvars[item]["ansible_all_ipv6_addresses"] | ips_in_ranges(public_network.split(",")) | last }}'
|
trusted_ip_list: '{{ trusted_ip_list }},{{ hostvars[item]["ansible_facts"]["all_ipv6_addresses"] | ips_in_ranges(public_network.split(",")) | last }}'
|
||||||
with_items: '{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}'
|
with_items: '{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}'
|
||||||
when:
|
when:
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
command: >
|
command: >
|
||||||
openssl req -newkey rsa:2048 -nodes -keyout {{ iscsi_ssl_tmp_dir.path }}/iscsi-gateway.key
|
openssl req -newkey rsa:2048 -nodes -keyout {{ iscsi_ssl_tmp_dir.path }}/iscsi-gateway.key
|
||||||
-x509 -days 365 -out {{ iscsi_ssl_tmp_dir.path }}/iscsi-gateway.crt
|
-x509 -days 365 -out {{ iscsi_ssl_tmp_dir.path }}/iscsi-gateway.crt
|
||||||
-subj "/C=US/ST=./L=./O=RedHat/OU=Linux/CN={{ ansible_hostname }}"
|
-subj "/C=US/ST=./L=./O=RedHat/OU=Linux/CN={{ ansible_facts['hostname'] }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
run_once: True
|
run_once: True
|
||||||
with_items: "{{ crt_files_exist.results }}"
|
with_items: "{{ crt_files_exist.results }}"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: red hat based systems tasks
|
- name: red hat based systems tasks
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_facts['os_family'] == 'RedHat'
|
||||||
block:
|
block:
|
||||||
- name: set_fact common_pkgs
|
- name: set_fact common_pkgs
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
- name: ceph-iscsi stable repository
|
- name: ceph-iscsi stable repository
|
||||||
get_url:
|
get_url:
|
||||||
url: 'https://download.ceph.com/ceph-iscsi/{{ "3" if use_new_ceph_iscsi | bool else "2" }}/rpm/el{{ ansible_distribution_major_version }}/ceph-iscsi.repo'
|
url: "https://download.ceph.com/ceph-iscsi/{{ '3' if use_new_ceph_iscsi | bool else '2' }}/rpm/el{{ ansible_facts['distribution_major_version'] }}/ceph-iscsi.repo"
|
||||||
dest: /etc/yum.repos.d/ceph-iscsi.repo
|
dest: /etc/yum.repos.d/ceph-iscsi.repo
|
||||||
force: true
|
force: true
|
||||||
when: ceph_repository == 'community'
|
when: ceph_repository == 'community'
|
||||||
|
|
|
@ -19,13 +19,13 @@ copy_admin_key: false
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
|
||||||
ceph_mds_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_mds_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_mds_docker_cpu_limit: 4
|
ceph_mds_docker_cpu_limit: 4
|
||||||
|
|
||||||
# we currently for MDS_NAME to hostname because of a bug in ceph-docker
|
# we currently for MDS_NAME to hostname because of a bug in ceph-docker
|
||||||
# fix here: https://github.com/ceph/ceph-docker/pull/770
|
# fix here: https://github.com/ceph/ceph-docker/pull/770
|
||||||
# this will go away soon.
|
# this will go away soon.
|
||||||
ceph_mds_docker_extra_env: -e MDS_NAME={{ ansible_hostname }}
|
ceph_mds_docker_extra_env: -e MDS_NAME={{ ansible_facts['hostname'] }}
|
||||||
ceph_config_keys: [] # DON'T TOUCH ME
|
ceph_config_keys: [] # DON'T TOUCH ME
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
|
|
||||||
- name: systemd start mds container
|
- name: systemd start mds container
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mds@{{ ansible_hostname }}
|
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: wait for mds socket to exist
|
- name: wait for mds socket to exist
|
||||||
command: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }} sh -c 'stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok || stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok'"
|
command: "{{ container_binary }} exec ceph-mds-{{ ansible_facts['hostname'] }} sh -c 'stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['hostname'] }}.asok || stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_facts['fqdn'] }}.asok'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: multi_mds_socket
|
register: multi_mds_socket
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
apt:
|
apt:
|
||||||
name: ceph-mds
|
name: 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('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}"
|
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_facts['distribution_release'] ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
|
||||||
when:
|
when:
|
||||||
- mds_group_name in group_names
|
- mds_group_name in group_names
|
||||||
- ansible_os_family == 'Debian'
|
- ansible_facts['os_family'] == 'Debian'
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when:
|
when:
|
||||||
- mds_group_name in group_names
|
- mds_group_name in group_names
|
||||||
- ansible_os_family in ['Suse', 'RedHat']
|
- ansible_facts['os_family'] in ['Suse', 'RedHat']
|
||||||
|
|
||||||
- name: create mds keyring
|
- name: create mds keyring
|
||||||
command: ceph --cluster {{ cluster }} --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring auth get-or-create mds.{{ mds_name }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring
|
command: ceph --cluster {{ cluster }} --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring auth get-or-create mds.{{ mds_name }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
path: "/etc/systemd/system/ceph-mds@.service.d/"
|
path: "/etc/systemd/system/ceph-mds@.service.d/"
|
||||||
when:
|
when:
|
||||||
- ceph_mds_systemd_overrides is defined
|
- ceph_mds_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: add ceph-mds systemd service overrides
|
- name: add ceph-mds systemd service overrides
|
||||||
config_template:
|
config_template:
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
config_type: "ini"
|
config_type: "ini"
|
||||||
when:
|
when:
|
||||||
- ceph_mds_systemd_overrides is defined
|
- ceph_mds_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: start and add that the metadata service to the init sequence
|
- name: start and add that the metadata service to the init sequence
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -6,17 +6,17 @@ Requires=docker.service
|
||||||
{% else %}
|
{% else %}
|
||||||
After=network.target
|
After=network.target
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set cpu_limit = ansible_processor_vcpus|int if ceph_mds_docker_cpu_limit|int > ansible_processor_vcpus|int else ceph_mds_docker_cpu_limit|int %}
|
{% set cpu_limit = ansible_facts['processor_vcpus']|int if ceph_mds_docker_cpu_limit|int > ansible_facts['processor_vcpus']|int else ceph_mds_docker_cpu_limit|int %}
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=-/etc/environment
|
EnvironmentFile=-/etc/environment
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mds-{{ ansible_hostname }}
|
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mds-{{ ansible_facts['hostname'] }}
|
||||||
{% else %}
|
{% else %}
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }}
|
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_facts['hostname'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_hostname }}
|
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_facts['hostname'] }}
|
||||||
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
||||||
|
@ -32,12 +32,12 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
||||||
-e CEPH_DAEMON=MDS \
|
-e CEPH_DAEMON=MDS \
|
||||||
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
||||||
{{ ceph_mds_docker_extra_env }} \
|
{{ ceph_mds_docker_extra_env }} \
|
||||||
--name=ceph-mds-{{ ansible_hostname }} \
|
--name=ceph-mds-{{ ansible_facts['hostname'] }} \
|
||||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
||||||
{% else %}
|
{% else %}
|
||||||
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }}
|
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_facts['hostname'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
KillMode=none
|
KillMode=none
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -35,7 +35,7 @@ ceph_mgr_packages:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_mgr_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mgr_docker_extra_env' variable.
|
||||||
ceph_mgr_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_mgr_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_mgr_docker_cpu_limit: 1
|
ceph_mgr_docker_cpu_limit: 1
|
||||||
|
|
||||||
ceph_mgr_docker_extra_env:
|
ceph_mgr_docker_extra_env:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: create mgr directory
|
- name: create mgr directory
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}
|
path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_facts['hostname'] }}
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
- name: fetch ceph mgr keyring
|
- name: fetch ceph mgr keyring
|
||||||
ceph_key:
|
ceph_key:
|
||||||
name: "mgr.{{ ansible_hostname }}"
|
name: "mgr.{{ ansible_facts['hostname'] }}"
|
||||||
caps:
|
caps:
|
||||||
mon: allow profile mgr
|
mon: allow profile mgr
|
||||||
osd: allow *
|
osd: allow *
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
mode: "0400"
|
mode: "0400"
|
||||||
dest: "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring"
|
dest: "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring"
|
||||||
environment:
|
environment:
|
||||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
|
||||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
block:
|
block:
|
||||||
- name: create ceph mgr keyring(s) on a mon node
|
- name: create ceph mgr keyring(s) on a mon node
|
||||||
ceph_key:
|
ceph_key:
|
||||||
name: "mgr.{{ hostvars[item]['ansible_hostname'] }}"
|
name: "mgr.{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
caps:
|
caps:
|
||||||
mon: allow profile mgr
|
mon: allow profile mgr
|
||||||
osd: allow *
|
osd: allow *
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
_mgr_keys:
|
_mgr_keys:
|
||||||
- { 'name': 'client.admin', 'path': "/etc/ceph/{{ cluster }}.client.admin.keyring", 'copy_key': copy_admin_key }
|
- { 'name': 'client.admin', 'path': "/etc/ceph/{{ cluster }}.client.admin.keyring", 'copy_key': copy_admin_key }
|
||||||
- { 'name': "mgr.{{ ansible_hostname }}", 'path': "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring", 'copy_key': true }
|
- { 'name': "mgr.{{ ansible_facts['hostname'] }}", 'path': "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring", 'copy_key': true }
|
||||||
|
|
||||||
- name: get keys from monitors
|
- name: get keys from monitors
|
||||||
command: "{{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
|
command: "{{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
|
||||||
|
@ -77,8 +77,8 @@
|
||||||
|
|
||||||
- name: set mgr key permissions
|
- name: set mgr key permissions
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring
|
path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring
|
||||||
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||||
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||||
mode: "{{ ceph_keyring_permissions }}"
|
mode: "{{ ceph_keyring_permissions }}"
|
||||||
when: cephx | bool
|
when: cephx | bool
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
delegate_facts: true
|
delegate_facts: true
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: set_fact ceph_mgr_packages for sso
|
- name: set_fact ceph_mgr_packages for sso
|
||||||
set_fact:
|
set_fact:
|
||||||
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['python3-saml' if ansible_distribution_major_version | int == 8 else 'python-saml']) }}"
|
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['python3-saml' if ansible_facts['distribution_major_version'] | int == 8 else 'python-saml']) }}"
|
||||||
when:
|
when:
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
- ansible_distribution == 'RedHat'
|
- ansible_facts['distribution'] == 'RedHat'
|
||||||
|
|
||||||
- name: install ceph-mgr packages on RedHat or SUSE
|
- name: install ceph-mgr packages on RedHat or SUSE
|
||||||
package:
|
package:
|
||||||
|
@ -12,16 +12,16 @@
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: ansible_os_family in ['RedHat', 'Suse']
|
when: ansible_facts['os_family'] in ['RedHat', 'Suse']
|
||||||
|
|
||||||
- name: install ceph-mgr packages for debian
|
- name: install ceph-mgr packages for debian
|
||||||
apt:
|
apt:
|
||||||
name: '{{ ceph_mgr_packages }}'
|
name: '{{ ceph_mgr_packages }}'
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else ''}}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}"
|
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else ''}}{{ ansible_facts['distribution_release'] ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: install routes python library for dashboard module
|
- name: install routes python library for dashboard module
|
||||||
apt:
|
apt:
|
||||||
|
@ -29,5 +29,5 @@
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Debian'
|
- ansible_facts['os_family'] == 'Debian'
|
||||||
- "'ceph-mgr-dashboard' in ceph_mgr_packages"
|
- "'ceph-mgr-dashboard' in ceph_mgr_packages"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
path: "/etc/systemd/system/ceph-mgr@.service.d/"
|
path: "/etc/systemd/system/ceph-mgr@.service.d/"
|
||||||
when:
|
when:
|
||||||
- ceph_mgr_systemd_overrides is defined
|
- ceph_mgr_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: add ceph-mgr systemd service overrides
|
- name: add ceph-mgr systemd service overrides
|
||||||
config_template:
|
config_template:
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
config_type: "ini"
|
config_type: "ini"
|
||||||
when:
|
when:
|
||||||
- ceph_mgr_systemd_overrides is defined
|
- ceph_mgr_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: include_tasks systemd.yml
|
- name: include_tasks systemd.yml
|
||||||
include_tasks: systemd.yml
|
include_tasks: systemd.yml
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
- name: systemd start mgr
|
- name: systemd start mgr
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mgr@{{ ansible_hostname }}
|
name: ceph-mgr@{{ ansible_facts['hostname'] }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
|
|
|
@ -11,11 +11,11 @@ After=network.target
|
||||||
EnvironmentFile=-/etc/environment
|
EnvironmentFile=-/etc/environment
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mgr-{{ ansible_hostname }}
|
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mgr-{{ ansible_facts['hostname'] }}
|
||||||
{% else %}
|
{% else %}
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }}
|
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_facts['hostname'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }}
|
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_facts['hostname'] }}
|
||||||
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
||||||
|
@ -31,12 +31,12 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
||||||
-e CEPH_DAEMON=MGR \
|
-e CEPH_DAEMON=MGR \
|
||||||
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
||||||
{{ ceph_mgr_docker_extra_env }} \
|
{{ ceph_mgr_docker_extra_env }} \
|
||||||
--name=ceph-mgr-{{ ansible_hostname }} \
|
--name=ceph-mgr-{{ ansible_facts['hostname'] }} \
|
||||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
||||||
{% else %}
|
{% else %}
|
||||||
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }}
|
ExecStopPost=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_facts['hostname'] }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
KillMode=none
|
KillMode=none
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -37,7 +37,7 @@ client_admin_ceph_authtool_cap:
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_mon_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_mon_docker_extra_env' variable.
|
||||||
ceph_mon_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_mon_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_mon_docker_cpu_limit: 1
|
ceph_mon_docker_cpu_limit: 1
|
||||||
ceph_mon_container_listen_port: 3300
|
ceph_mon_container_listen_port: 3300
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
ceph
|
ceph
|
||||||
--cluster {{ cluster }}
|
--cluster {{ cluster }}
|
||||||
-n mon.
|
-n mon.
|
||||||
-k /var/lib/ceph/mon/{{ cluster }}-{{ ansible_hostname }}/keyring
|
-k /var/lib/ceph/mon/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring
|
||||||
mon_status
|
mon_status
|
||||||
--format json
|
--format json
|
||||||
register: ceph_health_raw
|
register: ceph_health_raw
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
name: mon.
|
name: mon.
|
||||||
cluster: "{{ cluster }}"
|
cluster: "{{ cluster }}"
|
||||||
user: mon.
|
user: mon.
|
||||||
user_key: "/var/lib/ceph/mon/{{ cluster }}-{{ hostvars[running_mon]['ansible_hostname'] }}/keyring"
|
user_key: "/var/lib/ceph/mon/{{ cluster }}-{{ hostvars[running_mon]['ansible_facts']['hostname'] }}/keyring"
|
||||||
state: info
|
state: info
|
||||||
environment:
|
environment:
|
||||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_facts['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: include deploy_monitors.yml
|
- name: include deploy_monitors.yml
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
when:
|
when:
|
||||||
- not containerized_deployment | bool
|
- not containerized_deployment | bool
|
||||||
- ceph_mon_systemd_overrides is defined
|
- ceph_mon_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: add ceph-mon systemd service overrides
|
- name: add ceph-mon systemd service overrides
|
||||||
config_template:
|
config_template:
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
when:
|
when:
|
||||||
- not containerized_deployment | bool
|
- not containerized_deployment | bool
|
||||||
- ceph_mon_systemd_overrides is defined
|
- ceph_mon_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: include_tasks systemd.yml
|
- name: include_tasks systemd.yml
|
||||||
include_tasks: systemd.yml
|
include_tasks: systemd.yml
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
- name: start the monitor service
|
- name: start the monitor service
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-mon@{{ monitor_name if not containerized_deployment else ansible_hostname }}
|
name: ceph-mon@{{ monitor_name if not containerized_deployment | bool else ansible_facts['hostname'] }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
|
|
|
@ -28,7 +28,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
|
||||||
-v /var/run/ceph:/var/run/ceph:z \
|
-v /var/run/ceph:/var/run/ceph:z \
|
||||||
-v /etc/localtime:/etc/localtime:ro \
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
-v /var/log/ceph:/var/log/ceph:z \
|
-v /var/log/ceph:/var/log/ceph:z \
|
||||||
{% if ansible_distribution == 'RedHat' -%}
|
{% if ansible_facts['distribution'] == 'RedHat' -%}
|
||||||
-v /etc/pki/ca-trust/extracted:/etc/pki/ca-trust/extracted:z \
|
-v /etc/pki/ca-trust/extracted:/etc/pki/ca-trust/extracted:z \
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% if mon_docker_privileged -%}
|
{% if mon_docker_privileged -%}
|
||||||
|
|
|
@ -17,7 +17,7 @@ copy_admin_key: false
|
||||||
ceph_nfs_enable_service: true
|
ceph_nfs_enable_service: true
|
||||||
|
|
||||||
# ceph-nfs systemd service uses ansible's hostname as an instance id,
|
# ceph-nfs systemd service uses ansible's hostname as an instance id,
|
||||||
# so service name is ceph-nfs@{{ ansible_hostname }}, this is not
|
# so service name is ceph-nfs@{{ ansible_facts['hostname'] }}, this is not
|
||||||
# ideal when ceph-nfs is managed by pacemaker across multiple hosts - in
|
# ideal when ceph-nfs is managed by pacemaker across multiple hosts - in
|
||||||
# such case it's better to have constant instance id instead which
|
# such case it's better to have constant instance id instead which
|
||||||
# can be set by 'ceph_nfs_service_suffix'
|
# can be set by 'ceph_nfs_service_suffix'
|
||||||
|
@ -87,7 +87,7 @@ ceph_nfs_rgw_sectype: "sys,krb5,krb5i,krb5p"
|
||||||
# they must be configered.
|
# they must be configered.
|
||||||
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
|
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
|
||||||
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
|
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
|
||||||
rgw_client_name: client.rgw.{{ ansible_hostname }}
|
rgw_client_name: client.rgw.{{ ansible_facts['hostname'] }}
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# CONFIG OVERRIDE #
|
# CONFIG OVERRIDE #
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: set_fact container_exec_cmd_nfs
|
- name: set_fact container_exec_cmd_nfs
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd_nfs: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
container_exec_cmd_nfs: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: check if "{{ ceph_nfs_rgw_user }}" exists
|
- name: check if "{{ ceph_nfs_rgw_user }}" exists
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: ansible_distribution_major_version == '7'
|
when: ansible_facts['distribution_major_version'] == '7'
|
||||||
|
|
||||||
- name: install nfs-ganesha-selinux and python3-policycoreutils on RHEL 8
|
- name: install nfs-ganesha-selinux and python3-policycoreutils on RHEL 8
|
||||||
package:
|
package:
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when: ansible_distribution_major_version == '8'
|
when: ansible_facts['distribution_major_version'] == '8'
|
||||||
|
|
||||||
- name: add ganesha_t to permissive domain
|
- name: add ganesha_t to permissive domain
|
||||||
selinux_permissive:
|
selinux_permissive:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# global/common requirement
|
# global/common requirement
|
||||||
- name: stop nfs server service
|
- name: stop nfs server service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ 'nfs-server' if ansible_os_family == 'RedHat' else 'nfsserver' if ansible_os_family == 'Suse' else 'nfs-kernel-server' if ansible_os_family == 'Debian' }}"
|
name: "{{ 'nfs-server' if ansible_facts['os_family'] == 'RedHat' else 'nfsserver' if ansible_facts['os_family'] == 'Suse' else 'nfs-kernel-server' if ansible_facts['os_family'] == 'Debian' }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: no
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
import_tasks: ganesha_selinux_fix.yml
|
import_tasks: ganesha_selinux_fix.yml
|
||||||
when:
|
when:
|
||||||
- not containerized_deployment | bool
|
- not containerized_deployment | bool
|
||||||
- ansible_os_family == 'RedHat'
|
- ansible_facts['os_family'] == 'RedHat'
|
||||||
|
|
||||||
- name: nfs with external ceph cluster task related
|
- name: nfs with external ceph cluster task related
|
||||||
when:
|
when:
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ ceph_nfs_ceph_user }}"
|
- "{{ ceph_nfs_ceph_user }}"
|
||||||
- "{{ ansible_hostname }}"
|
- "{{ ansible_facts['hostname'] }}"
|
||||||
|
|
||||||
- name: set_fact rgw_client_name
|
- name: set_fact rgw_client_name
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
||||||
with_nested:
|
with_nested:
|
||||||
- "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] | default([]) }}"
|
- "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] | default([]) }}"
|
||||||
- ['/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring', '/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring']
|
- ['/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring', "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring"]
|
||||||
when:
|
when:
|
||||||
- not item.0.get('skipped', False)
|
- not item.0.get('skipped', False)
|
||||||
- item.0.item.name == 'client.' + ceph_nfs_ceph_user or item.0.item.name == rgw_client_name
|
- item.0.item.name == 'client.' + ceph_nfs_ceph_user or item.0.item.name == rgw_client_name
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
block:
|
block:
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
delegate_facts: true
|
delegate_facts: true
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
- name: include red hat based system related tasks
|
- name: include red hat based system related tasks
|
||||||
include_tasks: pre_requisite_non_container_red_hat.yml
|
include_tasks: pre_requisite_non_container_red_hat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_facts['os_family'] == 'RedHat'
|
||||||
|
|
||||||
- name: include debian based system related tasks
|
- name: include debian based system related tasks
|
||||||
include_tasks: pre_requisite_non_container_debian.yml
|
include_tasks: pre_requisite_non_container_debian.yml
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: install nfs rgw/cephfs gateway - suse
|
- name: install nfs rgw/cephfs gateway - suse
|
||||||
zypper:
|
zypper:
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
when:
|
when:
|
||||||
- (ceph_origin == 'repository' or ceph_origin == 'distro')
|
- (ceph_origin == 'repository' or ceph_origin == 'distro')
|
||||||
- ceph_repository != 'rhcs'
|
- ceph_repository != 'rhcs'
|
||||||
- ansible_os_family == 'Suse'
|
- ansible_facts['os_family'] == 'Suse'
|
||||||
- item.install | bool
|
- item.install | bool
|
||||||
register: result
|
register: result
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- { name: "/var/lib/ceph/bootstrap-rgw", create: "{{ nfs_obj_gw }}" }
|
- { name: "/var/lib/ceph/bootstrap-rgw", create: "{{ nfs_obj_gw }}" }
|
||||||
- { name: "/var/lib/ceph/radosgw", create: "{{ nfs_obj_gw }}" }
|
- { name: "/var/lib/ceph/radosgw", create: "{{ nfs_obj_gw }}" }
|
||||||
- { name: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}", create: "{{ nfs_obj_gw }}" }
|
- { name: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}", create: "{{ nfs_obj_gw }}" }
|
||||||
- { name: "{{ rbd_client_admin_socket_path }}", create: "{{ nfs_obj_gw }}" }
|
- { name: "{{ rbd_client_admin_socket_path }}", create: "{{ nfs_obj_gw }}" }
|
||||||
- { name: "/var/log/ceph", create: true }
|
- { name: "/var/log/ceph", create: true }
|
||||||
- { name: "/var/run/ceph", create: true }
|
- { name: "/var/run/ceph", create: true }
|
||||||
|
@ -74,14 +74,14 @@
|
||||||
when: nfs_obj_gw | bool
|
when: nfs_obj_gw | bool
|
||||||
block:
|
block:
|
||||||
- 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_facts['hostname'] }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring
|
||||||
args:
|
args:
|
||||||
creates: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring
|
creates: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: set rados gateway key permissions
|
- name: set rados gateway key permissions
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring
|
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_facts['hostname'] }}/keyring
|
||||||
owner: "ceph"
|
owner: "ceph"
|
||||||
group: "ceph"
|
group: "ceph"
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
block:
|
block:
|
||||||
- name: add nfs-ganesha stable repository
|
- name: add nfs-ganesha stable repository
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "deb {{ nfs_ganesha_stable_deb_repo }} {{ ceph_stable_distro_source | default(ansible_distribution_release) }} main"
|
repo: "deb {{ nfs_ganesha_stable_deb_repo }} {{ ceph_stable_distro_source | default(ansible_facts['distribution_release']) }} main"
|
||||||
state: present
|
state: present
|
||||||
update_cache: no
|
update_cache: no
|
||||||
register: add_ganesha_apt_repo
|
register: add_ganesha_apt_repo
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
block:
|
block:
|
||||||
- name: fetch nfs-ganesha development repository
|
- name: fetch nfs-ganesha development repository
|
||||||
uri:
|
uri:
|
||||||
url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_distribution | lower }}/{{ ansible_distribution_release }}/flavors/{{ nfs_ganesha_flavor }}/repo
|
url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_facts['distribution'] | lower }}/{{ ansible_facts['distribution_release'] }}/flavors/{{ nfs_ganesha_flavor }}/repo
|
||||||
return_content: yes
|
return_content: yes
|
||||||
register: nfs_ganesha_dev_apt_repo
|
register: nfs_ganesha_dev_apt_repo
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
block:
|
block:
|
||||||
- name: fetch nfs-ganesha red hat development repository
|
- name: fetch nfs-ganesha red hat development repository
|
||||||
uri:
|
uri:
|
||||||
url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/flavors/{{ nfs_ganesha_flavor }}/repo
|
url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_facts['distribution'] | lower }}/{{ ansible_facts['distribution_major_version'] }}/flavors/{{ nfs_ganesha_flavor }}/repo
|
||||||
return_content: yes
|
return_content: yes
|
||||||
register: nfs_ganesha_dev_yum_repo
|
register: nfs_ganesha_dev_yum_repo
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd_nfs - internal
|
- name: set_fact container_exec_cmd_nfs - internal
|
||||||
set_fact:
|
set_fact:
|
||||||
exec_cmd_nfs: "{{ container_binary + ' exec ceph-mon-' + hostvars[groups[mon_group_name][0]]['ansible_hostname'] if containerized_deployment | bool else '' }} rados"
|
exec_cmd_nfs: "{{ container_binary + ' exec ceph-mon-' + hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] if containerized_deployment | bool else '' }} rados"
|
||||||
delegate_node: "{{ groups[mon_group_name][0] }}"
|
delegate_node: "{{ groups[mon_group_name][0] }}"
|
||||||
when: groups.get(mon_group_name, []) | length > 0
|
when: groups.get(mon_group_name, []) | length > 0
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
- name: systemd start nfs container
|
- name: systemd start nfs container
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}
|
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_facts['hostname']) }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
|
|
|
@ -15,7 +15,7 @@ ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-nfs-%i
|
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-nfs-%i
|
||||||
{% endif %}
|
{% endif %}
|
||||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i
|
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i
|
||||||
ExecStartPre={{ '/bin/mkdir' if ansible_os_family == 'Debian' else '/usr/bin/mkdir' }} -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha
|
ExecStartPre={{ '/bin/mkdir' if ansible_facts['os_family'] == 'Debian' else '/usr/bin/mkdir' }} -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha
|
||||||
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
||||||
|
@ -36,7 +36,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
|
||||||
-e CEPH_DAEMON=NFS \
|
-e CEPH_DAEMON=NFS \
|
||||||
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
-e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
||||||
{{ ceph_nfs_docker_extra_env }} \
|
{{ ceph_nfs_docker_extra_env }} \
|
||||||
--name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }} \
|
--name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_facts['hostname']) }} \
|
||||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||||
{% if container_binary == 'podman' %}
|
{% if container_binary == 'podman' %}
|
||||||
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
||||||
|
|
|
@ -161,7 +161,7 @@ ceph_config_keys: [] # DON'T TOUCH ME
|
||||||
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
|
||||||
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
|
||||||
# These options can be passed using the 'ceph_osd_docker_extra_env' variable.
|
# These options can be passed using the 'ceph_osd_docker_extra_env' variable.
|
||||||
ceph_osd_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
|
ceph_osd_docker_memory_limit: "{{ ansible_facts['memtotal_mb'] }}m"
|
||||||
ceph_osd_docker_cpu_limit: 4
|
ceph_osd_docker_cpu_limit: 4
|
||||||
|
|
||||||
# The next two variables are undefined, and thus, unused by default.
|
# The next two variables are undefined, and thus, unused by default.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: set_fact container_exec_cmd
|
- name: set_fact container_exec_cmd
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
||||||
with_items: "{{ groups.get(mon_group_name, []) }}"
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
||||||
delegate_to: "{{ item }}"
|
delegate_to: "{{ item }}"
|
||||||
delegate_facts: true
|
delegate_facts: true
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
until: result is succeeded
|
until: result is succeeded
|
||||||
when:
|
when:
|
||||||
- not containerized_deployment | bool
|
- not containerized_deployment | bool
|
||||||
- ansible_os_family != 'ClearLinux'
|
- ansible_facts['os_family'] != 'ClearLinux'
|
||||||
|
|
||||||
- name: install numactl when needed
|
- name: install numactl when needed
|
||||||
package:
|
package:
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
path: "/etc/systemd/system/ceph-osd@.service.d/"
|
path: "/etc/systemd/system/ceph-osd@.service.d/"
|
||||||
when:
|
when:
|
||||||
- ceph_osd_systemd_overrides is defined
|
- ceph_osd_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: add ceph-osd systemd service overrides
|
- name: add ceph-osd systemd service overrides
|
||||||
config_template:
|
config_template:
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
config_type: "ini"
|
config_type: "ini"
|
||||||
when:
|
when:
|
||||||
- ceph_osd_systemd_overrides is defined
|
- ceph_osd_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_facts['service_mgr'] == 'systemd'
|
||||||
|
|
||||||
- name: ensure "/var/lib/ceph/osd/{{ cluster }}-{{ item }}" is present
|
- name: ensure "/var/lib/ceph/osd/{{ cluster }}-{{ item }}" is present
|
||||||
file:
|
file:
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue