blob: 0866733001d891390f20235668faa3f4255a2263 [file] [log] [blame]
Petr Ospalýe347ccc2018-12-19 14:52:07 +01001---
2- name: Perform common environment setup for nodes
3 hosts: infrastructure, kubernetes
4 tasks:
5 - name: Setup resolv.conf
6 lineinfile:
Michal Zeganb5cd82b2019-01-04 14:20:03 +01007 line: "nameserver {{ hostvars[groups.infrastructure[0]].cluster_ip }}"
Petr Ospalýe347ccc2018-12-19 14:52:07 +01008 path: /etc/resolv.conf
9 state: present
10 insertbefore: BOF
11 become: yes
12 - name: Add application offline rpm repository
13 yum_repository:
14 name: "{{ app_name }}"
15 file: "{{ app_name | lower }}"
16 description: "{{ app_name }} offline repository"
17 baseurl: "{{ 'http://repo.infra-server' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}"
18 gpgcheck: no
19 enabled: yes
20 when: deploy_rpm_repository
21 become: yes
22
23- name: Setup firewall
24 hosts: infrastructure, kubernetes
25 roles:
26 - role: firewall
27 vars:
28 state: disable
29
30- name: Setup infrastructure servers
31 hosts: infrastructure
32 roles:
33 - certificates
34 - docker
35 - dns
36 - vncserver
37 - role: nexus
38 vars:
39 phase: install
40 - nginx
41 tasks:
42 - name: "wait for nexus to come up"
43 uri:
44 url: "{{ nexus_url }}/service/metrics/healthcheck"
45 user: admin
46 password: admin123
47 force_basic_auth: yes
48 method: GET
49 register: nexus_wait
50 until: not nexus_wait.failed
51 retries: 30
52 delay: 10
53
54- name: Nexus changes in runtime
55 hosts: infrastructure
56 roles:
57 - role: nexus
58 vars:
59 phase: configure
60 when: populate_nexus | bool
61 - role: nexus
62 vars:
63 phase: runtime-populate
Michal Ptacekc4477cc2019-01-17 19:39:40 +000064 when: runtime_images is defined and runtime_images is not none
Petr Ospalýe347ccc2018-12-19 14:52:07 +010065
66- name: Setup base for Kubernetes nodes
67 hosts: kubernetes
68 roles:
69 - docker
70 tasks:
71 - import_tasks: roles/certificates/tasks/upload_root_ca.yml