From 7282b39ca36744ea12037c43c62cb1714eb804d4 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 20 Feb 2019 11:54:02 +0100 Subject: [PATCH] Arch support and use become: yes --- tasks/main.yml | 13 ++++++++++--- vars/Archlinux.yml | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 vars/Archlinux.yml diff --git a/tasks/main.yml b/tasks/main.yml index 71be19f..3106cfe 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,11 +2,15 @@ - name: register os-specific variables include_vars: default.yml - when: ansible_distribution != 'Fedora' + when: + - ansible_distribution != 'Fedora' + - ansible_distribution != 'Archlinux' - name: register os-specific variables include_vars: "{{ ansible_distribution }}.yml" - when: ansible_distribution == 'Fedora' + when: + - ansible_distribution == 'Fedora' + - ansible_distribution == 'Archlinux' - name: Collect all users and groups allowed to login via ssh @@ -23,6 +27,7 @@ group: root mode: 'u=rw,g=r,o=r' validate: /usr/sbin/sshd -t -f %s + become: yes notify: - restart ssh @@ -32,10 +37,10 @@ args: chdir: '/etc/ssh/' creates: 'ssh_host_ed25519_key.pub' + become: yes notify: - restart ssh - - name: Remove unwanted host keys file: path: '/etc/ssh/ssh_host_{{ item }}_key' @@ -44,6 +49,7 @@ - ecdsa - rsa - dsa + become: yes notify: - restart ssh @@ -54,6 +60,7 @@ - ecdsa - rsa - dsa + become: yes notify: - restart ssh diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml new file mode 100644 index 0000000..b25deeb --- /dev/null +++ b/vars/Archlinux.yml @@ -0,0 +1,4 @@ +--- + +ssh_service: sshd +