Simplify tasks

This commit is contained in:
Patrick Neff 2022-01-25 10:44:36 +01:00
parent 4a1aca4621
commit 4876a64e6c
5 changed files with 7 additions and 28 deletions

View File

@ -1,4 +1,4 @@
- name: restart sshd
ansible.builtin.service:
name: "{{ ssh_service }}"
name: sshd
state: restarted

View File

@ -2,12 +2,3 @@
ansible.builtin.package:
name: openssh
state: present
- set_fact:
ssh_service: sshd
- name: Enable service.
ansible.builtin.service:
name: "{{ ssh_service }}"
enabled: true
state: started

View File

@ -2,12 +2,3 @@
ansible.builtin.package:
name: ssh
state: present
- set_fact:
ssh_service: sshd
- name: Enable service.
ansible.builtin.service:
name: "{{ ssh_service }}"
enabled: true
state: started

View File

@ -2,12 +2,3 @@
ansible.builtin.package:
name: ssh
state: present
- set_fact:
ssh_service: sshd
- name: Enable service.
ansible.builtin.service:
name: "{{ ssh_service }}"
enabled: true
state: started

View File

@ -1,5 +1,11 @@
- ansible.builtin.include_tasks: "{{ ansible_lsb['id'] }}.yml"
- name: Enable service.
ansible.builtin.service:
name: sshd
enabled: true
state: started
- name: Ensure sshd_config is setup.
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config