Skip to content

map7/ansible_recipes

Repository files navigation

Ansible Recipes

Version tested

ansible2.2
debian9 “stretch”

Target (Server in need of configuration)

Install Debian 8 into virtual box (name: debian8)

Login as root

ssh root@<target ip>

Install sudo & python

apt-get update
apt-get install sudo python ssh mg

Add a deploy user & set a password

/sbin/adduser deploy

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

/sbin/adduser deploy sudo 

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)

Create passwordless access (server to client)

ssh-copy-id deploy@<target ip>

<Optionally take a snapshot here of your server>

Ansible 2.2 (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

Install required roles

sudo ansible-galaxy install -r requirements.yml --roles-path /etc/ansible/roles --force

Running

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

For server boxes

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

For dev (non server) boxes

ansible-playbook dev.yml -K -v
-Kask for sudo password and pass
-vverbose

NOTES

  1. For an encypted ssh key file with password, to prevent always being asked for password
eval `ssh-agent`
ssh-add /home/user/.ssh/id_rsa
  1. 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.2 [62%]

Change all $var to {{ var }}

Add oh_my_zsh install

Pull oh_my_zsh config from github

Update locale & ensure locale works correctly

Determine if we need phantomJS

Add multi language switching support

Ensure Rbenv installs to latest version

Remove all force=yes and replace with

About

My Ansible Recipes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages