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 2b521a0279 Move stuff to roles and remove a password, it's not required. 2019-01-10 11:41:39 +00:00
files Initial commit. 2019-01-03 11:17:38 +00:00
inventory Move stuff to roles and remove a password, it's not required. 2019-01-10 11:41:39 +00:00
.gitignore Move stuff to roles and remove a password, it's not required. 2019-01-10 11:41:39 +00:00
README.md Initial commit. 2019-01-03 11:17:38 +00:00
ansible.cfg Simpler. 2019-01-06 14:25:58 +00:00
playbook.yml Move stuff to roles and remove a password, it's not required. 2019-01-10 11:41:39 +00: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

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/