mirror of https://github.com/ceph/ceph-ansible.git
Merge pull request #1243 from guits/refact_code
Remove support of releases prior to Jewel.pull/995/head
commit
efc49e2347
|
@ -390,7 +390,7 @@
|
||||||
- is_systemd
|
- is_systemd
|
||||||
- not mds_containerized_deployment
|
- not mds_containerized_deployment
|
||||||
|
|
||||||
- name: restart ceph mdss with systemd
|
- name: restart ceph mdss
|
||||||
service:
|
service:
|
||||||
name: ceph-mds@{{ ansible_hostname }}
|
name: ceph-mds@{{ ansible_hostname }}
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
when:
|
when:
|
||||||
- item.rc != 0
|
- item.rc != 0
|
||||||
|
|
||||||
- name: stop monitor service (systemd)
|
- name: stop monitor service
|
||||||
service:
|
service:
|
||||||
name: ceph-mon@{{ item }}
|
name: ceph-mon@{{ item }}
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
copy:
|
copy:
|
||||||
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
|
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
|
||||||
dest: "/etc/ceph/"
|
dest: "/etc/ceph/"
|
||||||
owner: "{{ key_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ key_group }}"
|
group: "ceph"
|
||||||
mode: "{{ key_mode }}"
|
mode: "0600"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
|
@ -4,123 +4,39 @@
|
||||||
update-cache: yes
|
update-cache: yes
|
||||||
|
|
||||||
- name: restart ceph mons
|
- name: restart ceph mons
|
||||||
command: service ceph restart mon
|
|
||||||
when:
|
|
||||||
- socket.rc == 0
|
|
||||||
- ansible_distribution != 'Ubuntu'
|
|
||||||
- mon_group_name in group_names
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: restart ceph mons with systemd
|
|
||||||
service:
|
service:
|
||||||
name: ceph-mon@{{ monitor_name }}
|
name: ceph-mon@{{ monitor_name }}
|
||||||
state: restarted
|
state: restarted
|
||||||
when:
|
when:
|
||||||
- socket.rc == 0
|
- socket.rc == 0
|
||||||
- use_systemd
|
|
||||||
- mon_group_name in group_names
|
- mon_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: restart ceph mons on ubuntu
|
|
||||||
command: initctl restart ceph-mon cluster={{ cluster }} id={{ monitor_name }}
|
|
||||||
when:
|
|
||||||
- socket.rc == 0
|
|
||||||
- ansible_distribution == 'Ubuntu'
|
|
||||||
- not use_systemd
|
|
||||||
- mon_group_name in group_names
|
|
||||||
|
|
||||||
- name: restart ceph osds
|
|
||||||
command: service ceph restart osd
|
|
||||||
when:
|
|
||||||
- socket.rc == 0
|
|
||||||
- ansible_distribution != 'Ubuntu'
|
|
||||||
- osd_group_name in group_names
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
# This does not just restart OSDs but everything else too. Unfortunately
|
# This does not just restart OSDs but everything else too. Unfortunately
|
||||||
# at this time the ansible role does not have an OSD id list to use
|
# at this time the ansible role does not have an OSD id list to use
|
||||||
# for restarting them specifically.
|
# for restarting them specifically.
|
||||||
- name: restart ceph osds with systemd
|
- name: restart ceph osds
|
||||||
service:
|
service:
|
||||||
name: ceph.target
|
name: ceph.target
|
||||||
state: restarted
|
state: restarted
|
||||||
when:
|
when:
|
||||||
- socket.rc == 0
|
- socket.rc == 0
|
||||||
- use_systemd
|
|
||||||
- osd_group_name in group_names
|
- osd_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: restart ceph osds on ubuntu
|
|
||||||
shell: |
|
|
||||||
for id in $(ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'); do
|
|
||||||
initctl restart ceph-osd cluster={{ cluster }} id=$id
|
|
||||||
done
|
|
||||||
when:
|
|
||||||
- socket.rc == 0
|
|
||||||
- ansible_distribution == 'Ubuntu'
|
|
||||||
- not use_systemd
|
|
||||||
- osd_group_name in group_names
|
|
||||||
|
|
||||||
- name: restart ceph mdss on ubuntu
|
|
||||||
command: initctl restart ceph-mds cluster={{ cluster }} id={{ ansible_hostname }}
|
|
||||||
when:
|
|
||||||
- socket.rc == 0
|
|
||||||
- ansible_distribution == 'Ubuntu'
|
|
||||||
- not use_systemd
|
|
||||||
- mds_group_name in group_names
|
|
||||||
|
|
||||||
- name: restart ceph mdss
|
- name: restart ceph mdss
|
||||||
command: service ceph restart mds
|
|
||||||
when:
|
|
||||||
- socket.rc == 0
|
|
||||||
- ansible_distribution != 'Ubuntu'
|
|
||||||
- use_systemd
|
|
||||||
- mds_group_name in group_names
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: restart ceph mdss with systemd
|
|
||||||
service:
|
service:
|
||||||
name: ceph-mds@{{ mds_name }}
|
name: ceph-mds@{{ mds_name }}
|
||||||
state: restarted
|
state: restarted
|
||||||
when:
|
when:
|
||||||
- socket.rc == 0
|
- socket.rc == 0
|
||||||
- use_systemd
|
|
||||||
- mds_group_name in group_names
|
- mds_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: restart ceph rgws on ubuntu
|
|
||||||
command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
|
|
||||||
when:
|
|
||||||
- socketrgw.rc == 0
|
|
||||||
- ansible_distribution == 'Ubuntu'
|
|
||||||
- not use_systemd
|
|
||||||
- rgw_group_name in group_names
|
|
||||||
|
|
||||||
- name: restart ceph rgws
|
- name: restart ceph rgws
|
||||||
command: /etc/init.d/radosgw restart
|
|
||||||
when:
|
|
||||||
- socketrgw.rc == 0
|
|
||||||
- ansible_distribution != 'Ubuntu'
|
|
||||||
- rgw_group_name in group_names
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: restart ceph rgws on red hat
|
|
||||||
command: /etc/init.d/ceph-radosgw restart
|
|
||||||
when:
|
|
||||||
- socketrgw.rc == 0
|
|
||||||
- ansible_os_family == 'RedHat'
|
|
||||||
- rgw_group_name in group_names
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: restart ceph rgws with systemd
|
|
||||||
service:
|
service:
|
||||||
name: ceph-rgw@{{ ansible_hostname }}
|
name: ceph-rgw@{{ ansible_hostname }}
|
||||||
state: restarted
|
state: restarted
|
||||||
when:
|
when:
|
||||||
- socketrgw.rc == 0
|
- socketrgw.rc == 0
|
||||||
- use_systemd
|
|
||||||
- rgw_group_name in group_names
|
- rgw_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: restart ceph nfss
|
- name: restart ceph nfss
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -34,3 +34,8 @@
|
||||||
when:
|
when:
|
||||||
- ansible_version.major|int == 1
|
- ansible_version.major|int == 1
|
||||||
- ansible_version.minor|int < 9
|
- ansible_version.minor|int < 9
|
||||||
|
|
||||||
|
- name: fail if systemd is not present
|
||||||
|
fail:
|
||||||
|
msg: "Systemd must be present"
|
||||||
|
when: ansible_service_mgr != 'systemd'
|
||||||
|
|
|
@ -49,19 +49,6 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
|
ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
|
||||||
|
|
||||||
# NOTE(mattt): On ansible 2.x we can use ansible_service_mgr instead
|
|
||||||
- name: check init system
|
|
||||||
slurp:
|
|
||||||
src: /proc/1/comm
|
|
||||||
always_run: yes
|
|
||||||
register: init_system
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
init_system={{ init_system.content | b64decode | trim }}
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
use_systemd={{ init_system.strip() == 'systemd' }}
|
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
mds_name: "{{ ansible_hostname }}"
|
mds_name: "{{ ansible_hostname }}"
|
||||||
when: not mds_use_fqdn
|
when: not mds_use_fqdn
|
||||||
|
@ -70,81 +57,21 @@
|
||||||
mds_name: "{{ ansible_fqdn }}"
|
mds_name: "{{ ansible_fqdn }}"
|
||||||
when: mds_use_fqdn
|
when: mds_use_fqdn
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
dir_owner: ceph
|
|
||||||
dir_group: ceph
|
|
||||||
dir_mode: "0755"
|
|
||||||
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
dir_owner: root
|
|
||||||
dir_group: root
|
|
||||||
dir_mode: "0755"
|
|
||||||
when: ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
key_owner: root
|
|
||||||
key_group: root
|
|
||||||
key_mode: "0600"
|
|
||||||
when: ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
key_owner: ceph
|
|
||||||
key_group: ceph
|
|
||||||
key_mode: "0600"
|
|
||||||
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
activate_file_owner: ceph
|
|
||||||
activate_file_group: ceph
|
|
||||||
activate_file_mode: "0644"
|
|
||||||
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
activate_file_owner: root
|
|
||||||
activate_file_group: root
|
|
||||||
activate_file_mode: "0644"
|
|
||||||
when: ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
rbd_client_directory_owner: root
|
|
||||||
when:
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
- rbd_client_directory_owner is not defined
|
|
||||||
or not rbd_client_directory_owner
|
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
rbd_client_directory_owner: ceph
|
rbd_client_directory_owner: ceph
|
||||||
when:
|
when:
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
- rbd_client_directory_owner is not defined
|
- rbd_client_directory_owner is not defined
|
||||||
or not rbd_client_directory_owner
|
or not rbd_client_directory_owner
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
rbd_client_directory_group: root
|
|
||||||
when:
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
- rbd_client_directory_group is not defined
|
|
||||||
or not rbd_client_directory_group
|
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
rbd_client_directory_group: ceph
|
rbd_client_directory_group: ceph
|
||||||
when:
|
when:
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
- rbd_client_directory_group is not defined
|
- rbd_client_directory_group is not defined
|
||||||
or not rbd_client_directory_group
|
or not rbd_client_directory_group
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
rbd_client_directory_mode: "1777"
|
|
||||||
when:
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
- rbd_client_directory_mode is not defined
|
|
||||||
or not rbd_client_directory_mode
|
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
rbd_client_directory_mode: "0770"
|
rbd_client_directory_mode: "0770"
|
||||||
when:
|
when:
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
- rbd_client_directory_mode is not defined
|
- rbd_client_directory_mode is not defined
|
||||||
or not rbd_client_directory_mode
|
or not rbd_client_directory_mode
|
||||||
|
|
||||||
|
|
|
@ -3,32 +3,22 @@
|
||||||
file:
|
file:
|
||||||
path: /etc/ceph
|
path: /etc/ceph
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
|
|
||||||
- name: "generate ceph configuration file: {{ cluster }}.conf"
|
- name: "generate ceph configuration file: {{ cluster }}.conf"
|
||||||
action: config_template
|
action: config_template
|
||||||
args:
|
args:
|
||||||
src: ceph.conf.j2
|
src: ceph.conf.j2
|
||||||
dest: /etc/ceph/{{ cluster }}.conf
|
dest: /etc/ceph/{{ cluster }}.conf
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ activate_file_mode }}"
|
mode: "0644"
|
||||||
config_overrides: "{{ ceph_conf_overrides }}"
|
config_overrides: "{{ ceph_conf_overrides }}"
|
||||||
config_type: ini
|
config_type: ini
|
||||||
notify:
|
notify:
|
||||||
- restart ceph mons
|
- restart ceph mons
|
||||||
- restart ceph mons on ubuntu
|
|
||||||
- restart ceph mons with systemd
|
|
||||||
- restart ceph osds
|
- restart ceph osds
|
||||||
- restart ceph osds on ubuntu
|
|
||||||
- restart ceph osds with systemd
|
|
||||||
- restart ceph mdss
|
- restart ceph mdss
|
||||||
- restart ceph mdss on ubuntu
|
|
||||||
- restart ceph mdss with systemd
|
|
||||||
- restart ceph rgws
|
- restart ceph rgws
|
||||||
- restart ceph rgws on ubuntu
|
|
||||||
- restart ceph rgws on red hat
|
|
||||||
- restart ceph rgws with systemd
|
|
||||||
- restart ceph nfss
|
|
||||||
|
|
|
@ -49,15 +49,6 @@
|
||||||
- ceph_origin == 'local'
|
- ceph_origin == 'local'
|
||||||
- use_installer
|
- use_installer
|
||||||
|
|
||||||
- name: install ceph
|
|
||||||
yum:
|
|
||||||
name: ceph
|
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
|
||||||
when:
|
|
||||||
- ceph_release_num.{{ ceph_release }} <= ceph_release_num.infernalis
|
|
||||||
- ansible_pkg_mgr == "yum"
|
|
||||||
- ceph_origin != 'local'
|
|
||||||
|
|
||||||
- name: synchronize ceph install
|
- name: synchronize ceph install
|
||||||
synchronize:
|
synchronize:
|
||||||
src: "{{ceph_installation_dir}}/"
|
src: "{{ceph_installation_dir}}/"
|
||||||
|
@ -83,7 +74,6 @@
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
when:
|
when:
|
||||||
- mon_group_name in group_names
|
- mon_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
|
|
||||||
or ceph_origin == "distro"
|
or ceph_origin == "distro"
|
||||||
or ceph_custom
|
or ceph_custom
|
||||||
|
|
||||||
|
@ -93,7 +83,6 @@
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
when:
|
when:
|
||||||
- osd_group_name in group_names
|
- osd_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
|
|
||||||
or ceph_origin == "distro"
|
or ceph_origin == "distro"
|
||||||
or ceph_custom
|
or ceph_custom
|
||||||
|
|
||||||
|
@ -103,7 +92,6 @@
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
when:
|
when:
|
||||||
- mds_group_name in group_names
|
- mds_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
|
|
||||||
or ceph_origin == "distro"
|
or ceph_origin == "distro"
|
||||||
or ceph_custom
|
or ceph_custom
|
||||||
|
|
||||||
|
@ -113,7 +101,6 @@
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
when:
|
when:
|
||||||
- client_group_name in group_names
|
- client_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
|
|
||||||
or ceph_origin == "distro"
|
or ceph_origin == "distro"
|
||||||
or ceph_dev
|
or ceph_dev
|
||||||
or ceph_custom
|
or ceph_custom
|
||||||
|
@ -124,7 +111,6 @@
|
||||||
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
||||||
when:
|
when:
|
||||||
- client_group_name in group_names
|
- client_group_name in group_names
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis
|
|
||||||
or ceph_origin == "distro"
|
or ceph_origin == "distro"
|
||||||
or ceph_custom
|
or ceph_custom
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,5 @@
|
||||||
---
|
---
|
||||||
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
- name: create bootstrap directories
|
||||||
# https://github.com/ansible/ansible/issues/10156
|
|
||||||
- name: inspect ceph version
|
|
||||||
shell: docker inspect "{{ ceph_docker_registry }}/{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
run_once: true
|
|
||||||
always_run: true
|
|
||||||
register: ceph_version
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hammer=True
|
|
||||||
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-mds
|
|
||||||
when: not after_hammer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -35,4 +9,3 @@
|
||||||
with_items:
|
with_items:
|
||||||
- /etc/ceph/
|
- /etc/ceph/
|
||||||
- /var/lib/ceph/bootstrap-mds
|
- /var/lib/ceph/bootstrap-mds
|
||||||
when: after_hammer
|
|
||||||
|
|
|
@ -3,17 +3,17 @@
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/bootstrap-mds/
|
path: /var/lib/ceph/bootstrap-mds/
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
|
|
||||||
- name: copy mds bootstrap key
|
- name: copy mds bootstrap key
|
||||||
copy:
|
copy:
|
||||||
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
||||||
dest: "{{ item.name }}"
|
dest: "{{ item.name }}"
|
||||||
owner: "{{ key_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ key_group }}"
|
group: "ceph"
|
||||||
mode: "{{ key_mode }}"
|
mode: "0600"
|
||||||
with_items:
|
with_items:
|
||||||
- { name: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true }
|
- { name: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true }
|
||||||
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
||||||
|
@ -25,9 +25,9 @@
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}
|
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
|
|
||||||
- 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
|
||||||
|
@ -39,68 +39,14 @@
|
||||||
- name: set mds key permissions
|
- name: set mds key permissions
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring
|
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring
|
||||||
mode: "{{ key_mode }}"
|
owner: "ceph"
|
||||||
owner: "{{ key_owner }}"
|
group: "ceph"
|
||||||
group: "{{ key_group }}"
|
mode: "0600"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: activate metadata server with upstart
|
- name: start and add that the metadata service to the init sequence
|
||||||
file:
|
|
||||||
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/{{ item }}
|
|
||||||
state: touch
|
|
||||||
owner: "{{ activate_file_owner }}"
|
|
||||||
group: "{{ activate_file_group }}"
|
|
||||||
mode: "{{ activate_file_mode }}"
|
|
||||||
with_items:
|
|
||||||
- done
|
|
||||||
- upstart
|
|
||||||
changed_when: false
|
|
||||||
when: not use_systemd
|
|
||||||
|
|
||||||
- name: activate metadata server with sysvinit
|
|
||||||
file:
|
|
||||||
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/{{ item }}
|
|
||||||
state: touch
|
|
||||||
owner: "{{ activate_file_owner }}"
|
|
||||||
group: "{{ activate_file_group }}"
|
|
||||||
mode: "{{ activate_file_mode }}"
|
|
||||||
with_items:
|
|
||||||
- done
|
|
||||||
- sysvinit
|
|
||||||
changed_when: false
|
|
||||||
when: not use_systemd
|
|
||||||
|
|
||||||
- name: enable systemd unit file for mds instance (for or after infernalis)
|
|
||||||
command: systemctl enable ceph-mds@{{ mds_name }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: start and add that the metadata service to the init sequence (upstart)
|
|
||||||
command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when: not use_systemd
|
|
||||||
|
|
||||||
- name: start and add that the metadata service to the init sequence (systemd before infernalis)
|
|
||||||
service:
|
|
||||||
name: ceph
|
|
||||||
state: started
|
|
||||||
enabled: yes
|
|
||||||
args: mds.{{ mds_name }}
|
|
||||||
changed_when: false
|
|
||||||
when:
|
|
||||||
- not use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: start and add that the metadata service to the init sequence (systemd after hammer)
|
|
||||||
service:
|
service:
|
||||||
name: ceph-mds@{{ mds_name }}
|
name: ceph-mds@{{ mds_name }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
always_run: true
|
always_run: true
|
||||||
when:
|
when:
|
||||||
- cephx
|
- cephx
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.jewel
|
|
||||||
|
|
||||||
# NOTE (leseb): wait for mon discovery and quorum resolution
|
# NOTE (leseb): wait for mon discovery and quorum resolution
|
||||||
# the admin key is not instantaneously created so we have to wait a bit
|
# the admin key is not instantaneously created so we have to wait a bit
|
||||||
|
@ -112,9 +111,9 @@
|
||||||
- name: set keys permissions
|
- name: set keys permissions
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
mode: "{{ key_mode }}"
|
owner: "ceph"
|
||||||
owner: "{{ key_owner }}"
|
group: "ceph"
|
||||||
group: "{{ key_group }}"
|
mode: "0600"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ ceph_keys.get('stdout_lines') | default([]) }}"
|
- "{{ ceph_keys.get('stdout_lines') | default([]) }}"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
|
@ -9,24 +9,20 @@
|
||||||
- cephfs_data
|
- cephfs_data
|
||||||
- cephfs_metadata
|
- cephfs_metadata
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.firefly
|
|
||||||
|
|
||||||
- name: create ceph filesystem
|
- name: create ceph filesystem
|
||||||
command: ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
|
command: ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: ceph_release_num.{{ ceph_release }} > ceph_release_num.firefly
|
|
||||||
|
|
||||||
- name: allow multimds
|
- name: allow multimds
|
||||||
command: ceph --cluster {{ cluster }} fs set {{ cephfs }} allow_multimds true --yes-i-really-mean-it
|
command: ceph --cluster {{ cluster }} fs set {{ cephfs }} allow_multimds true --yes-i-really-mean-it
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel
|
|
||||||
- mds_allow_multimds
|
- mds_allow_multimds
|
||||||
|
|
||||||
- name: set max_mds
|
- name: set max_mds
|
||||||
command: ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}
|
command: ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel
|
|
||||||
- mds_allow_multimds
|
- mds_allow_multimds
|
||||||
- mds_max_mds > 1
|
- mds_max_mds > 1
|
||||||
|
|
|
@ -24,47 +24,29 @@
|
||||||
- name: set initial monitor key permissions
|
- name: set initial monitor key permissions
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
|
path: /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
|
||||||
mode: "{{ key_mode }}"
|
owner: "ceph"
|
||||||
owner: "{{ key_owner }}"
|
group: "ceph"
|
||||||
group: "{{ key_group }}"
|
mode: "0600"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: create monitor directory
|
- name: create monitor directory
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}
|
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
|
|
||||||
- name: ceph monitor mkfs with keyring (for or after infernalis release)
|
- name: ceph monitor mkfs with keyring
|
||||||
command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
|
command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
|
||||||
args:
|
args:
|
||||||
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
|
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
|
||||||
when:
|
when:
|
||||||
- cephx
|
- cephx
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: ceph monitor mkfs without keyring (for or after infernalis release)
|
- name: ceph monitor mkfs without keyring
|
||||||
command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
|
command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
|
||||||
args:
|
args:
|
||||||
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
|
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
|
||||||
when:
|
when:
|
||||||
- not cephx
|
- not cephx
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: ceph monitor mkfs with keyring (before infernalis release)
|
|
||||||
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
|
|
||||||
args:
|
|
||||||
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
|
|
||||||
when:
|
|
||||||
- cephx
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: ceph monitor mkfs without keyring (before infernalis release)
|
|
||||||
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
|
|
||||||
args:
|
|
||||||
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
|
|
||||||
when:
|
|
||||||
- not cephx
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
|
@ -1,34 +1,5 @@
|
||||||
---
|
---
|
||||||
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
- name: create bootstrap directories
|
||||||
# https://github.com/ansible/ansible/issues/10156
|
|
||||||
- name: inspect ceph version
|
|
||||||
shell: docker inspect "{{ ceph_docker_registry }}/{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
run_once: true
|
|
||||||
register: ceph_version
|
|
||||||
always_run: true
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hamer=True
|
|
||||||
when:
|
|
||||||
ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-osd
|
|
||||||
- /var/lib/ceph/bootstrap-mds
|
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
|
||||||
when: not after_hamer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -40,4 +11,3 @@
|
||||||
- /var/lib/ceph/bootstrap-osd
|
- /var/lib/ceph/bootstrap-osd
|
||||||
- /var/lib/ceph/bootstrap-mds
|
- /var/lib/ceph/bootstrap-mds
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
- /var/lib/ceph/bootstrap-rgw
|
||||||
when: after_hamer
|
|
||||||
|
|
|
@ -3,11 +3,9 @@
|
||||||
command: rados --cluster {{ cluster }} lspools
|
command: rados --cluster {{ cluster }} lspools
|
||||||
register: ceph_pools
|
register: ceph_pools
|
||||||
always_run: true
|
always_run: true
|
||||||
when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: secure the cluster
|
- name: secure the cluster
|
||||||
command: ceph --cluster {{ cluster }} osd pool set {{ item[0] }} {{ item[1] }} true
|
command: ceph --cluster {{ cluster }} osd pool set {{ item[0] }} {{ item[1] }} true
|
||||||
with_nested:
|
with_nested:
|
||||||
- "{{ ceph_pools.stdout_lines|default([]) }}"
|
- "{{ ceph_pools.stdout_lines|default([]) }}"
|
||||||
- "{{ secure_cluster_flags }}"
|
- "{{ secure_cluster_flags }}"
|
||||||
when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.hammer
|
|
||||||
|
|
|
@ -1,62 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: activate monitor with upstart
|
- name: start the monitor service
|
||||||
file:
|
|
||||||
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/{{ item }}
|
|
||||||
state: touch
|
|
||||||
owner: "{{ activate_file_owner }}"
|
|
||||||
group: "{{ activate_file_group }}"
|
|
||||||
mode: "{{ activate_file_mode }}"
|
|
||||||
changed_when: false
|
|
||||||
with_items:
|
|
||||||
- done
|
|
||||||
- upstart
|
|
||||||
when:
|
|
||||||
- not use_systemd
|
|
||||||
|
|
||||||
- name: start and add that the monitor service to the init sequence (ubuntu)
|
|
||||||
command: initctl emit ceph-mon cluster={{ cluster }} id={{ monitor_name }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when:
|
|
||||||
- not use_systemd
|
|
||||||
|
|
||||||
# legacy ceph system v init scripts require a mon section in order to work
|
|
||||||
# Not Ubuntu so we can catch old debian systems that don't use systemd or upstart
|
|
||||||
- name: add mon section into ceph.conf for systemv init scripts
|
|
||||||
ini_file:
|
|
||||||
dest: /etc/ceph/{{ cluster }}.conf
|
|
||||||
section: mon.{{ monitor_name }}
|
|
||||||
option: host
|
|
||||||
value: "{{ monitor_name }}"
|
|
||||||
state: present
|
|
||||||
when:
|
|
||||||
- ansible_os_family != "Ubuntu"
|
|
||||||
- ceph_release_num.{{ ceph_stable_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
# NOTE (jsaintrocc): can't use service module because we need to use the
|
|
||||||
# legacy systemv init for older ceph releases. Even when the os supports systemd
|
|
||||||
# Not Ubuntu so we can catch old debian systems that don't use systemd or upstart
|
|
||||||
- name: start and add that the monitor service to the init sequence
|
|
||||||
command: service ceph start mon
|
|
||||||
changed_when: false
|
|
||||||
when:
|
|
||||||
- ansible_os_family != "Ubuntu"
|
|
||||||
- ceph_release_num.{{ ceph_stable_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: start and add that the monitor service to the init sequence (for or after infernalis)
|
|
||||||
command: systemctl enable ceph-mon@{{ monitor_name }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: start the monitor service (for or after infernalis)
|
|
||||||
service:
|
service:
|
||||||
name: ceph-mon@{{ monitor_name }}
|
name: ceph-mon@{{ monitor_name }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
|
@ -1,32 +1,5 @@
|
||||||
---
|
---
|
||||||
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
- name: create bootstrap directories
|
||||||
# https://github.com/ansible/ansible/issues/10156
|
|
||||||
- name: inspect ceph version
|
|
||||||
shell: docker inspect "{{ ceph_docker_registry }}/{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
run_once: true
|
|
||||||
always_run: true
|
|
||||||
register: ceph_version
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hammer=True
|
|
||||||
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/
|
|
||||||
- /var/lib/ceph/radosgw
|
|
||||||
when: not after_hammer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -37,7 +10,6 @@
|
||||||
- /etc/ceph/
|
- /etc/ceph/
|
||||||
- /var/lib/ceph/
|
- /var/lib/ceph/
|
||||||
- /var/lib/ceph/radosgw
|
- /var/lib/ceph/radosgw
|
||||||
when: after_hammer
|
|
||||||
|
|
||||||
- name: create ganesha directories
|
- name: create ganesha directories
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
with_items:
|
with_items:
|
||||||
- /var/lib/nfs/ganesha
|
- /var/lib/nfs/ganesha
|
||||||
- /var/run/ganesha
|
- /var/run/ganesha
|
||||||
|
|
|
@ -81,51 +81,17 @@
|
||||||
- include: osd_fragment.yml
|
- include: osd_fragment.yml
|
||||||
when: crush_location
|
when: crush_location
|
||||||
|
|
||||||
- name: set selinux to permissive and make it persistent
|
- name: get osd id
|
||||||
selinux:
|
|
||||||
policy: targeted
|
|
||||||
state: permissive
|
|
||||||
when:
|
|
||||||
- ansible_selinux != false
|
|
||||||
- ansible_selinux['status'] == 'enabled'
|
|
||||||
- ansible_selinux['config_mode'] != 'disabled'
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: start and add that the osd service(s) to the init sequence (before infernalis)
|
|
||||||
service:
|
|
||||||
name: ceph
|
|
||||||
state: started
|
|
||||||
enabled: yes
|
|
||||||
when:
|
|
||||||
- ansible_distribution != "Ubuntu"
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: get osd id (for or after infernalis)
|
|
||||||
shell: 'ls /var/lib/ceph/osd/ | grep -oP "\d+$"'
|
shell: 'ls /var/lib/ceph/osd/ | grep -oP "\d+$"'
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
always_run: true
|
always_run: true
|
||||||
register: osd_id
|
register: osd_id
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: enable the osd service (for or after infernalis)
|
- name: start and add that the osd service(s) to the init sequence
|
||||||
command: systemctl enable ceph-osd@{{ item }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}"
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: start and add that the osd service(s) to the init sequence (for or after infernalis)
|
|
||||||
service:
|
service:
|
||||||
name: ceph-osd@{{ item }}
|
name: ceph-osd@{{ item }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}"
|
with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
|
@ -1,31 +1,5 @@
|
||||||
---
|
---
|
||||||
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
- name: create bootstrap directories
|
||||||
# https://github.com/ansible/ansible/issues/10156
|
|
||||||
- name: inspect ceph version
|
|
||||||
shell: docker inspect "{{ ceph_docker_registry }}/{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
run_once: true
|
|
||||||
always_run: true
|
|
||||||
register: ceph_version
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hamer=True
|
|
||||||
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-osd
|
|
||||||
when: not after_hamer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -35,4 +9,3 @@
|
||||||
with_items:
|
with_items:
|
||||||
- /etc/ceph/
|
- /etc/ceph/
|
||||||
- /var/lib/ceph/bootstrap-osd
|
- /var/lib/ceph/bootstrap-osd
|
||||||
when: after_hamer
|
|
||||||
|
|
|
@ -36,9 +36,9 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
with_items:
|
with_items:
|
||||||
- /etc/ceph/ceph.d/
|
- /etc/ceph/ceph.d/
|
||||||
- /etc/ceph/ceph.d/osd_fragments
|
- /etc/ceph/ceph.d/osd_fragments
|
||||||
|
@ -47,9 +47,9 @@
|
||||||
template:
|
template:
|
||||||
src: osd.conf.j2
|
src: osd.conf.j2
|
||||||
dest: /etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf
|
dest: /etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ activate_file_mode }}"
|
mode: "0644"
|
||||||
with_items: "{{ combined_osd_id.results }}"
|
with_items: "{{ combined_osd_id.results }}"
|
||||||
|
|
||||||
- name: copy {{ cluster }}.conf for assembling
|
- name: copy {{ cluster }}.conf for assembling
|
||||||
|
@ -60,14 +60,14 @@
|
||||||
assemble:
|
assemble:
|
||||||
src: /etc/ceph/ceph.d/osd_fragments/
|
src: /etc/ceph/ceph.d/osd_fragments/
|
||||||
dest: /etc/ceph/ceph.d/osd.conf
|
dest: /etc/ceph/ceph.d/osd.conf
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ activate_file_mode }}"
|
mode: "0644"
|
||||||
|
|
||||||
- name: assemble {{ cluster }}.conf and osd fragments
|
- name: assemble {{ cluster }}.conf and osd fragments
|
||||||
assemble:
|
assemble:
|
||||||
src: /etc/ceph/ceph.d/
|
src: /etc/ceph/ceph.d/
|
||||||
dest: /etc/ceph/{{ cluster }}.conf
|
dest: /etc/ceph/{{ cluster }}.conf
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ activate_file_mode }}"
|
mode: "0644"
|
||||||
|
|
|
@ -16,10 +16,11 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
when: cephx
|
when:
|
||||||
|
cephx
|
||||||
with_items:
|
with_items:
|
||||||
- /var/lib/ceph/bootstrap-osd/
|
- /var/lib/ceph/bootstrap-osd/
|
||||||
- /var/lib/ceph/osd/
|
- /var/lib/ceph/osd/
|
||||||
|
@ -34,9 +35,9 @@
|
||||||
copy:
|
copy:
|
||||||
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
||||||
dest: "{{ item.name }}"
|
dest: "{{ item.name }}"
|
||||||
owner: "{{ key_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ key_group }}"
|
group: "ceph"
|
||||||
mode: "{{ key_mode }}"
|
mode: "0600"
|
||||||
with_items:
|
with_items:
|
||||||
- { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
|
- { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
|
||||||
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
with_items: "{{ osd_directories }}"
|
with_items: "{{ osd_directories }}"
|
||||||
|
|
||||||
# NOTE (leseb): the prepare process must be parallelized somehow...
|
# NOTE (leseb): the prepare process must be parallelized somehow...
|
||||||
|
@ -26,16 +26,8 @@
|
||||||
with_items: "{{ osd_directories }}"
|
with_items: "{{ osd_directories }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: start and add that the OSD service to the init sequence
|
|
||||||
service:
|
|
||||||
name: ceph
|
|
||||||
state: started
|
|
||||||
enabled: yes
|
|
||||||
when: not use_systemd
|
|
||||||
|
|
||||||
- name: start and add the OSD target to the systemd sequence
|
- name: start and add the OSD target to the systemd sequence
|
||||||
service:
|
service:
|
||||||
name: ceph.target
|
name: ceph.target
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when: use_systemd
|
|
||||||
|
|
|
@ -1,30 +1,5 @@
|
||||||
---
|
---
|
||||||
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
- name: create bootstrap directories
|
||||||
# https://github.com/ansible/ansible/issues/10156
|
|
||||||
- name: inspect ceph version
|
|
||||||
shell: docker inspect "{{ ceph_docker_registry}}/{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}:{{ ceph_rbd_mirror_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
run_once: true
|
|
||||||
register: ceph_version
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hammer=True
|
|
||||||
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
when: not after_hammer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -33,4 +8,3 @@
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
with_items:
|
with_items:
|
||||||
- /etc/ceph/
|
- /etc/ceph/
|
||||||
when: after_hammer
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
copy:
|
copy:
|
||||||
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
|
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
|
||||||
dest: "/etc/ceph/{{ cluster }}.client.admin.keyring"
|
dest: "/etc/ceph/{{ cluster }}.client.admin.keyring"
|
||||||
owner: "{{ key_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ key_group }}"
|
group: "ceph"
|
||||||
mode: "{{ key_mode }}"
|
mode: "0600"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
|
@ -1,33 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: start and add that the rbd mirror service to the init sequence (upstart)
|
- name: start and add that the rbd mirror service to the init sequence
|
||||||
command: initctl emit ceph-rbd-mirror cluster={{ cluster }} id={{ ansible_hostname }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when: not use_systemd
|
|
||||||
|
|
||||||
# NOTE (leseb): somehow the service ansible module is messing things up
|
|
||||||
# as a safety measure we run the raw command
|
|
||||||
- name: start and add that the rbd mirror service to the init sequence (systemd before infernalis)
|
|
||||||
command: service ceph start ceph-rbd-mirror
|
|
||||||
changed_when: false
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: enable systemd unit file for the rbd mirror service (systemd after hammer)
|
|
||||||
command: systemctl enable ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: start and add that the rbd mirror service to the init sequence (systemd after hammer)
|
|
||||||
service:
|
service:
|
||||||
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"
|
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
|
@ -1,31 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: inspect ceph version
|
- name: create bootstrap directories
|
||||||
shell: docker inspect "{{ ceph_docker_registry}}/{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
run_once: true
|
|
||||||
always_run: true
|
|
||||||
register: ceph_version
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hammer=True
|
|
||||||
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-osd
|
|
||||||
- /var/lib/ceph/bootstrap-mds
|
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
|
||||||
when: not after_hammer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -37,4 +11,3 @@
|
||||||
- /var/lib/ceph/bootstrap-osd
|
- /var/lib/ceph/bootstrap-osd
|
||||||
- /var/lib/ceph/bootstrap-mds
|
- /var/lib/ceph/bootstrap-mds
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
- /var/lib/ceph/bootstrap-rgw
|
||||||
when: after_hammer
|
|
||||||
|
|
|
@ -3,26 +3,26 @@
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/restapi/ceph-restapi
|
path: /var/lib/ceph/restapi/ceph-restapi
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
|
|
||||||
- name: copy ceph rest api keyring
|
- name: copy ceph rest api keyring
|
||||||
copy:
|
copy:
|
||||||
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.restapi.keyring"
|
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.restapi.keyring"
|
||||||
dest: "/var/lib/ceph/restapi/ceph-restapi/keyring"
|
dest: "/var/lib/ceph/restapi/ceph-restapi/keyring"
|
||||||
owner: "{{ key_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ key_group }}"
|
group: "ceph"
|
||||||
mode: "{{ key_mode }}"
|
mode: "0600"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: activate ceph rest api with upstart
|
- name: activate ceph rest api with upstart
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/restapi/{{ item }}
|
path: /var/lib/ceph/restapi/{{ item }}
|
||||||
state: touch
|
state: touch
|
||||||
owner: "{{ activate_file_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ activate_file_group }}"
|
group: "ceph"
|
||||||
mode: "{{ activate_file_mode }}"
|
mode: "0644"
|
||||||
with_items:
|
with_items:
|
||||||
- done
|
- done
|
||||||
- upstart
|
- upstart
|
||||||
|
@ -33,9 +33,9 @@
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/restapi/{{ item }}
|
path: /var/lib/ceph/restapi/{{ item }}
|
||||||
state: touch
|
state: touch
|
||||||
owner: "{{ activate_file_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ activate_file_group }}"
|
group: "ceph"
|
||||||
mode: "{{ activate_file_mode }}"
|
mode: "0644"
|
||||||
with_items:
|
with_items:
|
||||||
- done
|
- done
|
||||||
- sysvinit
|
- sysvinit
|
||||||
|
|
|
@ -1,31 +1,5 @@
|
||||||
---
|
---
|
||||||
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
- name: create bootstrap directories
|
||||||
# https://github.com/ansible/ansible/issues/10156
|
|
||||||
- name: inspect ceph version
|
|
||||||
shell: docker inspect "{{ ceph_docker_registry }}/{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
always_run: true
|
|
||||||
run_once: true
|
|
||||||
register: ceph_version
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
after_hammer=True
|
|
||||||
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
||||||
|
|
||||||
- name: create bootstrap directories (for or before hammer)
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
with_items:
|
|
||||||
- /etc/ceph/
|
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
|
||||||
when: not after_hammer
|
|
||||||
|
|
||||||
- name: create bootstrap directories (after hammer)
|
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -35,4 +9,3 @@
|
||||||
with_items:
|
with_items:
|
||||||
- /etc/ceph/
|
- /etc/ceph/
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
- /var/lib/ceph/bootstrap-rgw
|
||||||
when: after_hammer
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
when:
|
when:
|
||||||
- rgw_zone is defined
|
- rgw_zone is defined
|
||||||
- rgw_multisite
|
- rgw_multisite
|
||||||
- ( ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel )
|
|
||||||
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
|
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
|
||||||
static: False
|
static: False
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ dir_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ dir_group }}"
|
group: "ceph"
|
||||||
mode: "{{ dir_mode }}"
|
mode: "0755"
|
||||||
with_items:
|
with_items:
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
- /var/lib/ceph/bootstrap-rgw
|
||||||
- /var/lib/ceph/radosgw
|
- /var/lib/ceph/radosgw
|
||||||
|
@ -16,9 +16,9 @@
|
||||||
copy:
|
copy:
|
||||||
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
|
||||||
dest: "{{ item.name }}"
|
dest: "{{ item.name }}"
|
||||||
owner: "{{ key_owner }}"
|
owner: "ceph"
|
||||||
group: "{{ key_group }}"
|
group: "ceph"
|
||||||
mode: "{{ key_mode }}"
|
mode: "0600"
|
||||||
with_items:
|
with_items:
|
||||||
- { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
|
- { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
|
||||||
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
|
||||||
|
@ -33,52 +33,14 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: set rados gateway key permissions (for or after the infernalis release)
|
- 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_hostname }}/keyring
|
||||||
mode: "{{ key_mode }}"
|
owner: "ceph"
|
||||||
owner: "{{ key_owner }}"
|
group: "ceph"
|
||||||
group: "{{ key_group }}"
|
mode: "0600"
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: ensure ceph-radosgw systemd unit file is present
|
|
||||||
command: chkconfig --add ceph-radosgw
|
|
||||||
args:
|
|
||||||
creates: /var/run/systemd/generator.late/ceph-radosgw.service
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: activate rados gateway with upstart
|
|
||||||
file:
|
|
||||||
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/{{ item }}
|
|
||||||
state: touch
|
|
||||||
owner: "{{ activate_file_owner }}"
|
|
||||||
group: "{{ activate_file_group }}"
|
|
||||||
mode: "{{ activate_file_mode }}"
|
|
||||||
with_items:
|
|
||||||
- done
|
|
||||||
- upstart
|
|
||||||
changed_when: false
|
|
||||||
when:
|
|
||||||
- ansible_distribution == "Ubuntu"
|
|
||||||
- not use_systemd
|
|
||||||
|
|
||||||
- name: activate rados gateway with sysvinit
|
|
||||||
file:
|
|
||||||
path: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/{{ item }}
|
|
||||||
state: touch
|
|
||||||
owner: "{{ activate_file_owner }}"
|
|
||||||
group: "{{ activate_file_group }}"
|
|
||||||
mode: "{{ activate_file_mode }}"
|
|
||||||
with_items:
|
|
||||||
- done
|
|
||||||
- sysvinit
|
|
||||||
changed_when: false
|
|
||||||
when:
|
|
||||||
- ansible_distribution != "Ubuntu"
|
|
||||||
- not use_systemd
|
|
||||||
|
|
||||||
- name: generate rados gateway sudoers file
|
- name: generate rados gateway sudoers file
|
||||||
template:
|
template:
|
||||||
src: ceph.j2
|
src: ceph.j2
|
||||||
|
|
|
@ -7,41 +7,7 @@
|
||||||
always_run: true
|
always_run: true
|
||||||
|
|
||||||
- name: start rgw
|
- name: start rgw
|
||||||
command: /etc/init.d/radosgw start
|
|
||||||
when:
|
|
||||||
- rgwstatus.rc != 0
|
|
||||||
- ansible_distribution != "Ubuntu"
|
|
||||||
- ansible_os_family != 'RedHat'
|
|
||||||
- not use_systemd
|
|
||||||
|
|
||||||
- name: start and add that the rados gateway service to the init sequence (ubuntu)
|
|
||||||
command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when: not use_systemd
|
|
||||||
|
|
||||||
- name: start rgw on red hat (before or on infernalis)
|
|
||||||
service:
|
|
||||||
name: ceph-radosgw
|
|
||||||
state: started
|
|
||||||
enabled: yes
|
|
||||||
when:
|
|
||||||
- ansible_os_family == 'RedHat'
|
|
||||||
- ceph_release_num.{{ ceph_release }} < ceph_release_num.infernalis
|
|
||||||
|
|
||||||
- name: enable systemd unit file for rgw instance (for or after infernalis)
|
|
||||||
command: systemctl enable ceph-radosgw@rgw.{{ ansible_hostname }}
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
||||||
- name: start rgw with systemd (for or after infernalis)
|
|
||||||
service:
|
service:
|
||||||
name: ceph-radosgw@rgw.{{ ansible_hostname }}
|
name: ceph-radosgw@rgw.{{ ansible_hostname }}
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when:
|
|
||||||
- use_systemd
|
|
||||||
- ceph_release_num.{{ ceph_release }} > ceph_release_num.hammer
|
|
||||||
|
|
Loading…
Reference in New Issue