facts: remove legacy tasks

these tasks were there only for backward compatibility concerns.
It's time to drop them.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
pull/7474/head
Guillaume Abrioux 2024-02-13 16:01:38 +01:00
parent bba9955bf7
commit b2273ef4b8
3 changed files with 2 additions and 35 deletions

View File

@ -180,39 +180,6 @@
import_tasks: devices.yml import_tasks: devices.yml
when: inventory_hostname in groups.get(osd_group_name, []) when: inventory_hostname in groups.get(osd_group_name, [])
- name: backward compatibility tasks related
when:
- (inventory_hostname in groups.get(rgw_group_name, []) or inventory_hostname in groups.get(nfs_group_name, []))
- groups.get(mon_group_name, []) | length > 0
block:
- name: get ceph current status
command: "{{ timeout_command }} {{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} service dump -f json"
changed_when: false
failed_when: false
check_mode: no
register: ceph_current_status
run_once: true
delegate_to: "{{ groups[mon_group_name][0] if running_mon is undefined else running_mon }}"
- name: set_fact ceph_current_status
set_fact:
ceph_current_status: "{{ ceph_current_status.stdout | from_json }}"
run_once: true
when: ceph_current_status.rc == 0
- name: set_fact rgw_hostname
set_fact:
rgw_hostname: "{% set _value = ansible_facts['hostname'] -%}
{% for key in (ceph_current_status['services']['rgw']['daemons'] | list) -%}
{% if key == ansible_facts['fqdn'] -%}
{% set _value = key -%}
{% endif -%}
{% endfor -%}
{{ _value }}"
when:
- ceph_current_status['services'] is defined
- ceph_current_status['services']['rgw'] is defined
- name: check if the ceph conf exists - name: check if the ceph conf exists
stat: stat:
path: '/etc/ceph/{{ cluster }}.conf' path: '/etc/ceph/{{ cluster }}.conf'

View File

@ -17,7 +17,7 @@
- name: set_fact _rgw_hostname - name: set_fact _rgw_hostname
set_fact: set_fact:
_rgw_hostname: "{{ hostvars[inventory_hostname]['rgw_hostname'] | default(hostvars[inventory_hostname]['ansible_facts']['hostname']) }}" _rgw_hostname: "{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}"
- name: set rgw parameter (log file) - name: set rgw parameter (log file)
ceph_config: ceph_config:

View File

@ -1,7 +1,7 @@
--- ---
- name: set_fact _rgw_hostname - name: set_fact _rgw_hostname
set_fact: set_fact:
_rgw_hostname: "{{ hostvars[inventory_hostname]['rgw_hostname'] | default(hostvars[inventory_hostname]['ansible_facts']['hostname']) }}" _rgw_hostname: "{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}"
- name: set rgw parameter (log file) - name: set rgw parameter (log file)
ceph_config: ceph_config: