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
| *** 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
| # 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
| # 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
| # 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) |
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
| //logical-interface[name='lo0.0']/address-family[address-family-name='inet']/interface-address[ifa-flags/ifaf-current-primary]/ifa-local |
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
| # Adapted from https://stackoverflow.com/questions/35869985/datetime-datetime-is-not-json-serializable | |
| import datetime | |
| import json | |
| import boto3 | |
| def datetime_handler(x): | |
| if isinstance(x, datetime.datetime): | |
| return x.isoformat() |
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
| jeffl@ubuntu:~/vault_testing$ cat vars/secrets.yml | |
| --- | |
| username: jeffl | |
| password: secretpassword | |
| jeffl@ubuntu:~/vault_testing$ | |
| 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 |
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 https://stackoverflow.com/questions/47644034/cloudformation-error-value-of-property-networkinterfaces-must-be-a-list-of-obje | |
| MyAppNetworkInterface: | |
| Type: AWS::EC2::NetworkInterface | |
| Properties: | |
| SubnetId: !Ref SubnetPrivate | |
| MyApp: | |
| Type: AWS::EC2::Instance | |
| Properties: |
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 -xe | |
| yum update -y | |
| yum install -y httpd | |
| systemctl start httpd | |
| systemctl enable httpd | |
| usermod -a -G apache ec2-user | |
| chown -R ec2-user:apache /var/www | |
| chmod 2775 /var/www | |
| find /var/www -type d -exec chmod 2775 {} \; | |
| find /var/www -type f -exec chmod 0664 {} \; |