blob: a0bc70115b5f259f3c0bc084fd43d39f6b9e2e4b [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"
Milan Verespejc2a14cf2019-02-04 11:01:19 +010017 baseurl: "{{ 'http://repo.infra-server/rhel' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}"
Petr Ospalýe347ccc2018-12-19 14:52:07 +010018 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
Petr Ospalýe347ccc2018-12-19 14:52:07 +010027
28- name: Setup infrastructure servers
29 hosts: infrastructure
30 roles:
31 - certificates
32 - docker
33 - dns
34 - vncserver
35 - role: nexus
36 vars:
37 phase: install
38 - nginx
39 tasks:
40 - name: "wait for nexus to come up"
41 uri:
42 url: "{{ nexus_url }}/service/metrics/healthcheck"
43 user: admin
44 password: admin123
45 force_basic_auth: yes
46 method: GET
47 register: nexus_wait
48 until: not nexus_wait.failed
49 retries: 30
50 delay: 10
51
52- name: Nexus changes in runtime
53 hosts: infrastructure
54 roles:
55 - role: nexus
56 vars:
57 phase: configure
58 when: populate_nexus | bool
59 - role: nexus
60 vars:
61 phase: runtime-populate
Michal Ptacekc4477cc2019-01-17 19:39:40 +000062 when: runtime_images is defined and runtime_images is not none
Petr Ospalýe347ccc2018-12-19 14:52:07 +010063
64- name: Setup base for Kubernetes nodes
65 hosts: kubernetes
66 roles:
67 - docker
68 tasks:
69 - import_tasks: roles/certificates/tasks/upload_root_ca.yml