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
# This ansible playbook gets the candidation configuration | |
- name: Get configuration | |
hosts: all | |
connection: local | |
gather_facts: no | |
roles: | |
- Juniper.junos | |
tasks: | |
- name: Getting router configs |
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
# Pulled from Google Groups post by Stacy Smith | |
# https://groups.google.com/forum/#!topic/junos-python-ez/1OfnulLkyn4 | |
import sys | |
import getpass | |
from lxml import etree | |
from jnpr.junos.device import Device | |
# Python3 is input(), Python2 is raw_input() |
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
*** 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 *** |
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
*** Settings *** | |
Documentation Check arithmetic operations | |
Library ${EXECDIR}/lib/easy_math.py WITH NAME math | |
# The setup and teardown functions currently only print messages to output.xml | |
Suite Setup math.setup | |
Suite Teardown math.teardown |
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 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") |
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
# based on Duke Dougal's post at http://superuser.com/questions/844101/docker-login-via-ssh-always-asks-for-password | |
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 |
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: Get primary lo0 address | |
hosts: all | |
connection: local | |
gather_facts: no | |
roles: | |
- Juniper.junos | |
- cmprescott.xml | |
vars: | |
temp_dir: /tmp | |
USER: jeffl |
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
//interfaces/interface[name='lo0']/unit[name='0']/family/inet/address/primary/preceding-sibling::name |
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
From phusion/baseimage:0.9.18 | |
MAINTAINER Jeff Loughridge <[email protected]> | |
RUN apt-get update && apt-get -y install --no-install-recommends \ | |
git \ | |
nano \ | |
openssh-server \ | |
python-apt \ | |
software-properties-common |
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
#jinja2: lstrip_blocks: True | |
{% set vlans_per_ifl = 10 %} | |
{% for ifd, int in host.uplinks.items() %} | |
{{ ifd }} { | |
description "{{ int.description }}"; | |
apply-groups-except interface-properties; | |
vlan-tagging; | |
mtu 9432; |