Written for ansible 1.8
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
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>
ansible-galaxy install -r requirements.yml
Now you can run with this command (on the development machine)
ansible-playbook media_center.yml -b -v
-b | become sudo |
-v | verbose |
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'
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.
ansible <target ip> -m setup
media_center | Installs XBMC with LTSP (fat-clients) |
ltsp_thin | Thin client server |
ltsp_fat | Fat client server |
webserver | Ruby on Rails server |
- [X] Look at changes from 1.2 to 1.5 and optimise
- [X] Update any ‘cp’ command to using the copy module. Since ansible 1.4 the copy module allows recursive copy.
- [ ] Change all $var to {{ var }}