fix(sshd.yml): standardize variable names for SSHD configuration facts and improve clarity
This commit is contained in:
+12
-10
@@ -5,7 +5,7 @@
|
||||
|
||||
- name: (sshd.yml) Set fact_sshd_pubkey_accepted_algorithms (comma separated list)
|
||||
ansible.builtin.set_fact:
|
||||
fact_sshd_pubkey_accepted_algorithms: "{{ sshd_pubkey_accepted_algorithms | join(',') }}"
|
||||
common_fact_sshd_pubkey_accepted_algorithms: "{{ sshd_pubkey_accepted_algorithms | join(',') }}"
|
||||
when:
|
||||
- sshd_pubkey_accepted_algorithms is defined and sshd_pubkey_accepted_algorithms | length > 0
|
||||
tags:
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
- name: (sshd.yml) Set fact_sshd_kexalgorithms (comma separated list)
|
||||
ansible.builtin.set_fact:
|
||||
fact_sshd_kexalgorithms: "{{ sshd_kexalgorithms | join(',') }}"
|
||||
common_fact_sshd_kexalgorithms: "{{ sshd_kexalgorithms | join(',') }}"
|
||||
when:
|
||||
- sshd_kexalgorithms is defined and sshd_kexalgorithms | length > 0
|
||||
tags:
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
- name: (sshd.yml) Set fact_sshd_ciphers (comma separated list)
|
||||
ansible.builtin.set_fact:
|
||||
fact_sshd_ciphers: "{{ sshd_ciphers | join(',') }}"
|
||||
common_fact_sshd_ciphers: "{{ sshd_ciphers | join(',') }}"
|
||||
when:
|
||||
- sshd_ciphers is defined and sshd_ciphers | length > 0
|
||||
tags:
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
- name: (sshd.yml) Set fact_sshd_macs
|
||||
ansible.builtin.set_fact:
|
||||
fact_sshd_macs: "{{ sshd_macs | join(',') }}"
|
||||
common_fact_sshd_macs: "{{ sshd_macs | join(',') }}"
|
||||
when:
|
||||
- sshd_macs is defined and sshd_macs | length > 0
|
||||
tags:
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
- name: (sshd.yml) Set fact_sshd_hostkeyalgorithms (blank separated list)
|
||||
ansible.builtin.set_fact:
|
||||
fact_sshd_hostkeyalgorithms: "{{ sshd_hostkeyalgorithms | join(',') }}"
|
||||
common_fact_sshd_hostkeyalgorithms: "{{ sshd_hostkeyalgorithms | join(',') }}"
|
||||
when:
|
||||
- sshd_hostkeyalgorithms is defined and sshd_hostkeyalgorithms | length > 0
|
||||
tags:
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
- name: (sshd.yml) Set fact_sshd_allowed_users (blank separated list)
|
||||
ansible.builtin.set_fact:
|
||||
fact_sshd_allowed_users: "{{ sshd_allowed_users | join(' ') }}"
|
||||
common_fact_sshd_allowed_users: "{{ sshd_allowed_users | join(' ') }}"
|
||||
when:
|
||||
- sshd_allowed_users is defined and sshd_allowed_users | length > 0
|
||||
tags:
|
||||
@@ -58,13 +58,15 @@
|
||||
- name: (sshd.yml) Check file '/etc/ssh/sshd_config.ORIG' exists
|
||||
ansible.builtin.stat:
|
||||
path: /etc/ssh/sshd_config.ORIG
|
||||
register: etc_sshd_sshd_config_ORIG
|
||||
register: common_etc_sshd_sshd_config_orig
|
||||
tags:
|
||||
- sshd-config
|
||||
|
||||
- name: (sshd.yml) Backup installation version of file '/etc/ssh/sshd_config'
|
||||
ansible.builtin.command: cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG
|
||||
when: etc_sshd_sshd_config_ORIG.stat.exists == False
|
||||
ansible.builtin.command:
|
||||
cmd: cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG
|
||||
creates: /etc/ssh/sshd_config.ORIG
|
||||
when: common_etc_sshd_sshd_config_orig.stat.exists
|
||||
tags:
|
||||
- sshd-config
|
||||
|
||||
@@ -122,7 +124,7 @@
|
||||
state: absent
|
||||
check_mode: true
|
||||
changed_when: false
|
||||
register: sshd_config_sftp
|
||||
register: common_sshd_config_sftp
|
||||
tags:
|
||||
- sshd-config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user