diff --git a/tasks/main.yml b/tasks/main.yml index 0ae2e69b4a6952abfa1fd423b5628f0f96fc69ac..3bcf5d9d58ae9e0002b734d066cf17768653dbb2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,9 +19,29 @@ exclusive: true with_items: "{{ groups.all | difference(groups.backup_server) }}" -- name: Get sshd_config file from init_server role +- name: create templates directory + file: + name: templates + state: directory + mode: '0755' + connection: local + become: false + delegate_to: localhost + tags: sshd + +- name: Get sshd_config file from init_server role locally get_url: url: "https://sources.le-filament.com/lefilament/ansible-roles/init_server/-/raw/master/templates/sshd_config.j2" + dest: templates/sshd_config.j2 + mode: '0644' + connection: local + become: false + delegate_to: localhost + tags: sshd + +- name: Copy sshd_config file + template: + src: templates/sshd_config.j2 dest: /etc/ssh/sshd_config owner: root group: root