--- - name: Ensure OpenSSH server is installed ansible.builtin.apt: name: openssh-server state: present update_cache: true cache_valid_time: 3600 - name: Ensure OpenSSH server is enabled and started ansible.builtin.service: name: ssh enabled: true state: started - name: Deploy SSH configuration ansible.builtin.template: src: sshd_config.j2 dest: /etc/ssh/sshd_config owner: root group: root mode: '0600' notify: Restart SSH