Skip to content

Instantly share code, notes, and snippets.

View drybjed's full-sized avatar

Maciej Delmanowski drybjed

View GitHub Profile
---
# inventory/host_vars/localhost.yml
graphite:
secret_key: 'aaa'
---
- hosts: localhost
vars:
gateway:
'gw':
'10.1.1.0': '10.1.1.1'
'10.1.2.0': '10.1.2.1'
---
- hosts: localhost
vars:
host_list: [ '192.168.1.1', '192.168.1.2' ]
tasks:
- shell: ping -c1 {{ item }}
---
- 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:
---
- 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
@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']"
}
# 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
---
- hosts: anna
tasks:
- name: Add bob
sudo: yes
user: name=bob2
- name: Add some groups
---
- hosts: anna
tasks:
- name: Add bob
sudo: yes
user: name=bob
- name: Add some groups
---
- hosts: anna
tasks:
- shell: "grep ' / ' /etc/mtab | awk '{print $4}'"
register: mount_options
- debug: var=mount_options