Skip to content

Instantly share code, notes, and snippets.

View drybjed's full-sized avatar

Maciej Delmanowski drybjed

View GitHub Profile
# 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;
---
- hosts: elsa
tasks:
- command: ls -lR /
async: 30
poll: 0
---
- hosts: all
vars:
the_user: '{{ lookup("env","USER") }}'
tasks:
- shell: groups {{ the_user }} > /tmp/file1
---
- hosts: anna
tasks:
- shell: "grep ' / ' /etc/mtab | awk '{print $4}'"
register: mount_options
- debug: var=mount_options
---
- hosts: anna
tasks:
- name: Add bob
sudo: yes
user: name=bob
- name: Add some groups
---
- hosts: anna
tasks:
- name: Add bob
sudo: yes
user: name=bob2
- name: Add some groups
# 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
@drybjed
drybjed / output
Last active August 29, 2015 14:00
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']"
}
---
- name: ensure swap file is allocated
command: dd if=/dev/zero of=/swapfile bs=1M count={{ common_swap_size }} creates=/swapfile
when: ansible_swaptotal_mb < 1
register: swapfile_init
- name: ensure swap file is created
command: mkswap /swapfile
when: swapfile_init is defined and swapfile_init.changed
---
- hosts: localhost
vars:
deploy_git_repo_path: '/tmp/git-repo'
deploy_path: '/tmp/deploy'
deploy_dirs: [ '{{ deploy_path }}', '{{ deploy_git_repo_path }}', '{{ deploy_path }}/shared', '{{ deploy_path }}/shared/public' ]
deploy_items: