Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| # set the base image to Debian | |
| # https://hub.docker.com/_/debian/ | |
| FROM debian:latest | |
| # replace shell with bash so we can source files | |
| RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
| # update the repository sources list | |
| # and install dependencies | |
| RUN apt-get update \ |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
| #!/usr/bin/env python | |
| import time | |
| import boto | |
| import boto.ec2.elb | |
| import boto.utils | |
| from flask.ext.script import Manager | |
| from closeio.main import setup_app |
| #!/bin/bash | |
| # | |
| # /!\ moved to https://github.com/bdossantos/nagios-plugins | |
| # | |
| # check_ddos Nagios plugin | |
| # | |
| # Options : | |
| # -w/--warning) | |
| # Warning value (number of SYN_RECV) | |
| # |
| # Bundler Integration | |
| require "bundler/capistrano" | |
| # Application Settings | |
| set :application, "yourapplicationname" | |
| set :user, "serveruser" | |
| set :deploy_to, "/home/#{user}/rails-applications/#{application}" | |
| set :rails_env, "production" | |
| set :use_sudo, false | |
| set :keep_releases, 3 |