Skip to content
Snippets Groups Projects
Verified Commit f5372881 authored by Varac's avatar Varac
Browse files

Tag setup role

parent 8f873277
No related branches found
No related tags found
No related merge requests found
---
- name: Create /oas/config/ssh_known_hosts
tags:
- ssh
lineinfile:
dest: /oas/config/ssh_known_hosts
create: yes
......@@ -8,70 +10,101 @@
line: "{{ lookup('pipe', 'ssh-keyscan -trsa ' + ip_address) }}"
- name: Build Cluster
tags:
- rke
shell: /usr/local/bin/rke up --config=/oas/control/local/rke/cluster.yml >> /oas/logs/rke.log
- name: Fetch /oas/logs/rke.log from cluster
tags:
- log
fetch:
src: /oas/logs/rke.log
dest: ./rke.log
flat: yes
- name: Ensure /root/.kube directory
tags:
- kubectl
file:
state: directory
path: /root/.kube
- name: Link kubernetes config generated by rke
tags:
- kubectl
file:
state: link
src: /oas/control/local/rke/kube_config_cluster.yml
dest: /root/.kube/config
- name: Install python3-pip
tags:
- package
package:
name: python3-pip
# Needed for ansible k8s resource
- name: Install openshift python module via pip3
tags:
- package
- pip
pip:
name: openshift
executable: /usr/bin/pip3
- name: Install Tiller
tags:
- tiller
k8s:
state: present
definition: "{{ lookup('file', 'k8s-config/tiller-permissions.yml') }}"
- name: Check if tiller is already instaled
tags:
- tiller
command: /snap/bin/helm ls
failed_when: false
register: helm_ls
changed_when: false
- name: Initialize helm
tags:
- helm
command: /snap/bin/helm init --service-account=tiller
when: helm_ls.stderr.find('Error') != -1
- name: Wait for tiller to become available
tags:
- tiller
command: /snap/bin/kubectl rollout status -n kube-system deployment/tiller-deploy
changed_when: false
- name: Clone helmfiles repo
tags:
- git
- helm
- helmfile
git:
repo: 'https://code.greenhost.net/openappstack/helmfiles'
dest: '/oas/source/repos/helmfiles'
- name: Clone charts repo
tags:
- git
git:
repo: 'https://code.greenhost.net/openappstack/charts'
dest: '/oas/source/repos/charts'
- name: Clone local-storage repo
tags:
- git
git:
repo: 'https://code.greenhost.net/openappstack/local-storage'
dest: '/oas/source/repos/local-storage'
- name: Configure Keycloak realm configmap
tags:
- keycloak
k8s:
state: present
namespace: default
......@@ -79,6 +112,8 @@
definition: "{{ lookup('file', 'k8s-config/realm.yml') }}"
- name: Remove old Keycloak secret
tags:
- keycloak
k8s:
state: absent
namespace: default
......@@ -86,11 +121,17 @@
name: "realm-secret"
- name: Ensure /oas/config/values/apps directory
tags:
- config
- oas
file:
state: directory
path: /oas/config/values/apps
- name: Touch config file locations
tags:
- config
- oas
file:
state: touch
path: "{{ item }}"
......@@ -100,6 +141,9 @@
- /oas/config/values/apps/keycloak.yaml
- name: Apply helmfiles
tags:
- helmfile
- keycloak
environment:
- KEYCLOAK_PASSWORD: "{{ keycloak_password }}"
command: '/usr/local/bin/helmfile -b /snap/bin/helm -e oas -f /oas/source/repos/helmfiles/helmfile.d/ apply --suppress-secrets'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment