-
Notifications
You must be signed in to change notification settings - Fork 524
Expand file tree
/
Copy pathpost_infra.yml
More file actions
68 lines (58 loc) · 1.7 KB
/
post_infra.yml
File metadata and controls
68 lines (58 loc) · 1.7 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
- name: Step 002 Post Infrastructure
hosts: localhost
connection: local
become: false
gather_facts: false
tags:
- step002
- post_infrastructure
tasks:
- name: "Step 002 Post Infrastructure"
ansible.builtin.debug:
msg: "Step 000 Post Infrastructure"
- name: Step 002 Post Infrastructure regreSSHion Hotfix
hosts: all:!windows:!network
become: true
tags:
- regresshion_hotfix
tasks:
- name: Have facts been gathered?
when: ansible_facts['ansible_distribution'] is not defined
ansible.builtin.setup:
gather_subset:
- '!all'
- '!min'
- 'distribution'
- name: Fix regreSSHion when RHEL 9 only
when:
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version == '9'
block:
- name: Set sshd LoginGraceTime to 0 in /etc/ssh/sshd_config
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '.*LoginGraceTime.*'
line: 'LoginGraceTime 0'
- name: Restart SSH service for regreSSHion fix
ansible.builtin.service:
name: sshd
state: restarted
- name: Run host_workloads for post_infra_workloads
any_errors_fatal: true
hosts: all:localhost
gather_facts: false
tags:
- step002
- post_infrastructure
tasks:
- name: Include host_workloads for post_infra
when:
- post_infra_workloads is iterable
- post_infra_workloads is not mapping
- post_infra_workloads is not string
vars:
agnosticd_stage: post_infra
host_workloads: "{{ post_infra_workloads }}"
ansible.builtin.include_role:
name: host_workloads