Skip to content

andrejvidic/ansible_recipes

 
 

Repository files navigation

Ansible Recipes

Version tested

Written for ansible 1.8

Target (Server in need of configuration)

Install Debian 8 into virtual box (name: debian8)

Login as root

ssh root@<target ip>

Install sudo

apt-get update
apt-get install sudo

Add a deploy user & set a password

adduser deploy

Add your user to the ‘sudo’ group within /etc/group

sudo:x:27:deploy

Don’t ask for a password when using sudo, risky (optional) Note: This is optional if you are using the -b then there is no need for this. /etc/sudoers

%sudo   ALL = NOPASSWD: ALL
%sudo   ALL= (postgres) NOPASSWD: ALL

Source (Your development box)

Ansible 1.8 (currently the HEAD branch when you clone).

sudo apt-get install python-yaml python-jinja2 python-paramiko
git clone https://github.com/ansible/ansible.git
cd ansible
git submodule update --init --recursive
sudo make install 

(Make sure you do not have any other ansible installed through your systems package manager).

Clone this repo (ansible-recipes)

git clone https://github.com/map7/ansible_recipes.git

Install the roles

sudo ansible-galaxy install Heroqu.nodejs4x
sudo ansible-galaxy install mtpereira.passenger

Add target’s IP to /etc/ansible/hosts file under the top ungrouped section EG:

192.168.0.100

Create passwordless access (server to client)

ssh-copy-id deploy@<target ip>

Install required roles

ansible-galaxy install -r requirements.yml

Running

Now you can run with this command (on the development machine)

ansible-playbook media_center.yml -b -v
-bbecome sudo
-vverbose

NOTE With mysql I leave the password blank for the root user until I’ve finished setup, then manually assign a new password using the following;

mysqladmin -u root password 'newpassword'

Custom variables

Create your custom variables in vars/custom.yml (this is ignored in the repository) Place it at the bottom of your vars list to override the defaults I’ve set.

Check environment variables

ansible <target ip> -m setup

Available configurations

media_centerInstalls XBMC with LTSP (fat-clients)
ltsp_thinThin client server
ltsp_fatFat client server
webserverRuby on Rails server

Update to 1.9

Update to 2.0

  • [ ] Change all $var to {{ var }}

About

My Ansible Recipes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%