franklinkim.sudo
is an Ansible role which:
- installs sudo
- configures sudo
Using ansible-galaxy
:
$ ansible-galaxy install franklinkim.sudo
Using requirements.yml
:
- src: franklinkim.sudo
Using git
:
$ git clone https://github.com/weareinteractive/ansible-sudo.git franklinkim.sudo
- Ansible >= 1.9
Here is a list of all the default variables for this role, which are also available in defaults/main.yml
.
---
# sudo_defaults:
# - defaults: env_reset
# - name: user1
# defaults: requiretty
# sudo_users:
# - name: '%group1'
# - name: 'bar'
# nopasswd: yes
# - name: '%group2'
# commands: '/bin/ls'
#
# package name (version)
sudo_package: sudo
# list of username or %groupname
sudo_users: []
# list of username or %groupname and their defaults
sudo_defaults: []
This is an example playbook:
---
- hosts: all
sudo: yes
roles:
- franklinkim.sudo
vars:
sudo_defaults:
- defaults: env_reset
- defaults: secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- name: 'user1'
defaults: 'requiretty'
- name: '%group1'
defaults: '!requiretty'
sudo_users:
- name: 'user1'
- name: 'user2'
nopasswd: yes
- name: '%group1'
hosts: 127.0.0.1
- name: '%group2'
commands: '/bin/ls'
- name: '%group3'
users: 'user1,user2'
$ git clone https://github.com/weareinteractive/ansible-sudo.git
$ cd ansible-sudo
$ vagrant up
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes according to these guidelines (
git commit -am 'feat: add new feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Note: To update the README.md
file please install and run ansible-role
:
$ gem install ansible-role
$ ansible-role docgen
Copyright (c) We Are Interactive under the MIT license.