dotfiles/roles/sshd/tasks/install.yml
Matej Focko e3bff6c8c4
fix(install): refine the decision-making for OSs
Signed-off-by: Matej Focko <me@mfocko.xyz>
2024-11-18 15:15:49 +01:00

19 lines
596 B
YAML

---
- name: Set default family of packages for SSH
ansible.builtin.set_fact:
ssh_packages: [openssh, openssh-clients, openssh-server]
- name: Set family of packages for SSH on Debian-based OSs
ansible.builtin.set_fact:
ssh_packages: [openssh-client, openssh-server]
when: ansible_distribution in [ "Debian", "Ubuntu" ]
- name: Set family of packages for SSH on archLinux
ansible.builtin.set_fact:
ssh_packages: [openssh]
when: ansible_distribution == "Archlinux"
- name: Install the SSH family
ansible.builtin.package:
name: "{{ ssh_packages }}"
state: present