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
THE ZEN OF ANSIBLE | |
Ansible is not Python. | |
YAML sucks for coding. | |
Playbooks are not for programming. | |
Ansible users are (most probably) not a programmers. | |
Clear is better than cluttered. | |
Concise is better than verbose. | |
Simple is better than complex. | |
Readability counts. |
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
# This example shows a var file that would be embedded in | |
# a lightbulb-provisioner-aws role. Other providers would | |
# have similar file defining standardized lab layouts and | |
# machine defintions that are specific to that provider. | |
lightbulb_lab_layouts: | |
aws_standard_linux_centos: | |
control: | |
- ansible: aws_tower_medium | |
web: |
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/python | |
from influxdb import InfluxDBClient | |
import datetime | |
def annotate(): | |
_host = 'localhost' | |
_port = 8086 | |
_user = "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
import pprint | |
import inspect | |
def dump(data=None): | |
meth = inspect.currentframe().f_back.f_code.co_name | |
pprint.pprint({meth: data}) | |
class CallbackModule(object): |
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: remote_host | |
gather_facts: no | |
name: "Testing synchronize" | |
vars: | |
start_time: "{{ lookup('pipe','date') }}" | |
test_files: | |
- test1 | |
- test2 |
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/perl | |
use strict; | |
use warnings; | |
# A proof of concept for a next generation context object | |
# that doesn't require the use of local and direct access | |
# to the stash HASH reference. | |
# | |
# pros: | |
# no use of local |