dotfiles/salt/states/sudo.sls
Jonas Forsberg 8f75ef9111
added sudo
2020-08-10 14:04:35 +02:00

23 lines
515 B
Plaintext

Configure sudoers:
file.managed:
- name: /etc/sudoers
- source: salt://files/sudoers
- user: root
- group: root
- mode: "0440"
add sudoers.d file for {{ pillar['username'] }}:
file.managed:
- name: /etc/sudoers.d/{{ pillar['username'] }}
- source: salt://files/user_sudo
- template: jinja
- user: root
- group: root
- mode: 0640
remove root password:
cmd.run:
- name: usermod -p '!' root
- unless: '[[ $(grep root /etc/shadow | cut -f2 -d":") == "!" ]]'