Skip to content

Instantly share code, notes, and snippets.

---
- hosts: all
tasks:
- name: success bar.yml
shell: /bin/true
[web1]
host_patern01
host_patern02
host_patern03
[web2]
host_patern04
host_patern05
host_patern06
---
- 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
f2f35da2716d logstash "/docker-entrypoint.s" 32 seconds ago Up 31 seconds logstash
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
- 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
4 - name: get httpd.git
5 git:
6 repo=https://{{ git_cred }}@xxxxx
7 dest=/root/xxxx
8 accept_hostkey=true
---
- hosts: localhost
connection: local
roles:
- awesome
- 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
@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