diff --git a/guides/common/modules/proc_importing-all-available-ansible-playbooks.adoc b/guides/common/modules/proc_importing-all-available-ansible-playbooks.adoc index 83a5ae4764d..2d397acb665 100644 --- a/guides/common/modules/proc_importing-all-available-ansible-playbooks.adoc +++ b/guides/common/modules/proc_importing-all-available-ansible-playbooks.adoc @@ -2,17 +2,25 @@ = Importing all available Ansible playbooks You can import all the available Ansible playbooks to {Project} from collections installed on {SmartProxy}. +{Project} creates job templates from the imported playbooks and places the templates in the `Ansible Playbook - Imported` job category. + +If you have a custom collection, place it in `/etc/ansible/collections/ansible_collections/_My_Namespace_/_My_Collection_`. .Prerequisites -* Ansible plugin in {Project} is enabled +* Ansible plugin is enabled. +* Your {Project} account has a role that grants the `import_ansible_playbooks` permission. .Procedure // Not available via Hammer/UI: https://projects.theforeman.org/issues/34318 -* Import the Ansible playbooks using the following API request: +* Import the Ansible playbooks by using the following API request: + [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# curl -X PUT 'Content-Type: application/json' https://_{foreman-example-com}_/ansible/api/v2/ansible_playbooks/sync?proxy_id=_My-{smart-proxy-context}-ID_ +# curl -X PUT -H 'Content-Type: application/json' https://_{foreman-example-com}_/ansible/api/v2/ansible_playbooks/sync?proxy_id=__My_{smart-proxy-context}_ID__ ---- + You get a notification in the {ProjectWebUI} after the import completes. + +.Next steps +* You can run the playbooks by executing a remote job from the created job templates. +For more information, see xref:executing-a-remote-job_{context}[]. diff --git a/guides/common/modules/proc_importing-an-ansible-playbook-by-name.adoc b/guides/common/modules/proc_importing-an-ansible-playbook-by-name.adoc index 815913e8389..e2fb411b34c 100644 --- a/guides/common/modules/proc_importing-an-ansible-playbook-by-name.adoc +++ b/guides/common/modules/proc_importing-an-ansible-playbook-by-name.adoc @@ -2,23 +2,32 @@ = Importing an Ansible playbook by name You can import Ansible playbooks by name to {Project} from collections installed on {SmartProxy}. +{Project} creates a job template from the imported playbook and places the template in the `Ansible Playbook - Imported` job category. + +If you have a custom collection, place it in `/etc/ansible/collections/ansible_collections/_My_Namespace_/_My_Collection_`. .Prerequisites -* Ansible plugin in {Project} is enabled +* Ansible plugin is enabled. +* Your {Project} account has a role that grants the `import_ansible_playbooks` permission. .Procedure // Not available via Hammer/UI: https://projects.theforeman.org/issues/34318 -. Fetch the available Ansible playbooks using the following API request: +. Fetch the available Ansible playbooks by using the following API request: + [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# curl -X GET 'Content-Type: application/json' https://_{foreman-example-com}_/ansible/api/v2/ansible_playbooks/fetch?proxy_id=_My_{smart-proxy-context}_ID_ +# curl -X GET -H 'Content-Type: application/json' https://_{foreman-example-com}_/ansible/api/v2/ansible_playbooks/fetch?proxy_id=__My_{smart-proxy-context}_ID__ ---- . Select the Ansible playbook you want to import and note its name. -. Import the Ansible playbook using its name: +. Import the Ansible playbook by its name: + [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# curl -X PUT 'Content-Type: application/json' -d '{ "playbook_names": ["_My_Playbook_Name_"] }' https://_{foreman-example-com}_/ansible/api/v2/ansible_playbooks/sync?proxy_id=_My_{smart-proxy-context}_ID_ +# curl -X PUT -H 'Content-Type: application/json' -d '{ "playbook_names": ["_My_Playbook_Name_"] }' https://_{foreman-example-com}_/ansible/api/v2/ansible_playbooks/sync?proxy_id=__My_{smart-proxy-context}_ID__ ---- ++ You get a notification in the {ProjectWebUI} after the import completes. + +.Next steps +* You can run the playbook by executing a remote job from the created job template. +For more information, see xref:executing-a-remote-job_{context}[]. \ No newline at end of file