aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ceph-deploy/tasks/ceph_install_Debian.yml
blob: 77d0bc53dbb4d640435ad0505206f5af7efe1317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
- name: create ceph cluster
  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy new {{ mon_nodes.stdout_lines[0] }}
  tags:
    - create_ceph_cluster

- name: default config for ceph
  ini_file:
    dest: "{{ ceph_cluster_dir[0] }}/ceph.conf"
    section: "{{ item.section }}"
    option: "{{ item.option }}"
    value: "{{ item.value }}"
  with_items:
    - { section: "global", option: "osd_journal_size", value: "1024" }
    - { section: "global", option: "osd_pool_default_size", value: "2" }
    - { section: "global", option: "public_network", value: "{{ mgmt_cidr }}" }
    - { section: "global", option: "cluster_network", value: "{{ storage_cidr }}" }

- name: install ceph for every nodes includes jumpserver
  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy install {{ ceph_cluster_hosts.stdout_lines[0]}}
  ignore_errors: true

- name: create monitor node in controller group
  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy --overwrite-conf mon create-initial

- name: gather keys
  shell: sleep 5 && cd {{ ceph_cluster_dir[0] }} && ceph-deploy gatherkeys {{ inventory_hostname }}
  ignore_errors: True

- name: copy create_osd.sh to host1
  copy: src=create_osd.sh dest=~/create_osd.sh mode=0777
  tags:
    - create_osd

- name: copy create_osd.sh to other nodes
  shell: scp -o StrictHostKeyChecking=no ~/create_osd.sh {{ item }}:~/
  with_items:
    - "{{ groups['ceph_osd'] }}"
  tags:
    - create_osd

- name: create osd
  shell: ssh -o StrictHostKeyChecking=no -t {{ item }} "~/create_osd.sh"
  with_items:
    - "{{ groups['ceph_osd'] }}"
  tags:
    - create_osd

- name: prepare create osd
  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd prepare {{ item }}:/var/local/osd
  with_items:
    - "{{ groups['ceph_osd'] }}"
  tags:
    - create_osd


- name: activate osd
  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy osd activate {{ item }}:/var/local/osd && ceph-deploy osd activate {{ item }}:/var/local/osd
  with_items:
    - "{{ groups['ceph_osd'] }}"
  tags:
    - create_osd
    - activate_osd

- name: create admin node
  shell: cd {{ ceph_cluster_dir[0] }} && ceph-deploy admin {{ ceph_cluster_hosts.stdout_lines[0] }}