Simplify tasks
This commit is contained in:
parent
4a1aca4621
commit
4876a64e6c
|
@ -1,4 +1,4 @@
|
||||||
- name: restart sshd
|
- name: restart sshd
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: "{{ ssh_service }}"
|
name: sshd
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -2,12 +2,3 @@
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: openssh
|
name: openssh
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
ssh_service: sshd
|
|
||||||
|
|
||||||
- name: Enable service.
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: "{{ ssh_service }}"
|
|
||||||
enabled: true
|
|
||||||
state: started
|
|
||||||
|
|
|
@ -2,12 +2,3 @@
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: ssh
|
name: ssh
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
ssh_service: sshd
|
|
||||||
|
|
||||||
- name: Enable service.
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: "{{ ssh_service }}"
|
|
||||||
enabled: true
|
|
||||||
state: started
|
|
||||||
|
|
|
@ -2,12 +2,3 @@
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: ssh
|
name: ssh
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
ssh_service: sshd
|
|
||||||
|
|
||||||
- name: Enable service.
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: "{{ ssh_service }}"
|
|
||||||
enabled: true
|
|
||||||
state: started
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
- ansible.builtin.include_tasks: "{{ ansible_lsb['id'] }}.yml"
|
- 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.
|
- name: Ensure sshd_config is setup.
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/ssh/sshd_config
|
path: /etc/ssh/sshd_config
|
||||||
|
|
Loading…
Reference in New Issue