]>
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 | |
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 | ||
11fdf7f2 TL |
66 | - name: check if it is atomic host |
67 | stat: | |
68 | path: /run/ostree-booted | |
69 | register: stat_ostree | |
70 | ||
71 | - name: set_fact is_atomic | |
72 | set_fact: | |
73 | is_atomic: '{{ stat_ostree.stat.exists }}' | |
74 | ||
75 | tasks: | |
76 | - import_role: | |
77 | name: ceph-defaults | |
78 | - import_role: | |
79 | name: ceph-validate | |
1adf2230 AA |
80 | |
81 | - hosts: | |
82 | - mons | |
83 | - osds | |
84 | - mgrs | |
85 | gather_facts: false | |
86 | become: True | |
91327a77 | 87 | any_errors_fatal: true |
1adf2230 | 88 | tasks: |
11fdf7f2 TL |
89 | - import_role: |
90 | name: ceph-defaults | |
91 | - import_role: | |
92 | name: ceph-facts | |
93 | - import_role: | |
94 | name: ceph-handler | |
95 | - import_role: | |
96 | name: ceph-common | |
97 | ||
1adf2230 AA |
98 | - name: rsync ceph-volume to test nodes on centos |
99 | synchronize: | |
11fdf7f2 | 100 | src: "{{ toxinidir }}/../../../../ceph_volume" |
1adf2230 AA |
101 | dest: "/usr/lib/python2.7/site-packages" |
102 | use_ssh_args: true | |
91327a77 AA |
103 | when: |
104 | - ansible_os_family == "RedHat" | |
105 | - inventory_hostname in groups.get(osd_group_name, []) | |
1adf2230 AA |
106 | |
107 | - name: rsync ceph-volume to test nodes on ubuntu | |
108 | synchronize: | |
11fdf7f2 | 109 | src: "{{ toxinidir }}/../../../../ceph_volume" |
1adf2230 AA |
110 | dest: "/usr/lib/python2.7/dist-packages" |
111 | use_ssh_args: true | |
91327a77 AA |
112 | when: |
113 | - ansible_os_family == "Debian" | |
114 | - inventory_hostname in groups.get(osd_group_name, []) | |
1adf2230 | 115 | |
91327a77 AA |
116 | - name: run ceph-config role |
117 | import_role: | |
118 | name: ceph-config | |
119 | ||
120 | - name: run ceph-mon role | |
121 | import_role: | |
122 | name: ceph-mon | |
123 | when: | |
124 | - inventory_hostname in groups.get(mon_group_name, []) | |
125 | ||
126 | - name: run ceph-mgr role | |
127 | import_role: | |
128 | name: ceph-mgr | |
129 | when: | |
130 | - inventory_hostname in groups.get(mgr_group_name, []) | |
131 | ||
132 | - name: run ceph-osd role | |
133 | import_role: | |
134 | name: ceph-osd | |
135 | when: | |
136 | - inventory_hostname in groups.get(osd_group_name, []) |