summaryrefslogtreecommitdiffstats
path: root/roles/ssh/tasks
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
parentc89c0b2d8af32d6f3f4f2b42efc6a9511fa4aefc (diff)
Fix when running from distro-install playbook and fix testing
Diffstat (limited to 'roles/ssh/tasks')
-rw-r--r--roles/ssh/tasks/install-archlinux.yml1
-rw-r--r--roles/ssh/tasks/install-debian.yml1
-rw-r--r--roles/ssh/tasks/main.yml6
3 files changed, 5 insertions, 3 deletions
diff --git a/roles/ssh/tasks/install-archlinux.yml b/roles/ssh/tasks/install-archlinux.yml
index 2b24a346..58b6fa9d 100644
--- a/roles/ssh/tasks/install-archlinux.yml
+++ b/roles/ssh/tasks/install-archlinux.yml
@@ -4,4 +4,5 @@
community.general.pacman:
name: "{{ ssh_package_name }}"
state: present
+ update_cache: true
tags: [required_for_boot]
diff --git a/roles/ssh/tasks/install-debian.yml b/roles/ssh/tasks/install-debian.yml
index c482ce74..452bf003 100644
--- a/roles/ssh/tasks/install-debian.yml
+++ b/roles/ssh/tasks/install-debian.yml
@@ -4,4 +4,5 @@
ansible.builtin.apt:
name: "{{ ssh_package_name }}"
state: "present"
+ update_cache: true
tags: [required_for_boot]
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: