Katello / katello-client-bootstrap

Bootstrap Script for migrating systems to Foreman & Katello
GNU General Public License v2.0
52 stars 63 forks source link

[RFE] Add flag to execute "Play ansible roles" #308

Open giovannisciortino opened 5 years ago

giovannisciortino commented 5 years ago

Satellite from version 6.4 support the execution on ansible roles associated to hosts. A new flag on bootstrap.py script could be useful to trigger automatically the execution of the Ansible roles associated to the host after its registration.

Note: The ansible roles can be associated to an host during registration process associating them to a hostgroup.

This is an example of the API call used to trigger the execution of ansible roles :

[root@client ~]# curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u user:password -k -d "{\"job_invocation\" : {\"job_template_id\": 126, \"inputs\": {}, \"ssh\": {}, \"recurrence\": {}, \"scheduling\": {}, \"concurrency_control\": {}, \"search_query\": \"name = $(hostname)\", \"targeting_type\": \"static_query\"}}" https://satellite.work.lab/api/job_invocations