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
# | |
# Block to install Shipyard onto docker_swarm_manager - if required | |
# | |
- block: | |
- name: "Check if Shipyard is installed" | |
shell: docker ps | grep -c "shipyard/shipyard" | |
ignore_errors: yes | |
become: no | |
register: shipyard_test | |
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
#!/bin/bash | |
V=$1 | |
containers=$(cat ~/.vagrant.d/data/machine-index/index | jq '.machines[] | {name} | to_entries[] | .value') | |
if [ $(echo $containers | grep -c \"$V\") -ne 1 ] ; then | |
echo "Can't find $V in container list" | |
echo $containers | |
exit 2 |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# vim: noai:ts=2:sw=2:et | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
UBUNTU_BOX='ubuntu/trusty64' | |
CENTOS_BOX='centos/7' |
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
# vim: noai:ts=2:sw=2:et | |
--- | |
- name: "substring/slices sorting tests" | |
hosts: localhost | |
vars: | |
servers: | |
apps: |
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
$ ansible-playbook test-add_host.yml | |
[WARNING]: provided hosts list is empty, only localhost is available | |
PLAY [Play 1] ****************************************************************** | |
TASK [Show inventory - play 1a] ************************************************ | |
ok: [localhost] => { | |
"groups": { | |
"all": [], |
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
# vim: noai:ts=2:sw=2:et | |
--- | |
- name: "testing hosts and delgation" | |
# ansible-playbook --connection=local -i "localhost,ubuntu" a.yml | |
hosts: all | |
gather_facts: no |
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
ubuntu@nx-demo01-1b-jumpserver:~$ ansible-playbook --version | |
ansible-playbook 2.2.1.0 | |
config file = | |
configured module search path = Default w/o overrides |
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
# vim: noai:ts=2:sw=2:et | |
--- | |
- name: "Test block tag include block tag" | |
hosts: localhost | |
connection: local | |
gather_facts: no | |
tasks: |
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
import ipaddress | |
import os | |
import hashlib | |
import hmac | |
import base64 | |
# markers (optional), hostnames, keytype, base64-encoded key, comment. The fields are separated by spaces. | |
# Hashed hostnames start with a | character. Only one hashed hostname may appear on a single line and none of the above negation or wildcard operators may be applied. |
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
--- | |
#!/usr/bin/env ansible-playbook | |
# vim: noai:ts=2:sw=2:et | |
# how to loop through a dict with lists and dicts that reference other vars dicts | |
# note that the dict keys dont have '-' but '_' so that jinja2 doesnt try and parse them as subtraction. | |
- name: Test for Jon |
NewerOlder