forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlifecycle_hook_post_start.yml
62 lines (54 loc) · 1.59 KB
/
lifecycle_hook_post_start.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
---
# Post Start actions for OCP 4 Cluster configs
- name: Build inventory
hosts: localhost
connection: local
gather_facts: false
become: false
tasks:
- when: cloud_provider == 'ec2'
name: Run infra-ec2-create-inventory Role
include_role:
name: infra-ec2-create-inventory
- when: cloud_provider == 'osp'
name: Run infra-osp-create-inventory Role
include_role:
name: infra-osp-create-inventory
- when: cloud_provider == 'azure'
name: Run infra-azure-create-inventory Role
include_role:
name: infra-azure-create-inventory
- name: Run Common SSH Config Generator Role
include_role:
name: infra-common-ssh-config-generate
when: "'bastions' in groups"
- name: Set ansible_ssh_extra_args
hosts:
- all:!windows:!network
gather_facts: false
any_errors_fatal: true
ignore_errors: false
tasks:
- name: Set facts for remote access
set_fact:
ansible_ssh_extra_args: >-
{{ ansible_ssh_extra_args|d() }}
-F {{hostvars.localhost.output_dir}}/{{ env_type }}_{{ guid }}_ssh_conf
- name: Run recover cluster actions
hosts: bastions
run_once: true
become: false
gather_facts: false
tasks:
- name: Set Ansible Python interpreter to k8s virtualenv
set_fact:
ansible_python_interpreter: /opt/virtualenvs/k8s/bin/python
- name: Perform actions on start
when: ACTION == 'start'
block:
- name: Approve CertificateSigningRequests
include_role:
name: ocp4_approve_certificate_signing_requests
- name: Cleanup failed pods
include_role:
name: ocp_cleanup_failed_pods