Skip to content

Commit

Permalink
facts: remove legacy tasks
Browse files Browse the repository at this point in the history
these tasks were there only for backward compatibility concerns.
It's time to drop them.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
  • Loading branch information
guits committed Feb 13, 2024
1 parent d1a5a16 commit 0733464
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
33 changes: 0 additions & 33 deletions roles/ceph-facts/tasks/facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,39 +180,6 @@
import_tasks: devices.yml
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
stat:
path: '/etc/ceph/{{ cluster }}.conf'
Expand Down
2 changes: 1 addition & 1 deletion roles/ceph-nfs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- name: set_fact _rgw_hostname
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)
ceph_config:
Expand Down
2 changes: 1 addition & 1 deletion roles/ceph-rgw/tasks/pre_requisite.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: set_fact _rgw_hostname
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)
ceph_config:
Expand Down

0 comments on commit 0733464

Please sign in to comment.