Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph-config: move ceph_config module call to ceph-config role #7542

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions roles/ceph-config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@
ansible.builtin.set_fact:
num_osds: "{{ num_osds | int + (lvm_list.stdout | default('{}') | from_json | dict2items | map(attribute='value') | flatten | map(attribute='devices') | sum(start=[]) | difference(lvm_volumes | default([]) | map(attribute='data')) | length | int) }}"

- name: Set cluster configs
ceph_config:
action: set
who: "{{ item.0.key }}"
option: "{{ item.1.key }}"
value: "{{ item.1.value }}"
run_once: true
delegate_to: "{{ running_mon }}"
when:
- item.1.value != omit
- running_mon is defined
loop: "{{ ceph_cluster_conf | dict2dict }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

- name: Set osd related config facts
when: inventory_hostname in groups.get(osd_group_name, [])
block:
Expand Down
21 changes: 0 additions & 21 deletions site-container.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,6 @@
status: "Complete"
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

- hosts: mons[0]
become: true
gather_facts: false
any_errors_fatal: true
tasks:
- name: Import default role
ansible.builtin.import_role:
name: ceph-defaults

- name: Set cluster configs
ceph_config:
action: set
who: "{{ item.0.key }}"
option: "{{ item.1.key }}"
value: "{{ item.1.value }}"
when: item.1.value != omit
loop: "{{ ceph_cluster_conf | dict2dict }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

- hosts: osds
become: True
gather_facts: false
Expand Down
18 changes: 0 additions & 18 deletions site.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,6 @@
status: "Complete"
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

- hosts: mons[0]
become: true
gather_facts: false
any_errors_fatal: true
tasks:
- name: Import default role
ansible.builtin.import_role:
name: ceph-defaults

- name: Set cluster configs
ceph_config:
action: set
who: "{{ item.0.key }}"
option: "{{ item.1.key }}"
value: "{{ item.1.value }}"
when: item.1.value != omit
loop: "{{ ceph_cluster_conf | dict2dict }}"

- hosts: osds
gather_facts: false
become: True
Expand Down
Loading