Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| from flask import current_app | |
| class FeatureFlags(object): | |
| def __init__(self, app=None): | |
| if app is not None: | |
| self.init_app(app) | |
| def init_app(self, app): |
| Python Cheatsheet | |
| ================= | |
| ################################ Input & Output ############################### | |
| name = input('please enter your name: ') | |
| print('hello,', name) | |
| ageStr = input('please enter your age: ') | |
| age = int(ageStr) |
| { | |
| "Description": "Drone Continuous Integration (drone.io)", | |
| "Parameters": { | |
| "VPC": { | |
| "Type": "AWS::EC2::VPC::Id", | |
| "Description": "The VPC that needs provisioning" | |
| }, | |
| "Subnets": { | |
| "Type": "List<AWS::EC2::Subnet::Id>", |
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
| #!/bin/bash | |
| # User data to configure a vanilla Ubuntu EC2 instance. | |
| # Installs chef-client (with minimal dependencies), | |
| # configures chef, and adds roles | |
| test $UID == 0 || (echo "Error: must run as root"; exit 1) | |
| ######### STEP 1: OPERATING SYSTEM CONFIGURATION | |
| BOOTLOG="/var/log/bootstrap.log" |
| # Installation | |
| Download the file | |
| $ wget https://gist.githubusercontent.com/bwhaley/490a1ee890c0f010b1f3/raw/b471e67138be484a0140e5ca420b0ffca7726ed1/artifactory.py | |
| Install the requests library | |
| $ pip install requests | |
| Set TEAMCITY env vars | |
| $ export TEAMCITY_USERNAME=ben |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| # Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too. | |
| # Also note that this config is using the LetsEncrypt staging server, remove the flag when ready! | |
| Resources: | |
| sslSecurityGroupIngress: | |
| Type: AWS::EC2::SecurityGroupIngress | |
| Properties: | |
| GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]} | |
| IpProtocol: tcp | |
| ToPort: 443 |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |