summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hrabos <s.hrabos@partner.samsung.com>2018-12-19 14:11:51 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-19 14:11:51 +0000
commitef5a3dee62b71b69d39ddc3a8f048a0022b1ec57 (patch)
tree9bf3bcc510c6c6d8c4803d05dfab8c5e9bc8dd75
parent83b5756da40a92387702f292f91e0a88210a93d9 (diff)
parente347ccc3357d3a4d0db0566883fa2492a44746ed (diff)
Merge "Add the infrastructure playbook to setup cluster"
-rw-r--r--ansible/infrastructure.yml71
1 files changed, 71 insertions, 0 deletions
diff --git a/ansible/infrastructure.yml b/ansible/infrastructure.yml
new file mode 100644
index 00000000..789f8716
--- /dev/null
+++ b/ansible/infrastructure.yml
@@ -0,0 +1,71 @@
+---
+- name: Perform common environment setup for nodes
+ hosts: infrastructure, kubernetes
+ tasks:
+ - name: Setup resolv.conf
+ lineinfile:
+ line: "nameserver {{ hostvars[groups.infrastructure[0]].ansible_host }}"
+ path: /etc/resolv.conf
+ state: present
+ insertbefore: BOF
+ become: yes
+ - name: Add application offline rpm repository
+ yum_repository:
+ name: "{{ app_name }}"
+ file: "{{ app_name | lower }}"
+ description: "{{ app_name }} offline repository"
+ baseurl: "{{ 'http://repo.infra-server' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}"
+ gpgcheck: no
+ enabled: yes
+ when: deploy_rpm_repository
+ become: yes
+
+- name: Setup firewall
+ hosts: infrastructure, kubernetes
+ roles:
+ - role: firewall
+ vars:
+ state: disable
+
+- name: Setup infrastructure servers
+ hosts: infrastructure
+ roles:
+ - certificates
+ - docker
+ - dns
+ - vncserver
+ - role: nexus
+ vars:
+ phase: install
+ - nginx
+ tasks:
+ - name: "wait for nexus to come up"
+ uri:
+ url: "{{ nexus_url }}/service/metrics/healthcheck"
+ user: admin
+ password: admin123
+ force_basic_auth: yes
+ method: GET
+ register: nexus_wait
+ until: not nexus_wait.failed
+ retries: 30
+ delay: 10
+
+- name: Nexus changes in runtime
+ hosts: infrastructure
+ roles:
+ - role: nexus
+ vars:
+ phase: configure
+ when: populate_nexus | bool
+ - role: nexus
+ vars:
+ phase: runtime-populate
+ when: runtime_images is defined
+
+- name: Setup base for Kubernetes nodes
+ hosts: kubernetes
+ roles:
+ - docker
+ tasks:
+ - import_tasks: roles/certificates/tasks/upload_root_ca.yml