Use with precaution! This repository is in constant development.
This is my personal repository of installation shell scripts and Ansible playbooks. I use them for teaching purposes as DevOps Coach.
Please fork, use and comment this repo ;)
New Debian based system? Then run...
$ bash provision-sh/vagrant-bootstrap-ansible.sh
1. Ansible Playbooks
Recommended reading: An Ansible summary
-
Install VirtualBox
-
Install Vagrant
-
Install Python
-
Clone this repository into a local folder
$ git clone https://github.com/carlessanagustin/provisioning-configuration-management.git ~/provisioning
-
Enter into new folder
$ cd ~/provisioning
-
Install Ansible and its requirements
$ pip install -r requirements
NOTE: You can fully install Ansible environment into the system or use a virtualenv for that purpose.
-
Enter into folder
$ cd ~/provisioning
-
There are a few selected boxes ready to use
Name | Provisioning | Contents |
---|---|---|
zipi | ansible role | base |
zape | ansible role | base |
lamp | ansible role | Linux, Apache, MySQL & PHP |
iac | ansible | Infrastructure as Code |
scripting | shell file or inline | --- |
n1 + n2 + n3 | ansible | consul testing |
-
Edit Vagrantfile
$ vim Vagrantfile
-
Customize Vagrantfile
zipi.vm.box = "ubuntu/trusty64" ansible.tags = ['base', 'ansible'] ansible.playbook = "provision-ansible/install-all.yml" ansible.extra_vars = { ansible_ssh_user: 'vagrant', vagrant_enable: true }
-
Run the selected box
$ vagrant up [name]
For more vm.box options: https://atlas.hashicorp.com/boxes/search
-
Edit Ansible Playbook and customize it
$ vim provision-ansible/install-all.yml
-
Start vagrant
$ vagrant up --provision
-
Enter into folder
$ cd ~/provisioning/provision-ansible
-
Edit Ansible Playbook and customize it
$ vim install-all.yml
-
Edit Inventory file and customize it
$ vim hosts/all
-
List tasks and hosts the Playbook will affect
$ ansible-playbook install-all.yml -i hosts/all --list-tasks --list-hosts
-
If you are happy with step 6 then provision your machine(s)
$ ansible-playbook install-all.yml -i hosts/all -vvvv
-- by http://www.carlessanagustin.com 2015 --
-
Install VirtualBox
-
Install Vagrant
-
Clone this repository into a local folder
$ git clone https://github.com/carlessanagustin/provisioning-configuration-management.git
-
Rename any of the Vagrantfile_XX-sh files to Vagrantfile
$ cp Vagrantfile_01-sh Vagrantfile
-
Edit Vagrantfile
$ vim Vagrantfile
-
Customize it
....vm.box = "ubuntu/trusty64" ....vm.provision :shell, :path => "provision-sh/vagrant-bootstrap-XXX.sh"
For more vm.box options: https://atlas.hashicorp.com/boxes/search
-
Edit provision-sh/vagrant-bootstrap-XXX.sh and customize it
$ vim provision-sh/vagrant-bootstrap-XXX.sh
-
Start vagrant
$ vagrant up --provision
-- by http://www.carlessanagustin.com 2015 --