Last active
December 27, 2015 11:19
-
-
Save mattjbray/7318032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this script is not editable and should not be run as root | |
mkdir /tmp/permstest/subdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
tasks: | |
- name: create permstest group | |
sudo: yes | |
group: name=permstest state=present | |
- name: create dir owner=root group=permstest mode=0775 | |
sudo: yes | |
file: dest=/tmp/permstest owner=root group=permstest | |
state=directory mode=0775 | |
- name: add ansible user to permstest group | |
sudo: yes | |
user: name={{ ansible_user_id }} groups=permstest | |
append=yes | |
- name: try to create subdir as ansible user | |
script: test-perms.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "precise64" | |
config.vm.provision "ansible" do |ansible| | |
ansible.playbook = "test-perms.yml" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment