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: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
foo: bar | |
cops_es_nginx_foo: bar | |
tasks: | |
- set_fact: |
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
{# style 1 - long form #} | |
{% if filepath == '/var/opt/tomcat_1' %} | |
{% set tomcat_value = tomcat_1_value %} | |
{% else %} | |
{% set tomcat_value = tomcat_2_value %} | |
{% endif %} | |
{# style 2 - short form #} | |
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %} |
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: localhost | |
connection: local | |
gather_facts: False | |
vars: | |
mylist: | |
- group_1 | |
- group_2 | |
tasks: |
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_plugins/filter_plugins/extras.py | |
def merge_dicts(value, dict1): | |
# return a merged dict | |
result = {} | |
result = value | |
result.update(dict1) | |
return result | |
def merge_lists_of_dicts(list1, list2): | |
# return a merged list |
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
#jinja2:trim_blocks: True, lstrip_blocks: True | |
targets: | |
{% for privnet in all_private_subnets %} | |
- subnet_id: "{{ privnet }}" | |
security_groups: [ "{{ sg.group_id }}" ] | |
{% endfor %} | |
{% for pubnet in all_public_subnets %} | |
- subnet_id: "{{ pubnet }}" | |
security_groups: [ "{{ sg.group_id }}" ] | |
{% endfor %} |
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
.PHONY: bump | |
# version bump, assumes we're in treeder/bump in CircleCI | |
bump: | |
@git config --global user.email "-" | |
@git config --global user.name "CircleCi" | |
@(git tag --sort=-creatordate | grep -E '^\d+\.\d+\.\d+$$' || echo '0.0.0') | head -n 1 > VERSION | |
@/script/bump $$(git log -1 --pretty=%B) | |
@git tag $$(cat VERSION) | |
@git push origin $$(cat VERSION) |
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
# templates/mail_body.j2 | |
{% for host in play_hosts %} | |
The {{ host }} says {{ hostvars[host]['result']['stdout'] }} | |
{% endfor %} |
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
<html><title>Find Location of an IP</title> | |
<body><font face=\"Arial\"> | |
<H1>Please provide an IP or a LOCATION :</H1> | |
<p>Search Location, DS site code, Country, Network types or Comments</p> | |
<form method=\"GET\" action=\"launch_search_IP.pl\"> | |
<p> <input name=\"ip_to_search\" width=\"100%\" height=\"100%\" ></p> | |
<input type=\"submit\" value=\"Search\"></form> | |
<p> Here are results for your search of <b> 192.168.0.1 </b> : | |
<br> | |
<br> |
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: localhost | |
gather_facts: False | |
connection: local | |
vars: | |
myvar: 'http://www.example.domain.com:9090' | |
tasks: | |
- name: not as good as a custom filter | |
debug: |
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
... | |
TASK: [debug var=mydate] ****************************************************** | |
ok: [localhost] => { | |
"mydate": "20140605101824" | |
} | |
... |
NewerOlder