Setup a machine to develop Ansible roles, including all the easy to work with tools, ansible, ansible-lint, molecule, travis and ara.
Go to file
Robert de Bock 75c00cad61 Adding all new repos. 2019-02-28 06:33:00 +01:00
files Initial commit. 2019-01-03 11:17:38 +00:00
inventory Adding all new repos. 2019-02-28 06:33:00 +01:00
roles Add php_fpm remove digitalocean_agent 2019-02-20 12:33:58 +01:00
.gitignore Include requirements.yml 2019-01-26 14:26:04 +01:00
README.md Cleanup and run on Mac. 2019-01-26 14:24:05 +01:00
Vagrantfile Add ubuntu to both libvirt and virtualbox and fix ordering. 2019-01-28 13:30:45 +01:00
Vagrantfile.libvirt Add ubuntu to both libvirt and virtualbox and fix ordering. 2019-01-28 13:30:45 +01:00
Vagrantfile.virtualbox Add ubuntu to both libvirt and virtualbox and fix ordering. 2019-01-28 13:30:45 +01:00
ansible.cfg Small fixes. 2019-01-26 06:42:12 +01:00
playbook.yml Add php_fpm remove digitalocean_agent 2019-02-20 12:33:58 +01:00

README.md

Ansible development environment

Setup a machine to write Ansible roles. Includes:

Download

In some directory, maybe Documents run:

git clone https://github.com/robertdebock/ansible-development-environment
cd ansible-development-environment

Setup

Download all required roles:

ansible-galaxy install --role-file roles/requirements.yml

Mac / Linux

Vagrant requires a different file for Virtualbox (typically Mac OS X) and libvirt (typically Linux).

For Virtualbox / Mac OS X:

rm Vagrantfile
ln -s Vagrantfile.virtualbox Vagrantfile

For libvirt / Linux:

rm Vagrantfile
ln -s Vagrantfile.libvirt Vagrantfile

Now change a few files:

  • files/gitconfig should contain your details.
  • files/id_rsa should contain an ssh-key used to commit to GitHub.
  • inventory/hosts should contain your machine.
  • inventory/group_vars/all.yml should contain your details.

Install

Simply run ./playbook.yml. Preparing your system will take about 15 minutes or so.

Code

You are now ready to code! Have fun using these commands:

# See if your code meets all rules.
ansible-lint .
# Test all scenarios.
molecule test
# Test a specific scenario.
molecule test --scenario-name fedora-latest

You can see the playbook runs on https://localhost:9191/