-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtemplates.yml
More file actions
executable file
·48 lines (45 loc) · 3.23 KB
/
templates.yml
File metadata and controls
executable file
·48 lines (45 loc) · 3.23 KB
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
#!/usr/local/bin/ansible-playbook
- name: '{{ ansible_name }} | Konductor | template'
hosts: konductor
vars_files:
- '../cluster-vars.yml'
- 'vars/global.yml'
- 'vars/{{ target_environment }}.yml'
vars:
module: "template"
state_provider: "{{ terraform_state_provider }}"
ansible_name_module: "{{ ansible_name }} | {{ module }}"
dir_platform_templates: "{{ dir_iac }}/sparta/templates"
tmpl_installconfig_j2: "{{ dir_platform_templates }}/openshift-install/{{ cloud_provider }}-{{ target_environment }}-install-config.yaml.j2"
cloud_key_id_special: "{{ lookup('ini', 'aws_access_key_id section=default file={{ dir_secrets }}/aws/credentials') }}"
cloud_key_secret_special: "{{ lookup('ini', 'aws_secret_access_key section=default file={{ dir_secrets }}/aws/credentials') }}"
redhat_quay_pull_file: '{{ dir_secrets }}/docker/config.json }}'
tasks:
- name: '{{ ansible_name_module }} | template | Stage OpenShift Configs & Manifests'
template:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
mode: '0755'
loop:
- { src: "{{ dir_platform_templates }}/openshift-install/99_openshift-image-registry_installer-cloud-credentials-secret.yaml.j2", dest: "{{ dir_cluster }}/aux/openshift/99_openshift-image-registry_installer-cloud-credentials-secret.yaml"}
- { src: "{{ dir_platform_templates }}/openshift-install/99_openshift-ingress-operator_cloud-credentials-secret.yaml.j2", dest: "{{ dir_cluster }}/aux/openshift/99_openshift-ingress-operator_cloud-credentials-secret.yaml"}
- { src: "{{ dir_platform_templates }}/openshift-install/99_openshift-machine-api_aws-cloud-credentials-secret.yaml.j2", dest: "{{ dir_cluster }}/aux/openshift/99_openshift-machine-api_aws-cloud-credentials-secret.yaml"}
- { src: "{{ dir_platform_templates }}/openshift-install/aws-creds.yml.j2", dest: "{{ dir_cluster }}/aux/openshift/aws-creds.yml"}
- { src: "{{ dir_platform_templates }}/terraform/global.tfvars.j2", dest: "{{ dir_iac }}/global.tfvars"}
####### Ignition User Data
- name: '{{ ansible_name_module }} role | manifests | template | Stage OpenShift Ignition User-Data JSON'
template:
src: "{{ dir_platform_templates }}/user-data/user-data-ign.json.j2"
dest: "{{ dir_platform }}/config/user-data/{{ item.name }}.json"
with_items:
- { name: master, IGNITION_URL: "http://registry.{{ cluster_domain }}/master.ign" }
- { name: bootstrap, IGNITION_URL: "http://registry.{{ cluster_domain }}/bootstrap.ign" }
- { name: bastion, USER_AUTH_KEY: "{{ lookup('file', '{{ dir_secrets }}/ssh/id_rsa_kubeadmin.pub')}}" }
- name: '{{ ansible_name_module }} role | manifests | template | Stage OpenShift Ignition User-Data B64'
template:
src: "{{ dir_platform_templates }}/user-data/user-data-ign.b64.j2"
dest: "{{ dir_platform }}/config/user-data/{{ item.name }}-json.b64"
with_items:
- { name: 'master', IGNITION_URL: "http://registry.{{ cluster_domain }}/master.ign" }
- { name: 'bootstrap', IGNITION_URL: "http://registry.{{ cluster_domain }}/bootstrap.ign" }
- { name: 'bastion', USER_AUTH_KEY: "{{ lookup('file', '{{ dir_secrets }}/ssh/id_rsa_kubeadmin.pub') }}" }