Browse Source

Merge pull request #38 from xen0n/gentoo-pkg-name

Support Gentoo minions
lookup-fix-3
Joseph Hall 10 years ago
parent
commit
76610eb63e
2 changed files with 27 additions and 11 deletions
  1. +14
    -0
      users/map.jinja
  2. +13
    -11
      users/sudo.sls

+ 14
- 0
users/map.jinja View File

'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'root_group': 'root', 'root_group': 'root',
'visudo_shell': '/bin/bash', 'visudo_shell': '/bin/bash',
'bash_package': 'bash',
'sudo_package': 'sudo',
},
'Gentoo': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_file': '/etc/sudoers',
'root_group': 'root',
'visudo_shell': '/bin/bash',
'bash_package': 'app-shells/bash',
'sudo_package': 'app-admin/sudo',
}, },
'FreeBSD': { 'FreeBSD': {
'sudoers_dir': '/usr/local/etc/sudoers.d/', 'sudoers_dir': '/usr/local/etc/sudoers.d/',
'sudoers_file': '/usr/local/etc/sudoers', 'sudoers_file': '/usr/local/etc/sudoers',
'root_group': 'wheel', 'root_group': 'wheel',
'visudo_shell': '/usr/local/bin/bash', 'visudo_shell': '/usr/local/bin/bash',
'bash_package': 'bash',
'sudo_package': 'sudo',
}, },
'default': { 'default': {
'sudoers_dir': '/etc/sudoers.d/', 'sudoers_dir': '/etc/sudoers.d/',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'root_group': 'root', 'root_group': 'root',
'visudo_shell': '/bin/bash', 'visudo_shell': '/bin/bash',
'bash_package': 'bash',
'sudo_package': 'sudo',
}, },
}, merge=salt['pillar.get']('users:lookup')) %} }, merge=salt['pillar.get']('users:lookup')) %}

+ 13
- 11
users/sudo.sls View File

# vim: sts=2 ts=2 sw=2 et ai # vim: sts=2 ts=2 sw=2 et ai
{% from "users/map.jinja" import users with context %} {% from "users/map.jinja" import users with context %}


#Support bash in FreeBSD
bash:
pkg:
- installed
# Ensure availability of bash
bash-package:
pkg.installed:
- name: {{ users.bash_package }}


sudo:
group:
- present
sudo-group:
group.present:
- name: sudo
- system: True - system: True
pkg:
- installed

sudo-package:
pkg.installed:
- name: {{ users.sudo_package }}
- require: - require:
- group: sudo
- group: sudo-group
- file: {{ users.sudoers_dir }} - file: {{ users.sudoers_dir }}


{{ users.sudoers_dir }}: {{ users.sudoers_dir }}:
file.append: file.append:
- name: {{ users.sudoers_file }} - name: {{ users.sudoers_file }}
- require: - require:
- pkg: sudo
- pkg: sudo-package
- text: - text:
- Defaults env_reset - Defaults env_reset
- Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Loading…
Cancel
Save