]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/playbooks/deploy.yml
import ceph 14.2.5
[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 dashboard_enabled: False
19
20 environment:
21 DEBIAN_FRONTEND: noninteractive
22
23 pre_tasks:
24 # If we can't get python2 installed before any module is used we will fail
25 # so just try what we can to get it installed
26 - name: check for python2
27 stat:
28 path: /usr/bin/python
29 ignore_errors: yes
30 register: systempython2
31
32 - name: install python2 for debian based systems
33 raw: sudo apt-get -y install python-simplejson
34 ignore_errors: yes
35 when:
36 - systempython2.stat is undefined or systempython2.stat.exists == false
37
38 # Ansible will try to auto-install python-apt, in some systems this might be
39 # python3-apt, or python-apt, and it has caused whole runs to fail because
40 # it is trying to do an interactive prompt
41 - name: install python-apt and aptitude in debian based systems
42 raw: sudo apt-get -y install "{{ item }}"
43 ignore_errors: yes
44 with_items:
45 - python3-apt
46 - python-apt
47 - aptitude
48
49 - name: install python2 for fedora
50 raw: sudo dnf -y install python creates=/usr/bin/python
51 ignore_errors: yes
52 when:
53 - systempython2.stat is undefined or systempython2.stat.exists == false
54
55 - name: install python2 for opensuse
56 raw: sudo zypper -n install python-base creates=/usr/bin/python2.7
57 ignore_errors: yes
58 when:
59 - systempython2.stat is undefined or systempython2.stat.exists == false
60
61 - name: gather facts
62 setup:
63 when:
64 - not delegate_facts_host | bool
65
66 - name: gather and delegate facts
67 setup:
68 delegate_to: "{{ item }}"
69 delegate_facts: True
70 with_items: "{{ groups['all'] }}"
71 run_once: true
72 when:
73 - delegate_facts_host | bool
74
75 - name: install required packages for fedora > 23
76 raw: sudo dnf -y install python2-dnf libselinux-python ntp
77 when:
78 - ansible_distribution == 'Fedora'
79 - ansible_distribution_major_version|int >= 23
80
81 - name: check if it is atomic host
82 stat:
83 path: /run/ostree-booted
84 register: stat_ostree
85
86 - name: set_fact is_atomic
87 set_fact:
88 is_atomic: '{{ stat_ostree.stat.exists }}'
89
90 tasks:
91 - import_role:
92 name: ceph-defaults
93 - import_role:
94 name: ceph-validate
95
96 - hosts:
97 - mons
98 - osds
99 - mgrs
100 gather_facts: false
101 become: True
102 any_errors_fatal: true
103 vars:
104 dashboard_enabled: False
105 tasks:
106 - import_role:
107 name: ceph-defaults
108 - import_role:
109 name: ceph-facts
110 - import_role:
111 name: ceph-handler
112 - import_role:
113 name: ceph-common
114
115 - name: rsync ceph-volume to test nodes on centos
116 synchronize:
117 src: "{{ toxinidir }}/../../../../ceph_volume"
118 dest: "/usr/lib/python2.7/site-packages"
119 use_ssh_args: true
120 when:
121 - ansible_os_family == "RedHat"
122 - inventory_hostname in groups.get(osd_group_name, [])
123
124 - name: rsync ceph-volume to test nodes on ubuntu
125 synchronize:
126 src: "{{ toxinidir }}/../../../../ceph_volume"
127 dest: "/usr/lib/python2.7/dist-packages"
128 use_ssh_args: true
129 when:
130 - ansible_os_family == "Debian"
131 - inventory_hostname in groups.get(osd_group_name, [])
132
133 - name: run ceph-config role
134 import_role:
135 name: ceph-config
136
137 - name: run ceph-mon role
138 import_role:
139 name: ceph-mon
140 when:
141 - inventory_hostname in groups.get(mon_group_name, [])
142
143 - name: run ceph-mgr role
144 import_role:
145 name: ceph-mgr
146 when:
147 - inventory_hostname in groups.get(mgr_group_name, [])
148
149 - name: run ceph-osd role
150 import_role:
151 name: ceph-osd
152 when:
153 - inventory_hostname in groups.get(osd_group_name, [])