Petr Ospalý | e347ccc | 2018-12-19 14:52:07 +0100 | [diff] [blame] | 1 | --- |
| 2 | - name: Perform common environment setup for nodes |
| 3 | hosts: infrastructure, kubernetes |
| 4 | tasks: |
| 5 | - name: Setup resolv.conf |
| 6 | lineinfile: |
Michal Zegan | b5cd82b | 2019-01-04 14:20:03 +0100 | [diff] [blame] | 7 | line: "nameserver {{ hostvars[groups.infrastructure[0]].cluster_ip }}" |
Petr Ospalý | e347ccc | 2018-12-19 14:52:07 +0100 | [diff] [blame] | 8 | 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 Verespej | c2a14cf | 2019-02-04 11:01:19 +0100 | [diff] [blame^] | 17 | baseurl: "{{ 'http://repo.infra-server/rhel' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}" |
Petr Ospalý | e347ccc | 2018-12-19 14:52:07 +0100 | [diff] [blame] | 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 Ptacek | c4477cc | 2019-01-17 19:39:40 +0000 | [diff] [blame] | 64 | when: runtime_images is defined and runtime_images is not none |
Petr Ospalý | e347ccc | 2018-12-19 14:52:07 +0100 | [diff] [blame] | 65 | |
| 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 |