View ansible-vault-usage-example
jeffl@ubuntu:~/vault_testing$ cat vars/secrets.yml
username: jeffl
password: secretpassword
jeffl@ubuntu:~/vault_testing$ echo "my_vault_pass" > vault_pass
jeffl@ubuntu:~/vault_testing$ chmod go-r vault_pass
jeffl@ubuntu:~/vault_testing$ ansible-vault encrypt --vault-id vault_pass vars/secrets.yml
# Adapted from
import datetime
import json
import boto3
def datetime_handler(x):
if isinstance(x, datetime.datetime):
return x.isoformat()
View xpath_junos_primary_loopback
# This gist demonstrates how to use PyEZ's get_config RPC
from jnpr.junos import Device
from lxml import etree
def example_one(dev):
# This uses default options
cnf = dev.rpc.get_config()
print etree.tostring(cnf)
View get-candidate-config.yml
# This ansible playbook gets the candidation configuration
- name: Get configuration
hosts: all
connection: local
gather_facts: no
- Juniper.junos
- name: Getting router configs
# Pulled from Google Groups post by Stacy Smith
import sys
import getpass
from lxml import etree
from jnpr.junos.device import Device
# Python3 is input(), Python2 is raw_input()
View simple_test_v2.robot
*** Settings ***
Documentation Check arithmetic operations
Resource ${EXEC_DIR}/resources/keywords.txt
# currently only prints to output.xml
Suite Setup math.setup
Suite Teardown math.teardown
*** Variables ***
View simple_test.robot_v1
*** Settings ***
Documentation Check arithmetic operations
Library ${EXECDIR}/lib/ WITH NAME math
# The setup and teardown functions currently only print messages to output.xml
Suite Setup math.setup
Suite Teardown math.teardown
import logging
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG,
format='%(asctime)s.%(msecs)d %(levelname)s %(module)s - %(funcName)s: %(message)s',
datefmt="%Y-%m-%d %H:%M:%S")
logging.debug("Here is a debug-level message")
View Dockerfile
# based on Duke Dougal's post at
FROM ubuntu:trusty
ENV USER ubuntu
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN adduser --disabled-password --gecos "" $USER
RUN adduser $USER sudo
ADD authorized_keys /home/$USER/.ssh/authorized_keys
RUN chown $USER /home/$USER/.ssh/authorized_keys
RUN chown -R $USER:$USER /home/$USER/.ssh/authorized_keys