Skip to content

Instantly share code, notes, and snippets.

@zbyte64
zbyte64 / sample.py
Created June 27, 2016 23:00
Docker py put archive example
import tarfile
import time
from io import BytesIO
admin_password = 'xxxxx'
#write password to file
pw_tarstream = BytesIO()
pw_tar = tarfile.TarFile(fileobj=pw_tarstream, mode='w')
file_data = admin_password.encode('utf8')
@gauravve
gauravve / install_ansible.sh
Last active November 4, 2019 15:35
Install ansible using pip on centos7
sudo rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
#Yum
sudo yum -y update
sudo yum install -y python-devel
sudo yum install -y openssl-devel
sudo yum install -y libffi-devel
sudo yum -y install python-pip
@kyl191
kyl191 / inventory.py
Created January 18, 2015 06:36
Python Inventory file for Ansible
#!/usr/bin/python
from __future__ import print_function
import json
overarch = {}
overarch["us"] = [
"kc.example.com",
"la.example.net",
]
overarch["germany"] = ["de.test.net"]
@komuw
komuw / install NVM and nodeJS.yml
Created November 20, 2014 17:40
Ansible task to install nvm and nodeJS
#first seen here: http://www.snip2code.com/Snippet/63701/Ansible-task-to-install-nvm-and-node
# Here is how to install nvm and node in an Ansible task.
# I tried a bunch of different things, and as usual it's simple, but you have to get it right.
# The important part is that you have to shell with /bin/bash -c and source nvm.sh
---
- name: Install nvm
shell: >
curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh
creates=/home/{{ ansible_user_id }}/.nvm/nvm.sh