Permalink
Browse files

Create ansible basic structure to setup a web server

  • Loading branch information...
EHER committed May 1, 2013
1 parent 5f6111d commit dd2f164f4702ed4b28a907c91f2f82f65fda4c7f
Showing with 76 additions and 3 deletions.
  1. +50 −3 README.md
  2. +5 −0 ansible.cfg
  3. +6 −0 deps.txt
  4. +1 −0 hosts
  5. +14 −0 playbook.yml
View
@@ -1,4 +1,51 @@
my-ansible
==========
# my-ansible
My Servers' configurations using Ansible
My Ansible configuration repository
# Installation
Clone the repository
```bash
git clone git://github.com/EHER/my-ansible.git
cd my-ansible
```
You should use pip to install dependencies (virtualenv is recommended)
```bash
pip instal deps.txt
```
# Configuration
Configure you remote user and where are your private key
```bash
vim ansible.cfg
```
```
[defaults]
hostfile = ./hosts
module_name = command
#remote_user = ubuntu
#private_key_file = /where/hell/are/your/key.pem
```
Add your machines to hosts file:
```bash
vim hosts
```
```
[webservers]
my-aws-host-or-something-like-this.com
other-host.com
```
Then test your configuration
```bash
ansible all -m ping
```
# Using
Just run the playbook
```bash
ansible-playbook playbook.yml
```
View
@@ -0,0 +1,5 @@
[defaults]
hostfile = ./hosts
module_name = command
#remote_user = ubuntu
#private_key_file = /where/hell/are/your/key.pem
View
@@ -0,0 +1,6 @@
Jinja2==2.6
PyYAML==3.10
ansible==1.1
paramiko==1.10.1
pycrypto==2.6
wsgiref==0.1.2
View
1 hosts
@@ -0,0 +1 @@
[webservers]
View
@@ -0,0 +1,14 @@
---
- hosts: webservers
sudo: yes
tasks:
- name: add ondrej php repository
action: apt_repository repo=ppa:ondrej/php5
- name: add nginx repository
action: apt_repository repo=ppa:nginx/stable
- name: update apt repository cache
action: apt update_cache=yes
- name: install php
action: apt pkg=php5 force=yes
- name: install nginx
action: apt pkg=nginx

0 comments on commit dd2f164

Please sign in to comment.