dotfiles/salt/states/sudo.sls

23 lines
515 B
Plaintext
Raw Normal View History

2020-08-10 12:04:35 +00:00
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":") == "!" ]]'