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
#!/usr/bin/env bash | |
# grab PAM-provided auth token | |
read token | |
# grab our user, $USER isn't always set | |
USER="$(id -un)" | |
# switch to PAM_USER if passed, buffer return value | |
$([[ "$PAM_USER" != "$USER" ]] && echo su - "$PAM_USER" -s) /usr/local/bin/gpg-preset-passphrase <<< "$token" |
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
# files/env: | |
Defaults env_keep += "SSH_AUTH_SOCK" | |
# tasks/main.yml | |
- name: ensure sudo keeps SSH_AUTH_SOCK in environment | |
copy: src=env | |
dest=/etc/sudoers.d/env | |
mode=0440 | |
owner=root | |
group=root |
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
# Ansible managed: /home/drybjed/src/github.com/drybjed/ginas/playbooks/roles/nginx/templates/etc/nginx/sites-available/default.conf.j2 modified on 2014-02-27 16:35:59 by drybjed on ultron | |
server { | |
listen 80 default_server; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 default_server ssl; |
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: elsa | |
tasks: | |
- command: ls -lR / | |
async: 30 | |
poll: 0 |
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 | |
vars: | |
the_user: '{{ lookup("env","USER") }}' | |
tasks: | |
- shell: groups {{ the_user }} > /tmp/file1 |
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: anna | |
tasks: | |
- shell: "grep ' / ' /etc/mtab | awk '{print $4}'" | |
register: mount_options | |
- debug: var=mount_options |
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: anna | |
tasks: | |
- name: Add bob | |
sudo: yes | |
user: name=bob | |
- name: Add some groups |
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: anna | |
tasks: | |
- name: Add bob | |
sudo: yes | |
user: name=bob2 | |
- name: Add some groups |
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
# Config file | |
{% for interface in interfaces %} | |
{% if interface.additional is defined and interface.additional %} | |
{% if interface.additional['border'] is defined and interface.additional['border'] %} | |
- id: 101 | |
kernel: | |
name: {{ prefix_tables }}{{ interface.name }} | |
ospf: | |
scan_time: 20 |
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
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [debug msg="['t', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 's', 't', 'r', 'i', 'n', 'g']"] *** | |
ok: [localhost] => { | |
"msg": "['t', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 's', 't', 'r', 'i', 'n', 'g']" | |
} |
OlderNewer