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 python3 | |
import diagram | |
import copy | |
import attrdict | |
import yaml | |
from diagram.utils import dict_merge | |
CONFIG=""" | |
--- |
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
# charsets and colour palettes | |
set -g status-utf8 on | |
set -g utf8 on | |
set -g default-shell /bin/bash | |
set-option -g default-command "exec /bin/bash" | |
set -g default-terminal screen-256color | |
# more obvious window splits | |
bind | split-window -h | |
bind - split-window -v |
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: do something that needs a virtualenv | |
vars: | |
ansible_python_interpreter: /path/to/venv/bin/python | |
modulename: | |
params: ... |
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
--- | |
os_repos: | |
- name: epel | |
gpgcheck: yes | |
baseurl: https://wibble.com/repos/epel/x86_64 | |
gpgkey: http://wibbl.com/repos/RPM-GPG-KEY |
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
conf_docker_containers: | |
portainer: | |
image: portainer/portainer | |
state: started | |
restart_policy: always | |
published_ports: "9000:9000" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- name: provision docker containers |
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
admins: | |
- name: username1 | |
pass: <redacted> | |
- name: username2 | |
pass: <redacted> | |
home: "elephant" <-- means you'll get HOMEROOT/elephant rather that HOMEROOT/username2 |
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
admins: | |
- name: username | |
pass: <redacted> | |
home: "/home/username" | |
when: inventory_hostname == "host1" | |
- name: username | |
pass: <redacted> | |
home: "/newhome/username" | |
when: inventory_hostname != "host1" |
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
--- | |
# failed_when is off because you want the var to register even if there are no matching files in /etc/init.d | |
- name: Get startup file list | |
shell: grep -l kiwix-serve /etc/init.d/* | |
register: startup_file_list | |
failed_when: no | |
# basename gives the filename of the init script, the 'service' module will find it | |
- name: Stop running kiwix service | |
service: |
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: test looped include | |
hosts: localhost | |
vars: | |
pathnames: | |
- dir1 | |
- dir2 | |
- dir3 | |
tasks: | |
- include: globit.yml |
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 python | |
from __future__ import print_function, absolute_import, division | |
import os | |
import sys | |
from jinja2 import Environment, Template, FileSystemLoader | |
from jinja2.exceptions import TemplateSyntaxError | |
from argparse import ArgumentParser | |
import traceback | |
def parseargs(argv): |