]>
Commit | Line | Data |
---|---|---|
1adf2230 AA |
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 | |
494da23a | 18 | dashboard_enabled: False |
1adf2230 | 19 | |
eafe8130 TL |
20 | environment: |
21 | DEBIAN_FRONTEND: noninteractive | |
22 | ||
1adf2230 AA |
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 | ||
eafe8130 TL |
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 | ||
1adf2230 AA |
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: | |
6d8e3169 FG |
78 | - ansible_facts['distribution'] == 'Fedora' |
79 | - ansible_facts['distribution_major_version']|int >= 23 | |
1adf2230 | 80 | |
11fdf7f2 TL |
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 | |
1911f103 TL |
93 | - import_role: |
94 | name: ceph-facts | |
11fdf7f2 TL |
95 | - import_role: |
96 | name: ceph-validate | |
1adf2230 AA |
97 | |
98 | - hosts: | |
99 | - mons | |
100 | - osds | |
101 | - mgrs | |
102 | gather_facts: false | |
103 | become: True | |
91327a77 | 104 | any_errors_fatal: true |
494da23a TL |
105 | vars: |
106 | dashboard_enabled: False | |
1adf2230 | 107 | tasks: |
11fdf7f2 TL |
108 | - import_role: |
109 | name: ceph-defaults | |
110 | - import_role: | |
111 | name: ceph-facts | |
112 | - import_role: | |
113 | name: ceph-handler | |
114 | - import_role: | |
115 | name: ceph-common | |
116 | ||
1adf2230 AA |
117 | - name: rsync ceph-volume to test nodes on centos |
118 | synchronize: | |
11fdf7f2 | 119 | src: "{{ toxinidir }}/../../../../ceph_volume" |
9f95a23c | 120 | dest: "/usr/lib/python3.6/site-packages" |
1adf2230 | 121 | use_ssh_args: true |
91327a77 | 122 | when: |
6d8e3169 | 123 | - ansible_facts['os_family'] == "RedHat" |
91327a77 | 124 | - inventory_hostname in groups.get(osd_group_name, []) |
1adf2230 AA |
125 | |
126 | - name: rsync ceph-volume to test nodes on ubuntu | |
127 | synchronize: | |
11fdf7f2 | 128 | src: "{{ toxinidir }}/../../../../ceph_volume" |
1adf2230 AA |
129 | dest: "/usr/lib/python2.7/dist-packages" |
130 | use_ssh_args: true | |
91327a77 | 131 | when: |
6d8e3169 | 132 | - ansible_facts['os_family'] == "Debian" |
91327a77 | 133 | - inventory_hostname in groups.get(osd_group_name, []) |
1adf2230 | 134 | |
91327a77 AA |
135 | - name: run ceph-config role |
136 | import_role: | |
137 | name: ceph-config | |
138 | ||
139 | - name: run ceph-mon role | |
140 | import_role: | |
141 | name: ceph-mon | |
142 | when: | |
143 | - inventory_hostname in groups.get(mon_group_name, []) | |
144 | ||
145 | - name: run ceph-mgr role | |
146 | import_role: | |
147 | name: ceph-mgr | |
148 | when: | |
149 | - inventory_hostname in groups.get(mgr_group_name, []) | |
150 | ||
151 | - name: run ceph-osd role | |
152 | import_role: | |
153 | name: ceph-osd | |
154 | when: | |
155 | - inventory_hostname in groups.get(osd_group_name, []) |