ceph-ansible/roles/ceph-mds/tasks/pre_requisite.yml

172 lines
4.4 KiB
YAML

---
- name: create bootstrap-mds directory (for or after infernalis release)
file:
path: /var/lib/ceph/bootstrap-mds/
state: directory
owner: ceph
group: ceph
mode: 0755
when: is_ceph_infernalis
- name: create bootstrap-mds directory (before infernalis release)
file:
path: /var/lib/ceph/bootstrap-mds/
state: directory
owner: root
group: root
mode: 0755
when: not is_ceph_infernalis
- name: copy mds bootstrap key (for or after infernalis release)
copy:
src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring"
dest: /var/lib/ceph/bootstrap-mds/ceph.keyring
owner: ceph
group: ceph
mode: 0600
when: is_ceph_infernalis
- name: copy mds bootstrap key (before infernalis release)
copy:
src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring"
dest: /var/lib/ceph/bootstrap-mds/ceph.keyring
owner: root
group: root
mode: 0600
when: not is_ceph_infernalis
- name: create mds directory (for or after infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}
state: directory
owner: ceph
group: ceph
mode: 0755
when: is_ceph_infernalis
- name: create mds directory (before infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}
state: directory
owner: root
group: root
mode: 0755
when: not is_ceph_infernalis
- name: create mds keyring
command: ceph --cluster ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.{{ ansible_hostname }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring
args:
creates: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring
changed_when: false
when: cephx
- name: set mds key permissions (for or after infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring
mode: 0600
owner: ceph
group: ceph
when:
cephx and
is_ceph_infernalis
- name: set mds key permissions (before infernalis)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring
mode: 0600
owner: root
group: root
when:
cephx and
not is_ceph_infernalis
- name: activate metadata server with upstart (for or after infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/{{ item }}
state: touch
owner: ceph
group: ceph
mode: 0600
with_items:
- done
- upstart
changed_when: false
when:
ansible_distribution == "Ubuntu" and
is_ceph_infernalis
- name: activate metadata server with upstart (before infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/{{ item }}
state: touch
owner: root
group: root
mode: 0644
with_items:
- done
- upstart
changed_when: false
when:
ansible_distribution == "Ubuntu" and
not is_ceph_infernalis
- name: activate metadata server with sysvinit (for or after infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/{{ item }}
state: touch
owner: ceph
group: ceph
mode: 0644
with_items:
- done
- sysvinit
changed_when: false
when:
ansible_distribution != "Ubuntu" and
is_ceph_infernalis
- name: activate metadata server with sysvinit (before infernalis release)
file:
path: /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/{{ item }}
state: touch
owner: root
group: root
mode: 0644
with_items:
- done
- sysvinit
changed_when: false
when:
ansible_distribution != "Ubuntu" and
not is_ceph_infernalis
- name: start and add that the metadata service to the init sequence (ubuntu)
service:
name: ceph-mds
state: started
enabled: yes
args: "id={{ ansible_hostname }}"
changed_when: false
when: ansible_distribution == "Ubuntu"
- name: start and add that the metadata service to the init sequence (before infernalis)
service:
name: ceph
state: started
enabled: yes
args: mds.{{ ansible_hostname }}
changed_when: false
when:
ansible_distribution != "Ubuntu" and
not is_ceph_infernalis
- name: start and add that the metadata service to the init sequence (for or after infernalis)
service:
name: ceph-mds@{{ ansible_hostname }}
state: started
enabled: yes
changed_when: false
when:
ansible_distribution != "Ubuntu" and
is_ceph_infernalis