This file contains hidden or 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
--- | |
- 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 |
This file contains hidden or 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: 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: |
This file contains hidden or 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: localhost | |
vars: | |
host_list: [ '192.168.1.1', '192.168.1.2' ] | |
tasks: | |
- shell: ping -c1 {{ item }} |
This file contains hidden or 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: localhost | |
vars: | |
gateway: | |
'gw': | |
'10.1.1.0': '10.1.1.1' | |
'10.1.2.0': '10.1.2.1' |
This file contains hidden or 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
--- | |
# inventory/host_vars/localhost.yml | |
graphite: | |
secret_key: 'aaa' |
This file contains hidden or 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
- name: Wait until VM is installed | |
virt: name={{ vm.name }} | |
command=status | |
register: virt_status | |
until: virt_status.status == 'shutdown' | |
retries: 20 | |
delay: 60 | |
when: {{ vm.state }} == 'running' |
This file contains hidden or 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
127.0.0.1 localhost | |
::1 localhost | |
{% for host in groups['all'] %} | |
{# {{ hostvars[host]['ansible_default_ipv4'].address }} {{ hostvars[host]['ansible_fqdn'] }} {{ hostvars[host]['ansible_hostname'] }} #} | |
{{ host }} | |
{{ hostvars['pyke']['ansible_default_ipv4']['address'] }} | |
{# {{ hostvars | to_nice_json }} #} | |
{% endfor %} |
This file contains hidden or 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
--- | |
- 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 |
This file contains hidden or 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
{# | |
Abusing Jinja2 templates 101: Postfix local facts | |
This template manages contents of /etc/ansible/facts.d/postfix.fact | |
and allows to configure Postfix ba multiple separate roles using | |
dependency variables. Configuration will be stored and preserved | |
idempotently between ansible-playbook runs. | |
Recognized variables: | |
- postfix_dependency_lists: hash variable which defines lists of values |
This file contains hidden or 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: | |
account: 'user.name' | |
migration: | |
target: | |
"user.name": |