This file contains 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
ansible-playbook test.yml --extra-vars "ver=test_version_2" | |
ansible-playbook test.yml --extra-vars '{"ver":"test_version_2"}' | |
ansible-playbook test.yml --extra-vars "@ver.json" |
This file contains 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: clone git | |
git: | |
repo: repo_addr | |
dest: /dest/dir | |
version: "{{ ver | default('develop') }}" |
This file contains 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: Task1 restart machine | |
shell: sleep 2 && shutdown -r now "Ansible updates triggered" | |
async: 1 | |
poll: 0 | |
- name: Task2 waiting for server to come back | |
local_action: wait_for host={{ ansible_ssh_host }} port={{ ansible_ssh_port }} delay=5 timeout=300 state=started | |
- name: Task3 ping | |
action: ping |
This file contains 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
--- | |
- hosts: webservers | |
sudo: yes | |
tasks: | |
- name: yum update | |
action: yum name=* state=latest | |
- name: yum install epel | |
yum: name=epel-release.noarch state=latest | |
- name: download remi repo rpm | |
get_url: url=http://rpms.famillecollet.com/enterprise/remi-release-7.rpm dest=/root/ |
This file contains 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
__author__ = 'huhushow' | |
import json, sys, getopt, base64, hashlib | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS).encode() | |
unpad = lambda s: s[:-ord(s[len(s)-1:])] | |
def iv(): |