From 3b7c7d9ff203447d486f81d4c1e4e3d7674b6365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Thu, 7 Nov 2024 08:12:36 +0100 Subject: [PATCH] Review introductions to template sync procedures (#3428) * Update intros to template sync procedures * Simplify template sync assembly structure * Add Ansible module reference for importing templates --------- Co-authored-by: Adam Lazik --- ...assembly_synchronizing-template-repositories.adoc | 12 ++++-------- .../con_importing-and-exporting-templates.adoc | 6 ------ .../con_synchronizing-template-repositories.adoc | 1 - .../common/modules/con_using-repository-sources.adoc | 4 ---- guides/common/modules/proc_exporting-templates.adoc | 2 +- guides/common/modules/proc_importing-templates.adoc | 7 +++++++ ...nchronizing-templates-with-a-local-directory.adoc | 6 ++---- ...nizing-templates-with-an-existing-repository.adoc | 4 +++- 8 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 guides/common/modules/con_importing-and-exporting-templates.adoc delete mode 100644 guides/common/modules/con_using-repository-sources.adoc diff --git a/guides/common/assembly_synchronizing-template-repositories.adoc b/guides/common/assembly_synchronizing-template-repositories.adoc index 6fd325977eb..b6107f6b885 100644 --- a/guides/common/assembly_synchronizing-template-repositories.adoc +++ b/guides/common/assembly_synchronizing-template-repositories.adoc @@ -4,17 +4,13 @@ ifndef::satellite[] include::modules/proc_enabling-the-template-sync-plugin.adoc[leveloffset=+1] endif::[] -include::modules/con_using-repository-sources.adoc[leveloffset=+1] +include::modules/proc_synchronizing-templates-with-an-existing-repository.adoc[leveloffset=+1] -include::modules/proc_synchronizing-templates-with-an-existing-repository.adoc[leveloffset=+2] +include::modules/proc_synchronizing-templates-with-a-local-directory.adoc[leveloffset=+1] -include::modules/proc_synchronizing-templates-with-a-local-directory.adoc[leveloffset=+2] +include::modules/proc_importing-templates.adoc[leveloffset=+1] -include::modules/con_importing-and-exporting-templates.adoc[leveloffset=+1] - -include::modules/proc_importing-templates.adoc[leveloffset=+2] - -include::modules/proc_exporting-templates.adoc[leveloffset=+2] +include::modules/proc_exporting-templates.adoc[leveloffset=+1] ifndef::satellite[] include::modules/proc_uninstalling-the-foreman-templates-plugin.adoc[leveloffset=+1] diff --git a/guides/common/modules/con_importing-and-exporting-templates.adoc b/guides/common/modules/con_importing-and-exporting-templates.adoc deleted file mode 100644 index 9da7166d34d..00000000000 --- a/guides/common/modules/con_importing-and-exporting-templates.adoc +++ /dev/null @@ -1,6 +0,0 @@ -[id="Importing_and_Exporting_Templates_{context}"] -= Importing and exporting templates - -You can import and export templates by using the {ProjectWebUI}, Hammer CLI, or {Project} API. -{Project} API calls use the role-based access control system, which enables the tasks to be executed as any user. -You can synchronize templates with a version control system, such as Git, or a local directory. diff --git a/guides/common/modules/con_synchronizing-template-repositories.adoc b/guides/common/modules/con_synchronizing-template-repositories.adoc index 0f9d7b104ea..6da591487fe 100644 --- a/guides/common/modules/con_synchronizing-template-repositories.adoc +++ b/guides/common/modules/con_synchronizing-template-repositories.adoc @@ -2,6 +2,5 @@ = Synchronizing template repositories In {Project}, you can synchronize repositories of job templates, provisioning templates, report templates, and partition table templates between {ProjectServer} and a version control system or local directory. -In this chapter, a Git repository is used for demonstration purposes. This section details the workflow for installing and configuring the Template Sync plugin and performing exporting and importing tasks. diff --git a/guides/common/modules/con_using-repository-sources.adoc b/guides/common/modules/con_using-repository-sources.adoc deleted file mode 100644 index 5218176e6ab..00000000000 --- a/guides/common/modules/con_using-repository-sources.adoc +++ /dev/null @@ -1,4 +0,0 @@ -[id="using-repository-sources_{context}"] -= Using repository sources - -You can use existing repositories or local directories to synchronize templates with your {ProjectServer}. diff --git a/guides/common/modules/proc_exporting-templates.adoc b/guides/common/modules/proc_exporting-templates.adoc index f5ab8af6bd3..eb600e3d668 100644 --- a/guides/common/modules/proc_exporting-templates.adoc +++ b/guides/common/modules/proc_exporting-templates.adoc @@ -1,7 +1,7 @@ [id="Exporting_Templates_{context}"] = Exporting templates -Use this procedure to export templates to a git repository. +You can export templates to an existing repository. To use the CLI instead of the {ProjectWebUI}, see the xref:cli_Exporting_Templates_{context}[]. To use the API, see the xref:api_Exporting_Templates_{context}[]. diff --git a/guides/common/modules/proc_importing-templates.adoc b/guides/common/modules/proc_importing-templates.adoc index f20904c835f..777a627c89d 100644 --- a/guides/common/modules/proc_importing-templates.adoc +++ b/guides/common/modules/proc_importing-templates.adoc @@ -34,6 +34,7 @@ organizations: To use the CLI instead of the {ProjectWebUI}, see the xref:cli_Importing_Templates_{context}[]. To use the API, see the xref:api_Importing_Templates_{context}[]. +To use Ansible, see the xref:ansible_Importing_Templates_{context}[]. .Procedure . In the {ProjectWebUI}, navigate to *Hosts* > *Templates* > *Sync Templates*. @@ -79,3 +80,9 @@ For example `--filter '.*Ansible Default$'` imports various Ansible Default temp ---- + If the import is successful, you receive `{"message":"Success"}`. + +[id="ansible_Importing_Templates_{context}"] +.Ansible procedure +* Use the `{ansible-namespace}.templates_import` module. + +For more information, see the Ansible module documentation with `ansible-doc {ansible-namespace}.templates_import`. diff --git a/guides/common/modules/proc_synchronizing-templates-with-a-local-directory.adoc b/guides/common/modules/proc_synchronizing-templates-with-a-local-directory.adoc index 0d77c5e04a3..1c873773edd 100644 --- a/guides/common/modules/proc_synchronizing-templates-with-a-local-directory.adoc +++ b/guides/common/modules/proc_synchronizing-templates-with-a-local-directory.adoc @@ -1,9 +1,7 @@ [id="Synchronizing_Templates_with_a_Local_Directory_{context}"] = Synchronizing templates with a local directory -Synchronizing templates with a local directory is useful if you have configured a version control repository in the local directory. -That way, you can edit templates and track the history of edits in the directory. -You can also synchronize changes to {ProjectServer} after editing the templates. +If you store templates in a local directory that is tracked under a version control system, you can synchronize the templates between your {ProjectServer} and the local directory. .Prerequisites * Each template must contain the location and organization that the template belongs to. @@ -28,7 +26,7 @@ organizations: ---- .Procedure -. In `/var/lib/foreman`, create a directory for storing templates: +. On your {ProjectServer}, in `/var/lib/foreman`, create a directory for storing templates: + [subs="+quotes"] ---- diff --git a/guides/common/modules/proc_synchronizing-templates-with-an-existing-repository.adoc b/guides/common/modules/proc_synchronizing-templates-with-an-existing-repository.adoc index f467a69a103..2107604e9c5 100644 --- a/guides/common/modules/proc_synchronizing-templates-with-an-existing-repository.adoc +++ b/guides/common/modules/proc_synchronizing-templates-with-an-existing-repository.adoc @@ -1,7 +1,9 @@ [id="synchronizing-templates-with-an-existing-repository_{context}"] = Synchronizing templates with an existing repository -Use this procedure to synchronize templates between your {ProjectServer} and an existing repository. +If you store templates in a repository under a version control system, you can synchronize the templates between your {ProjectServer} and the repository. + +In this procedure, a Git repository is used for demonstration purposes. .Procedure . If you want to use HTTPS to connect to the repository and you use a self-signed certificate authority (CA) on your Git server: