-
Notifications
You must be signed in to change notification settings - Fork 497
/
post_infra.yml
38 lines (35 loc) · 1.04 KB
/
post_infra.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
---
- name: Step 002 Post Infrastructure
hosts: localhost
gather_facts: false
become: false
tasks:
- debug:
msg: "Step 002 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