Template for making your own cross-platform ansible module in golang.
If you use the defaults, you can run this to try out the cookiecutter template:
cruft create https://github.com/jamesandariese/cookiecutter-ansible-golang-module
cd ansible-generate_prime
bash rebuild.sh
ansible-doc -t module acme.samples.generate_prime
This will create a samples
collection in the acme
namespace. In that
collection, there will be a generate_prime
module which you can use in any
ansible playbook after running rebuild.sh
.
For using cookiecutter
instead of cruft
, use the following instead:
cookiecutter https://github.com/jamesandariese/cookiecutter-ansible-golang-module
Ensure you update your license if you want to use something other than MIT.