Move sudo stuff to sudo.yml

This commit is contained in:
Gregory Colpart 2017-08-22 01:36:56 +02:00
parent ab08969cfb
commit 606f3a14f5
2 changed files with 13 additions and 13 deletions

View file

@ -24,3 +24,16 @@
- ansible_distribution == "Debian"
- ansible_distribution_release == "jessie"
- not copy_sudoers_evolinux.changed
- name: "Create evolinux-sudo group"
group:
name: evolinux-sudo
system: yes
when: ansible_distribution_major_version | version_compare('9', '>=')
- name: "Add user to sudo group (Debian 9 or later)"
user:
name: '{{ user.name }}'
groups: 'evolinux-sudo,{{ admin_users_group }}'
append: yes
when: ansible_distribution_major_version | version_compare('9', '>=')

View file

@ -35,24 +35,11 @@
update_password: on_create
when: loginisbusy.rc != 0 and uidisbusy.rc == 0
- name: "Create evolinux-sudo group"
group:
name: evolinux-sudo
system: yes
when: ansible_distribution_major_version | version_compare('9', '>=')
- name: "Create {{ admin_users_group }} group"
group:
name: "{{ admin_users_group }}"
when: ansible_distribution_major_version | version_compare('9', '>=')
- name: "Add user to sudo group (Debian 9 or later)"
user:
name: '{{ user.name }}'
groups: 'evolinux-sudo,{{ admin_users_group }}'
append: yes
when: ansible_distribution_major_version | version_compare('9', '>=')
- name: "Fix perms on homedirectory for '{{ user.name }}'"
file:
name: '/home/{{ user.name }}'