Move sudo stuff to sudo.yml
This commit is contained in:
parent
ab08969cfb
commit
606f3a14f5
|
@ -24,3 +24,16 @@
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution == "Debian"
|
||||||
- ansible_distribution_release == "jessie"
|
- ansible_distribution_release == "jessie"
|
||||||
- not copy_sudoers_evolinux.changed
|
- 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
|
update_password: on_create
|
||||||
when: loginisbusy.rc != 0 and uidisbusy.rc == 0
|
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"
|
- name: "Create {{ admin_users_group }} group"
|
||||||
group:
|
group:
|
||||||
name: "{{ admin_users_group }}"
|
name: "{{ admin_users_group }}"
|
||||||
when: ansible_distribution_major_version | version_compare('9', '>=')
|
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 }}'"
|
- name: "Fix perms on homedirectory for '{{ user.name }}'"
|
||||||
file:
|
file:
|
||||||
name: '/home/{{ user.name }}'
|
name: '/home/{{ user.name }}'
|
||||||
|
|
Loading…
Reference in a new issue