-
Notifications
You must be signed in to change notification settings - Fork 640
/
Copy pathinstall.yml
119 lines (98 loc) · 3.8 KB
/
install.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
- name: Delete old deployment for before installing during upgrade
k8s:
kind: Deployment
api_version: apps/v1
namespace: "{{ ansible_operator_meta.namespace }}"
name: "{{ ansible_operator_meta.name }}"
state: absent
- name: Patching labels to AWX kind
k8s:
state: present
definition:
apiVersion: '{{ api_version }}'
kind: '{{ kind }}'
name: '{{ ansible_operator_meta.name }}'
namespace: '{{ ansible_operator_meta.namespace }}'
metadata:
name: '{{ ansible_operator_meta.name }}'
namespace: '{{ ansible_operator_meta.namespace }}'
labels: '{{ lookup("template", "../common/templates/labels/common.yaml.j2") | from_yaml }}'
when: set_self_labels | bool
- name: Build `additional_labels_items` labels from `additional_labels`
block:
- name: Look up details for this deployment
k8s_info:
api_version: "{{ api_version }}"
kind: "{{ kind }}"
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
register: this_awx
- name: Select resource labels which are in `additional_labels`
set_fact:
additional_labels_items: >-
{{ this_awx['resources'][0]['metadata']['labels']
| dict2items | selectattr('key', 'in', additional_labels)
| list
}}
when: this_awx['resources'][0]['metadata']['labels']
when: additional_labels | length
- name: Include secret key configuration tasks
include_tasks: secret_key_configuration.yml
- name: Load LDAP CAcert certificate
include_tasks: load_ldap_cacert_secret.yml
when:
- ldap_cacert_secret != ''
- name: Load ldap bind password
include_tasks: load_ldap_password_secret.yml
when:
- ldap_password_secret != ''
- name: Load bundle certificate authority certificate
include_tasks: load_bundle_cacert_secret.yml
when:
- bundle_cacert_secret != ''
- name: Include admin password configuration tasks
include_tasks: admin_password_configuration.yml
- name: Include broadcast websocket configuration tasks
include_tasks: broadcast_websocket_configuration.yml
- name: Include set_images tasks
include_tasks: set_images.yml
- name: Include database configuration tasks
include_tasks: database_configuration.yml
- name: Load Route TLS certificate
include_tasks: load_route_tls_secret.yml
when:
- ingress_type | lower == 'route'
- route_tls_secret != ''
- name: Wait for {{ deployment_type }}restore to complete
kubernetes.core.k8s_info:
api_version: "{{ api_version }}"
kind: "{{ deployment_type }}restore"
namespace: "{{ ansible_operator_meta.namespace }}"
register: restore_status_check
until:
# yamllint disable-line rule:line-length
- (restore_status_check.resources | length == 0) or (restore_status_check.resources | selectattr('spec.deployment_name', 'equalto', ansible_operator_meta.name) | map(attribute='status') | selectattr('restoreComplete', 'defined') | map(attribute='restoreComplete') | list | length > 0)
delay: 10
retries: 8640
ignore_errors: yes
changed_when: false
- name: Include resources configuration tasks
include_tasks: resources_configuration.yml
- name: Migrate database to the latest schema
include_tasks: migrate_schema.yml
when: awx_web_pod_name != ''
- name: Initialize Django
include_tasks: initialize_django.yml
when: awx_web_pod_name != ''
- name: Enable optional metrics-utility
include_tasks: enable_metrics_utility.yml
when: _metrics_utility_enabled | default(false) | bool
- name: Enable optional metrics-utility for Redhat Console
include_tasks: enable_metrics_utility_console.yml
when: _metrics_utility_console_enabled | default(false) | bool
- name: Update status variables
include_tasks: update_status.yml
when: update_status | bool
- name: Cleanup & Set garbage collection refs
include_tasks: cleanup.yml