]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml
3564cf3cd1f4bb1f8f47026f260e839d9065fc71
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / functional / playbooks / deploy.yml
1 ---
2 # Defines deployment design and assigns role to server groups
3
4 - hosts:
5 - mons
6 - osds
7 - mgrs
8
9 gather_facts: false
10 any_errors_fatal: true
11 become: true
12
13 tags:
14 - always
15
16 vars:
17 delegate_facts_host: True
18
19 pre_tasks:
20 # If we can't get python2 installed before any module is used we will fail
21 # so just try what we can to get it installed
22 - name: check for python2
23 stat:
24 path: /usr/bin/python
25 ignore_errors: yes
26 register: systempython2
27
28 - name: install python2 for debian based systems
29 raw: sudo apt-get -y install python-simplejson
30 ignore_errors: yes
31 when:
32 - systempython2.stat is undefined or systempython2.stat.exists == false
33
34 - name: install python2 for fedora
35 raw: sudo dnf -y install python creates=/usr/bin/python
36 ignore_errors: yes
37 when:
38 - systempython2.stat is undefined or systempython2.stat.exists == false
39
40 - name: install python2 for opensuse
41 raw: sudo zypper -n install python-base creates=/usr/bin/python2.7
42 ignore_errors: yes
43 when:
44 - systempython2.stat is undefined or systempython2.stat.exists == false
45
46 - name: gather facts
47 setup:
48 when:
49 - not delegate_facts_host | bool
50
51 - name: gather and delegate facts
52 setup:
53 delegate_to: "{{ item }}"
54 delegate_facts: True
55 with_items: "{{ groups['all'] }}"
56 run_once: true
57 when:
58 - delegate_facts_host | bool
59
60 - name: install required packages for fedora > 23
61 raw: sudo dnf -y install python2-dnf libselinux-python ntp
62 when:
63 - ansible_distribution == 'Fedora'
64 - ansible_distribution_major_version|int >= 23
65
66 roles:
67 - ceph-defaults
68 - ceph-validate
69
70 - hosts:
71 - mons
72 - osds
73 - mgrs
74 gather_facts: false
75 become: True
76 any_errors_fatal: true
77 roles:
78 - role: ceph-defaults
79 tags: ['ceph_update_config']
80 - role: ceph-handler
81 - role: ceph-common
82 tasks:
83 - name: rsync ceph-volume to test nodes on centos
84 synchronize:
85 src: "{{ toxinidir}}/../../../../ceph_volume"
86 dest: "/usr/lib/python2.7/site-packages"
87 use_ssh_args: true
88 when:
89 - ansible_os_family == "RedHat"
90 - inventory_hostname in groups.get(osd_group_name, [])
91
92 - name: rsync ceph-volume to test nodes on ubuntu
93 synchronize:
94 src: "{{ toxinidir}}/../../../../ceph_volume"
95 dest: "/usr/lib/python2.7/dist-packages"
96 use_ssh_args: true
97 when:
98 - ansible_os_family == "Debian"
99 - inventory_hostname in groups.get(osd_group_name, [])
100
101 - name: run ceph-config role
102 import_role:
103 name: ceph-config
104
105 - name: run ceph-mon role
106 import_role:
107 name: ceph-mon
108 when:
109 - inventory_hostname in groups.get(mon_group_name, [])
110
111 - name: run ceph-mgr role
112 import_role:
113 name: ceph-mgr
114 when:
115 - inventory_hostname in groups.get(mgr_group_name, [])
116
117 - name: run ceph-osd role
118 import_role:
119 name: ceph-osd
120 when:
121 - inventory_hostname in groups.get(osd_group_name, [])