summaryrefslogtreecommitdiffstats
path: root/roles/ssh/tasks/main.yml
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-08-11 00:32:02 +0200
committerAhmed Abdelhalim <[email protected]>2025-08-11 00:32:02 +0200
commita67eec6fd3c4df5e92f4e4a4cd5c0299c06d484d (patch)
treeaf79763653973fb81509215c65663639c3e3d007 /roles/ssh/tasks/main.yml
parentc89c0b2d8af32d6f3f4f2b42efc6a9511fa4aefc (diff)
Fix when running from distro-install playbook and fix testing
Diffstat (limited to 'roles/ssh/tasks/main.yml')
-rw-r--r--roles/ssh/tasks/main.yml6
1 files changed, 3 insertions, 3 deletions
diff --git a/roles/ssh/tasks/main.yml b/roles/ssh/tasks/main.yml
index 91ea250f..f88b9be4 100644
--- a/roles/ssh/tasks/main.yml
+++ b/roles/ssh/tasks/main.yml
@@ -50,7 +50,7 @@
ansible.builtin.copy:
dest: "/etc/ssh/sshd_config"
mode: "0640"
- validate: 'sshd -T -f %s'
+ validate: "{{ 'sshd -T -f %s' if (not ansible_is_chroot) else omit }}"
content: |
KbdInteractiveAuthentication no # default installation is no
UsePAM no # default installation is yes
@@ -75,7 +75,7 @@
ansible.builtin.copy:
dest: "/etc/ssh/sshd_config.d/99-auth-policy.conf"
mode: "0640"
- validate: 'sshd -T -f %s'
+ validate: "{{ 'sshd -T -f %s' if (not ansible_is_chroot) else omit }}"
content: |
Port {{ ssh_port }}
PasswordAuthentication no
@@ -94,7 +94,7 @@
ansible.builtin.copy:
dest: "/etc/ssh/sshd_config.d/99-allowed-users.conf"
mode: "0640"
- validate: 'sshd -T -f %s'
+ validate: "{{ 'sshd -T -f %s' if (not ansible_is_chroot) else omit }}"
content: |
AllowUsers {{ username }}
notify: