How do I install an ansible role using ansible?
The manual way is using the command line:
ansible-galaxy install user.role
But how do I do it in ansible itself, like a module? I would guess something like this in a playbook:
- tasks:
galaxy:
user: username
role: rolename
state: installed
This seems to be a very trivial and elementary task, but I can't find how to do it.
There is a similar question here How to automatically install Ansible Galaxy roles? .But it doesn't answer it, as it just runs the manual command every time, and it is not idempotent (that is the main reason to use ansible to automate stuff).