Skip to content

Instantly share code, notes, and snippets.

View zhoujiealex's full-sized avatar

karl zhoujiealex

View GitHub Profile
@zhoujiealex
zhoujiealex / pedantically_commented_playbook.yml
Created October 28, 2016 09:23 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ 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.
@zhoujiealex
zhoujiealex / Ansible-Vault how-to.md
Created October 24, 2016 09:10 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

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.

H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
q2Kw2pjoiDs5gIH-uw5U49JzOB6otS7kThBJE-H9A76u4uUvR8DKb+VcB
rWu5qSJGEnbsXNfJdq5L2D8QgRdV-sXHp2A-7j1X2n4WIISvU1V9koIyS
NisHFBTcWJS0sC5BTFwrtfLEE9lEwz2bxHQpWJiu12ZeKpi+7oUSqebX+
@zhoujiealex
zhoujiealex / alert.js
Last active August 29, 2015 14:08 — forked from wzpan/alert.js
var render = hexo.render;
/**
* alert tag
*
* Syntax:
* {% alert caption [style] %}
* Alert string
* {% endalert %}
*/
@zhoujiealex
zhoujiealex / ludatui.py
Last active August 29, 2015 14:08 — forked from zippera/ludatui.py
#coding=utf8
##版本:1.0
##环境:python2.7
##作者:moxie
##日期:2013.08.23
##说明:文件生成目录为:D:/ludatui
import urllib2,urllib
import re