Skip to content

Instantly share code, notes, and snippets.

Hostname "host"
#LoadPlugin "logfile"
#<Plugin "logfile">
# LogLevel "info"
# File "/var/log/collectd.log"
# Timestamp true
#</Plugin>
#LoadPlugin interface
@serialdoom
serialdoom / lala.yml
Last active August 29, 2015 14:25
sample yml
---
- hosts: all
tasks:
- name: download something
get_url: url=http://www.mirrorservice.org/sites/cdimage.ubuntu.com/cdimage/releases/12.04.4/release/FOOTER.html dest=/tmp sha1sum=06b9d699e977494ed2b3789a702d43ea7fa487fe
#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T
#System language
lang en_GB
#Language modules to install
langsupport en_GB
#System keyboard
keyboard gb
#System mouse
@serialdoom
serialdoom / aws.yml
Last active September 23, 2015 15:08
---
# Based heavily on the Ansible documentation on EC2:
# http://docs.ansible.com/ec2_module.html
- name: Provision an EC2 node
hosts: localhost
connection: local
gather_facts: False
tags: provisioning
vars:
instance_type: t1.micro
- name: pip install required stuff
sudo: no
remote_user: jenkins
pip: name={{ item }} extra_args="--user --upgrade"
with_items:
- sh
- netaddr
- unittest-xml-reporting
tags: pip
---
- hosts: localhost
connection: local
roles:
- awesome
4 - name: get httpd.git
5 git:
6 repo=https://{{ git_cred }}@xxxxx
7 dest=/root/xxxx
8 accept_hostkey=true
- name: apt-get stuff
apt: name={{ item }} update_cache=yes cache_valid_time="86400"
sudo: yes
with_items:
- mysql-server
- python-mysqldb
register: apt_get
- name: test root password
shell: mysql -uroot -p{{ mysql_root_pass }} -e 'show databases;' &> /dev/null
ansible-playbook mysql.yml --limit test-206 -b -v
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [test-206]
TASK: [mysql | apt-get stuff] *************************************************
changed: [test-206] => (item=mysql-server,python-mysqldb) => {"changed": true, "item": "mysql-server,python-mysqldb", "stderr": "\rProxy that will be used: h
ttp://deploy-jenkins.decibelinsight.net:3128\nmysql start/running, process 2496\n", "stdout": "Reading package lists...\nBuilding dependency tree...\nReading
---
- hosts: server_ip
gather_facts: no
remote_user: root
tasks:
# this task will run to the remote host, ie server_ip, so it will try to perform an "ssh -i server_ip" from the host itself.
- name: check devise status
shell: ssh -i server_ip "show vd"
register: output