-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdeploy.yml
49 lines (45 loc) · 1.52 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- name: Bots deployment
hosts: localhost
vars:
deployment: "{{ lookup('env', 'DEPLOYMENT') }}"
tasks:
- name: include variables
include_vars: ../vars/{{ deployment }}.yml
- name: Clone bots repos
connection: local
# https://docs.ansible.com/git_module.html
git:
depth: 1
dest: ../cloned/{{ item }}
recursive: no
repo: https://github.com/user-cont/{{ item }}.git
loop:
- ucho
- zdravomil
- name: Deploy templates (need to be processed)
# https://docs.ansible.com/k8s_module.html
k8s:
namespace: "{{ project }}"
definition: "{{ item }}"
host: "{{ host }}"
api_key: "{{ api_key }}"
validate_certs: "{{ validate_certs }}"
loop:
- "{{ lookup('template', '../templates/config.yml') | from_yaml }}"
- "{{ lookup('template', '../templates/secrets.yml') | from_yaml }}"
- "{{ lookup('template', '../cloned/zdravomil/openshift/secret-api-keys.yml.j2') | from_yaml }}"
- name: Deploy resource configs (no need to process them)
# https://docs.ansible.com/k8s_module.html
k8s:
namespace: "{{ project }}"
src: "{{ item }}"
host: "{{ host }}"
api_key: "{{ api_key }}"
validate_certs: "{{ validate_certs }}"
loop:
- ../templates/redis.yml
- ../templates/redis-commander.yml
- ../templates/flower.yml
- ../cloned/ucho/openshift-fedmsg.yml
- ../cloned/zdravomil/openshift/deployment.yml