From 69a2f7aa3853e1c20ca40518bc75e803496af02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Thu, 31 Oct 2024 10:10:41 +0100 Subject: [PATCH 1/9] Add HTTP proxy policy setting for Template Sync --- guides/common/modules/ref_template-sync-settings.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/guides/common/modules/ref_template-sync-settings.adoc b/guides/common/modules/ref_template-sync-settings.adoc index 875a654e22..08036eab38 100644 --- a/guides/common/modules/ref_template-sync-settings.adoc +++ b/guides/common/modules/ref_template-sync-settings.adoc @@ -12,6 +12,7 @@ Case-insensitive. Snippets are not filtered. | *Force import* | No | If set to `Yes`, locked templates are overwritten during an import. +| *HTTP proxy policy* | Global default HTTP proxy | HTTP proxy policy for template sync. | *Lock templates* | Keep, do not lock new | How to handle lock for imported templates. | *Metadata export mode* | Refresh | Default metadata export mode. From 58f6cd97831b3d7cca8627fdccd52d2911c5b50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Tue, 5 Nov 2024 14:15:24 +0100 Subject: [PATCH 2/9] Add a more precise description of a web UI step --- ...oc_synchronizing-templates-with-an-existing-repository.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2107604e9c..42905817bb 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 @@ -45,7 +45,8 @@ Do not specify a passphrase. ---- # sudo --user foreman ssh _git.example.com_ ---- -. Configure the Template Sync plugin settings on a *Template Sync* tab. +. In the {ProjectWebUI}, navigate to *Administer > Settings*. +On the *Template Sync* tab, provide details for your Git repository. .. Change the *Branch* setting to match the target branch on a Git server. .. Change the *Repo* setting to match the Git repository. For example, for the repository located in `git@git.example.com/templates.git` set the setting into `git@git.example.com/templates.git`. From 84722a7fe26566c5e02432fa1f3b863c533e7506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Tue, 5 Nov 2024 14:12:35 +0100 Subject: [PATCH 3/9] Restructure template sync procedure for repositories --- ...templates-with-an-existing-repository.adoc | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 42905817bb..4ff544ab35 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 @@ -6,40 +6,43 @@ If you store templates in a repository under a version control system, you can s 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: -.. Create a new directory under the `/usr/share/foreman/` directory to store the Git configuration for the certificate: +. Configure connection to the repository: +.. To use an HTTP proxy to connect to the repository, ensure the proxy is configured on your {ProjectServer}. +In the {ProjectwebUI}, navigate to *Infrastructure > HTTP Proxies*. +.. To use HTTPS to connect to the repository if your Git server uses a self-signed certificate authority (CA): +... Create a new directory under the `/usr/share/foreman/` directory to store the Git configuration for the certificate: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # mkdir --parents /usr/share/foreman/.config/git ---- -.. Create a file named `config` in the new directory: +... Create a file named `config` in the new directory: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # touch /usr/share/foreman/.config/git/config ---- -.. Allow the `foreman` user access to the `.config` directory: +... Allow the `foreman` user access to the `.config` directory: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # chown --recursive foreman /usr/share/foreman/.config ---- -.. Update the Git global configuration for the `foreman` user with the path to your self-signed CA certificate: +... Update the Git global configuration for the `foreman` user with the path to your self-signed CA certificate: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # sudo --user foreman git config --global http.sslCAPath _Path_To_CA_Certificate_ ---- -. If you want to use SSH to connect to the repository: -.. Create an SSH key pair if you do not already have it. +.. To use SSH to connect to the repository: +... Create an SSH key pair if you do not already have it. Do not specify a passphrase. + ---- # sudo --user foreman ssh-keygen ---- -.. Configure your version control server with the public key from your {Project}, which resides in `/usr/share/foreman/.ssh/id_rsa.pub`. -.. Accept the Git SSH host key as the `foreman` user: +... Configure your version control server with the public key from your {Project}, which resides in `/usr/share/foreman/.ssh/id_rsa.pub`. +... Accept the Git SSH host key as the `foreman` user: + [subs="+quotes"] ---- From 2068da997f492736b3e0b33fa6e9b683f2952044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Wed, 6 Nov 2024 18:44:37 +0100 Subject: [PATCH 4/9] Apply feedback from tech review --- ...templates-with-an-existing-repository.adoc | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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 4ff544ab35..74cb2806d8 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 @@ -6,9 +6,8 @@ If you store templates in a repository under a version control system, you can s In this procedure, a Git repository is used for demonstration purposes. .Procedure -. Configure connection to the repository: -.. To use an HTTP proxy to connect to the repository, ensure the proxy is configured on your {ProjectServer}. -In the {ProjectwebUI}, navigate to *Infrastructure > HTTP Proxies*. +. Configure connection to the repository. +Skip this step if you want to use an HTTP proxy, an HTTPS proxy, or a regular HTTP connection to connect to the repository. .. To use HTTPS to connect to the repository if your Git server uses a self-signed certificate authority (CA): ... Create a new directory under the `/usr/share/foreman/` directory to store the Git configuration for the certificate: + @@ -48,8 +47,13 @@ Do not specify a passphrase. ---- # sudo --user foreman ssh _git.example.com_ ---- -. In the {ProjectWebUI}, navigate to *Administer > Settings*. -On the *Template Sync* tab, provide details for your Git repository. -.. Change the *Branch* setting to match the target branch on a Git server. -.. Change the *Repo* setting to match the Git repository. -For example, for the repository located in `git@git.example.com/templates.git` set the setting into `git@git.example.com/templates.git`. +. In the {ProjectWebUI}, provide details for your Git repository: +.. Navigate to *Administer > Settings*. +.. Click the *Template Sync* tab. +.. Change the *Branch* setting to match the target branch of the repository. +.. Change the *Repo* setting to match the repository URL. + +.Next steps + +* To import templates from your repository, continue with xref:Importing_Templates_{context}[]. +* To export templates from your repository, continue with xref:Exporting_Templates_{context}[]. From 6fb9e023410b35d5c9209cc5c6a61184a56ecdc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Wed, 6 Nov 2024 18:55:53 +0100 Subject: [PATCH 5/9] Review synchronizing templates, now with the new setting --- ...templates-with-an-existing-repository.adoc | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) 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 74cb2806d8..6aef14008d 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 @@ -6,42 +6,40 @@ If you store templates in a repository under a version control system, you can s In this procedure, a Git repository is used for demonstration purposes. .Procedure -. Configure connection to the repository. -Skip this step if you want to use an HTTP proxy, an HTTPS proxy, or a regular HTTP connection to connect to the repository. -.. To use HTTPS to connect to the repository if your Git server uses a self-signed certificate authority (CA): -... Create a new directory under the `/usr/share/foreman/` directory to store the Git configuration for the certificate: +. If you want to use HTTPS to connect to the repository and you use a self-signed certificate authority (CA) on your Git server: +.. Create a new directory under the `/usr/share/foreman/` directory to store the Git configuration for the certificate: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # mkdir --parents /usr/share/foreman/.config/git ---- -... Create a file named `config` in the new directory: +.. Create a file named `config` in the new directory: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # touch /usr/share/foreman/.config/git/config ---- -... Allow the `foreman` user access to the `.config` directory: +.. Allow the `foreman` user access to the `.config` directory: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # chown --recursive foreman /usr/share/foreman/.config ---- -... Update the Git global configuration for the `foreman` user with the path to your self-signed CA certificate: +.. Update the Git global configuration for the `foreman` user with the path to your self-signed CA certificate: + [options="nowrap" subs="+quotes,verbatim,attributes"] ---- # sudo --user foreman git config --global http.sslCAPath _Path_To_CA_Certificate_ ---- -.. To use SSH to connect to the repository: -... Create an SSH key pair if you do not already have it. +. If you want to use SSH to connect to the repository: +.. Create an SSH key pair if you do not already have it. Do not specify a passphrase. + ---- # sudo --user foreman ssh-keygen ---- -... Configure your version control server with the public key from your {Project}, which resides in `/usr/share/foreman/.ssh/id_rsa.pub`. -... Accept the Git SSH host key as the `foreman` user: +.. Configure your version control server with the public key from your {Project}, which resides in `/usr/share/foreman/.ssh/id_rsa.pub`. +.. Accept the Git SSH host key as the `foreman` user: + [subs="+quotes"] ---- @@ -50,8 +48,9 @@ Do not specify a passphrase. . In the {ProjectWebUI}, provide details for your Git repository: .. Navigate to *Administer > Settings*. .. Click the *Template Sync* tab. -.. Change the *Branch* setting to match the target branch of the repository. -.. Change the *Repo* setting to match the repository URL. +.. Change the *Branch* setting to define the target branch of the repository. +.. Change the *Repo* setting to define the repository URL. +.. If you want to use an HTTP proxy to connect to the repository, change the *HTTP proxy policy* setting to define your HTTP proxy policy. .Next steps From 68739dcc24e35ee624713cb6abdcacd7b2bea6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Fri, 15 Nov 2024 16:24:08 +0100 Subject: [PATCH 6/9] Apply feedback from SME review --- ...roc_synchronizing-templates-with-an-existing-repository.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6aef14008d..4861d1c754 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 @@ -50,7 +50,7 @@ Do not specify a passphrase. .. Click the *Template Sync* tab. .. Change the *Branch* setting to define the target branch of the repository. .. Change the *Repo* setting to define the repository URL. -.. If you want to use an HTTP proxy to connect to the repository, change the *HTTP proxy policy* setting to define your HTTP proxy policy. +.. If you want to use an HTTP proxy to connect to the repository, change the *HTTP proxy policy* setting to `Global default HTTP proxy` or `Custom HTTP proxy`. .Next steps From 1b2bc76dd9a2c0a9bb0be3a0a99efcb9fc555550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Fri, 15 Nov 2024 17:52:01 +0100 Subject: [PATCH 7/9] Apply suggestion from tech review Co-authored-by: Adam Lazik --- ...roc_synchronizing-templates-with-an-existing-repository.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4861d1c754..a2cc37c358 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 @@ -55,4 +55,4 @@ Do not specify a passphrase. .Next steps * To import templates from your repository, continue with xref:Importing_Templates_{context}[]. -* To export templates from your repository, continue with xref:Exporting_Templates_{context}[]. +* To export templates to your repository, continue with xref:Exporting_Templates_{context}[]. From f96548b9ddc481e7159d8c52263c4ef811836900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Fri, 29 Nov 2024 19:09:20 +0100 Subject: [PATCH 8/9] Address the latest set of changes in the code --- guides/common/modules/ref_template-sync-settings.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guides/common/modules/ref_template-sync-settings.adoc b/guides/common/modules/ref_template-sync-settings.adoc index 08036eab38..fce70449ef 100644 --- a/guides/common/modules/ref_template-sync-settings.adoc +++ b/guides/common/modules/ref_template-sync-settings.adoc @@ -12,7 +12,9 @@ Case-insensitive. Snippets are not filtered. | *Force import* | No | If set to `Yes`, locked templates are overwritten during an import. -| *HTTP proxy policy* | Global default HTTP proxy | HTTP proxy policy for template sync. +| *HTTP proxy policy* | Global default HTTP proxy | Whether to use an HTTP proxy to synchronize templates. + +The `Custom HTTP proxy` value is available only if an HTTP proxy is configured under the selected organization and location and if your account has the *view_http_proxies* role assigned. | *Lock templates* | Keep, do not lock new | How to handle lock for imported templates. | *Metadata export mode* | Refresh | Default metadata export mode. From b1dce9880957e3c73a4c52a95e1314c7cb1d5018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Fri, 29 Nov 2024 19:11:32 +0100 Subject: [PATCH 9/9] Apply suggestions from style review Co-authored-by: Maximilian Kolb --- ...oc_synchronizing-templates-with-an-existing-repository.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 a2cc37c358..41cb5e554b 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 @@ -46,13 +46,12 @@ Do not specify a passphrase. # sudo --user foreman ssh _git.example.com_ ---- . In the {ProjectWebUI}, provide details for your Git repository: -.. Navigate to *Administer > Settings*. +.. Navigate to *Administer* > *Settings*. .. Click the *Template Sync* tab. .. Change the *Branch* setting to define the target branch of the repository. .. Change the *Repo* setting to define the repository URL. .. If you want to use an HTTP proxy to connect to the repository, change the *HTTP proxy policy* setting to `Global default HTTP proxy` or `Custom HTTP proxy`. .Next steps - * To import templates from your repository, continue with xref:Importing_Templates_{context}[]. * To export templates to your repository, continue with xref:Exporting_Templates_{context}[].