From c14385a843c6ce77704c6b72ffa92690a6cd1856 Mon Sep 17 00:00:00 2001 From: Zuzana Lena Ansorgova Date: Mon, 8 Apr 2024 20:36:30 +0200 Subject: [PATCH 1/3] Add running Ansible playbook in Foreman --- .../proc_running-an-ansible-playbook.adoc | 27 +++++++++++++++++++ .../master.adoc | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 guides/common/modules/proc_running-an-ansible-playbook.adoc diff --git a/guides/common/modules/proc_running-an-ansible-playbook.adoc b/guides/common/modules/proc_running-an-ansible-playbook.adoc new file mode 100644 index 00000000000..5901b9a6195 --- /dev/null +++ b/guides/common/modules/proc_running-an-ansible-playbook.adoc @@ -0,0 +1,27 @@ +[id="running-an-ansible-playbook-from-{project-context}_{context}"] += Running an Ansible playbook from {Project} + +You can run an Ansible playbook on a host or host group by executing a remote job in {Project}. + +.Prerequisites +* Ansible plugin in {Project} is enabled. +* You have configured xref:Configuring_and_Setting_Up_Remote_Jobs_{context}[remote job execution]. +* You have an Ansible playbook ready to use. + +.Procedure +. In the {ProjectWebUI}, navigate to *Monitor* > *Jobs*. +. Click *Run Job*. +. In *Job category*, select `Ansible Playbook`. +. In *Job template*, select `Ansible - Run playbook`. +. Click *Next*. +. Select the hosts on which you want to run the playbook. +. In the *playbook* field, paste the content of your Ansible playbook. +. Optional: Customize any advanced settings and schedule. +For more information, see xref:executing-a-remote-job_{context}[]. +. Click *Run on selected hosts*. + +.Additional resources +* Alternatively, you can import Ansible playbooks from {SmartProxy}. +For more information, see: +** xref:importing-an-ansible-playbook-by-name_{context}[] +** xref:importing-all-available-ansible-playbooks_{context}[] \ No newline at end of file diff --git a/guides/doc-Managing_Configurations_Ansible/master.adoc b/guides/doc-Managing_Configurations_Ansible/master.adoc index 942d1aea6d0..430e224cbe8 100644 --- a/guides/doc-Managing_Configurations_Ansible/master.adoc +++ b/guides/doc-Managing_Configurations_Ansible/master.adoc @@ -15,6 +15,8 @@ include::common/assembly_getting-started-with-ansible.adoc[leveloffset=+1] include::common/assembly_using-ansible-roles.adoc[leveloffset=+1] +include::common/modules/proc_running-an-ansible-playbook.adoc[leveloffset=+1] + include::common/assembly_configuring-and-setting-up-remote-jobs.adoc[leveloffset=+1] include::common/assembly_integrating-awx.adoc[leveloffset=+1] From a6881d2a250227633b46880d79439a377676b2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzana=20Lena=20Ansorgov=C3=A1?= Date: Tue, 9 Apr 2024 17:48:17 +0200 Subject: [PATCH 2/3] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aneta Šteflová Petrová Co-authored-by: Maximilian Kolb --- .../common/modules/proc_running-an-ansible-playbook.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guides/common/modules/proc_running-an-ansible-playbook.adoc b/guides/common/modules/proc_running-an-ansible-playbook.adoc index 5901b9a6195..87cf5b6b5d0 100644 --- a/guides/common/modules/proc_running-an-ansible-playbook.adoc +++ b/guides/common/modules/proc_running-an-ansible-playbook.adoc @@ -5,7 +5,8 @@ You can run an Ansible playbook on a host or host group by executing a remote jo .Prerequisites * Ansible plugin in {Project} is enabled. -* You have configured xref:Configuring_and_Setting_Up_Remote_Jobs_{context}[remote job execution]. +* Remote job execution is configured. +For more information, see xref:Configuring_and_Setting_Up_Remote_Jobs_{context}[]. * You have an Ansible playbook ready to use. .Procedure @@ -21,7 +22,7 @@ For more information, see xref:executing-a-remote-job_{context}[]. . Click *Run on selected hosts*. .Additional resources -* Alternatively, you can import Ansible playbooks from {SmartProxy}. -For more information, see: +* Alternatively, you can import Ansible playbooks from {SmartProxyServers}. +For more information, see the following resources: ** xref:importing-an-ansible-playbook-by-name_{context}[] ** xref:importing-all-available-ansible-playbooks_{context}[] \ No newline at end of file From 614c8779a9debc9b3eb07e2ba97baeb6ed4851ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzana=20Lena=20Ansorgov=C3=A1?= Date: Tue, 9 Apr 2024 18:24:29 +0200 Subject: [PATCH 3/3] Update proc_running-an-ansible-playbook.adoc --- guides/common/modules/proc_running-an-ansible-playbook.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/common/modules/proc_running-an-ansible-playbook.adoc b/guides/common/modules/proc_running-an-ansible-playbook.adoc index 87cf5b6b5d0..63d249f821d 100644 --- a/guides/common/modules/proc_running-an-ansible-playbook.adoc +++ b/guides/common/modules/proc_running-an-ansible-playbook.adoc @@ -17,12 +17,12 @@ For more information, see xref:Configuring_and_Setting_Up_Remote_Jobs_{context}[ . Click *Next*. . Select the hosts on which you want to run the playbook. . In the *playbook* field, paste the content of your Ansible playbook. -. Optional: Customize any advanced settings and schedule. +. Follow the wizzard to complete setting the remote job. For more information, see xref:executing-a-remote-job_{context}[]. -. Click *Run on selected hosts*. +. Click *Submit* to run the Ansible playbook on your hosts. .Additional resources * Alternatively, you can import Ansible playbooks from {SmartProxyServers}. For more information, see the following resources: ** xref:importing-an-ansible-playbook-by-name_{context}[] -** xref:importing-all-available-ansible-playbooks_{context}[] \ No newline at end of file +** xref:importing-all-available-ansible-playbooks_{context}[]