mirror of https://github.com/ceph/ceph-ansible.git
docker: refactor followup
Followup on https://github.com/ceph/ceph-ansible/pull/1469 where we merged most of the container code from roles/ceph-*/task/docker/*.yml into roles/ceph-docker-common/tasks/ It seems that we forgot to remove the original files. Signed-off-by: Sébastien Han <seb@redhat.com>pull/1624/head
parent
cc7f9e874a
commit
7bb04a5970
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-mds
|
|
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
# NOTE (leseb): the mds container needs the admin key
|
|
||||||
# so it can create the mds pools for cephfs
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /etc/ceph/{{ cluster }}.client.admin.keyring
|
|
||||||
- /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
register: statconfig
|
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ ceph_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
|
@ -1,14 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /var/lib/ceph
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
|
@ -1,12 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "64045"
|
|
||||||
group: "64045"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /var/lib/ceph/mgr
|
|
||||||
- /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}
|
|
|
@ -1,43 +0,0 @@
|
||||||
---
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /etc/ceph/{{ cluster }}.mgr.{{ ansible_hostname }}.keyring
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
register: statconfig
|
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ ceph_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
||||||
|
|
||||||
- name: "copy mgr key to /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring"
|
|
||||||
command: cp /etc/ceph/{{ cluster }}.mgr.{{ ansible_hostname }}.keyring /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
with_items: "{{ statconfig.results }}"
|
|
||||||
when: item.stat.exists == true
|
|
||||||
|
|
||||||
- name: set ceph mgr key permission
|
|
||||||
file:
|
|
||||||
path: "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring"
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0600"
|
|
||||||
when: cephx
|
|
|
@ -1,14 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /var/lib/ceph
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-osd
|
|
||||||
- /var/lib/ceph/bootstrap-mds
|
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
|
|
@ -1,50 +0,0 @@
|
||||||
---
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /etc/ceph/{{ cluster }}.client.admin.keyring
|
|
||||||
- /etc/ceph/monmap-{{ cluster }}
|
|
||||||
- /etc/ceph/{{ cluster }}.mon.keyring
|
|
||||||
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
|
|
||||||
- /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
|
|
||||||
- /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring
|
|
||||||
|
|
||||||
- name: add mgr keys to config and keys paths
|
|
||||||
set_fact:
|
|
||||||
tmp_ceph_mgr_keys: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
|
|
||||||
with_items: "{{ groups.get(mgr_group_name, []) }}"
|
|
||||||
register: tmp_ceph_mgr_keys_result
|
|
||||||
when: "{{ groups.get(mgr_group_name, []) | length > 0 }}"
|
|
||||||
|
|
||||||
- name: convert mgr keys to an array
|
|
||||||
set_fact:
|
|
||||||
ceph_mgr_keys: "{{ tmp_ceph_mgr_keys_result.results | map(attribute='ansible_facts.tmp_ceph_mgr_keys') | list }}"
|
|
||||||
when: "{{ groups.get(mgr_group_name, []) | length > 0 }}"
|
|
||||||
|
|
||||||
- name: merge mgr keys to config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys: "{{ ceph_config_keys + ceph_mgr_keys }}"
|
|
||||||
when: "{{ groups.get(mgr_group_name, []) | length > 0 }}"
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
failed_when: false
|
|
||||||
register: statconfig
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ ceph_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
|
@ -1,14 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /var/lib/ceph
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
|
@ -1,24 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/
|
|
||||||
- /var/lib/ceph/radosgw
|
|
||||||
|
|
||||||
- name: create ganesha directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ganesha/
|
|
||||||
- /var/lib/nfs/ganesha
|
|
||||||
- /var/run/ganesha
|
|
|
@ -1,37 +0,0 @@
|
||||||
---
|
|
||||||
- name: set config paths
|
|
||||||
set_fact:
|
|
||||||
nfs_config_keys:
|
|
||||||
- /etc/ganesha/ganesha.conf
|
|
||||||
|
|
||||||
- name: stat for config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ nfs_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
register: statconfig
|
|
||||||
|
|
||||||
- name: try to fetch config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ nfs_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
||||||
|
|
||||||
- name: push ganesha files to the ansible server
|
|
||||||
fetch:
|
|
||||||
src: "{{ item.0 }}"
|
|
||||||
dest: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
flat: yes
|
|
||||||
with_together:
|
|
||||||
- "{{ nfs_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == false
|
|
|
@ -1,17 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /etc/ganesha
|
|
||||||
- /var/lib/ceph
|
|
||||||
- /var/lib/nfs/ganesha
|
|
||||||
- /var/run/ganesha
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-osd
|
|
|
@ -1,32 +0,0 @@
|
||||||
---
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
|
|
||||||
|
|
||||||
- name: wait for ceph.conf and keys
|
|
||||||
local_action: >
|
|
||||||
wait_for
|
|
||||||
path="{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
become: false
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
register: statconfig
|
|
||||||
|
|
||||||
- name: try to copy ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
|
@ -1,14 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /var/lib/ceph
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
|
@ -1,30 +0,0 @@
|
||||||
---
|
|
||||||
# NOTE (leseb): the mds container needs the admin key
|
|
||||||
# so it can create the mds pools for cephfs
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /etc/ceph/{{ cluster }}.client.admin.keyring
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
register: statconfig
|
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ ceph_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-osd
|
|
||||||
- /var/lib/ceph/bootstrap-mds
|
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
|
|
@ -1,28 +0,0 @@
|
||||||
---
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /etc/ceph/{{ cluster }}.client.admin.keyring
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
ignore_errors: true
|
|
||||||
register: statconfig
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ playbook_dir }}/{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ ceph_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
- name: create bootstrap directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: "{{ bootstrap_dirs_owner }}"
|
|
||||||
group: "{{ bootstrap_dirs_group }}"
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
|
|
@ -1,28 +0,0 @@
|
||||||
---
|
|
||||||
- name: set config and keys paths
|
|
||||||
set_fact:
|
|
||||||
ceph_config_keys:
|
|
||||||
- /etc/ceph/{{ cluster }}.conf
|
|
||||||
- /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
|
|
||||||
|
|
||||||
- name: stat for ceph config and keys
|
|
||||||
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
|
|
||||||
with_items: "{{ ceph_config_keys }}"
|
|
||||||
changed_when: false
|
|
||||||
become: false
|
|
||||||
ignore_errors: true
|
|
||||||
always_run: true
|
|
||||||
register: statconfig
|
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
|
||||||
copy:
|
|
||||||
src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
|
|
||||||
dest: "{{ item.0 }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
changed_when: false
|
|
||||||
with_together:
|
|
||||||
- "{{ ceph_config_keys }}"
|
|
||||||
- "{{ statconfig.results }}"
|
|
||||||
when: item.1.stat.exists == true
|
|
|
@ -1,14 +0,0 @@
|
||||||
---
|
|
||||||
- name: check if selinux is enabled
|
|
||||||
command: getenforce
|
|
||||||
register: sestatus
|
|
||||||
changed_when: false
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- name: set selinux permissions
|
|
||||||
shell: chcon -Rt svirt_sandbox_file_t {{ item }}
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph
|
|
||||||
- /var/lib/ceph
|
|
||||||
changed_when: false
|
|
||||||
when: sestatus.stdout != 'Disabled'
|
|
Loading…
Reference in New Issue