forked from evolix/ansible-roles
Move sudo stuff to sudo.yml
This commit is contained in:
parent
ab08969cfb
commit
606f3a14f5
|
@ -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', '>=')
|
||||
|
|
|
@ -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 }}'
|
||||
|
|
Loading…
Reference in a new issue