rundeck-plugins / ansible-plugin

Ansible Integration for Rundeck
MIT License
331 stars 100 forks source link

Using the --limit flag for the Ansible Ad-Hoc Node Executor #245

Closed mbigras closed 5 years ago

mbigras commented 5 years ago

I only want the ansible inside my rundeck instance to reach a subset of my hosts via the Ansible Ad-Hoc Node Executor.

Is it possible to use set the ansible extra parameter for the Ansible Ad-Hoc Node Executor?

I know I can do this for jobs with the ansible-extra-param options, for example something like:

ansible-extra-param: --limit some_group

However, I haven't found a way to do this with the Ansible Ad-Hoc Node Executor.

I checked out what ansible is running when using the Node Executor and found this line:

root     254768 249409  0 23:45 ?        00:00:00 /usr/bin/python3 /usr/bin/ansible-playbook gather-hosts.yml --extra-vars=@/tmp/ansible-runner4227973250244176439extra-vars

So I wonder how to get a --limit flag in that command string

mbigras commented 5 years ago

The ansible-limit configuration option is described in the README here:

https://github.com/Batix/rundeck-ansible-plugin#configuration

ansible-limit - Global groups limits can be set at the project level to filter hosts/groups from the Ansible inventory. See http://docs.ansible.com/ansible/intro_patterns.html for syntax help.