Setup a machine to write Ansible roles. Includes:
ansible-galaxy collection install robertdebock.development_environment
- One machine
- About 4GB or RAM will do.
- 2 CPUs, 1 will also do.
- Personalized
inventory/group_vars/all.yml.
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 VagrantfileFor libvirt / Linux:
rm Vagrantfile
ln -s Vagrantfile.libvirt VagrantfileNow change a few files:
files/gitconfigshould contain your details.files/id_rsashould contain an ssh-key used to commit to GitHub.inventory/hostsshould contain your machine.inventory/group_vars/all.ymlshould contain your details.
Simply run ./playbook.yml. Preparing your system will take about 15 minutes or so.
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-latestYou can see the playbook runs on https://localhost:9191/