|
4 | 4 | Use this procedure to synchronize templates between your {ProjectServer} and an existing repository. |
5 | 5 |
|
6 | 6 | .Procedure |
7 | | -. If you want to use HTTPS to connect to the repository and you use a self-signed certificate authentication on your Git server, validate the certificate: |
| 7 | +. If you want to use HTTPS to connect to the repository and you use a self-signed certificate authority (CA) on your Git server: |
| 8 | +.. Create a new directory under the `/usr/share/foreman/` directory to store the Git configuration for the certificate: |
8 | 9 | + |
9 | 10 | [options="nowrap" subs="+quotes,verbatim,attributes"] |
10 | 11 | ---- |
11 | | -# sudo -u foreman git config --global http.sslCAPath _Path_To_My_Certificate_ |
| 12 | +# mkdir --parents /usr/share/foreman/.config/git |
12 | 13 | ---- |
13 | | -. If you want to use SSH to connect to the repository, perform the following steps: |
| 14 | +.. Create a file named `config` in the new directory: |
| 15 | ++ |
| 16 | +[options="nowrap" subs="+quotes,verbatim,attributes"] |
| 17 | +---- |
| 18 | +# touch /usr/share/foreman/.config/git/config |
| 19 | +---- |
| 20 | +.. Allow the `foreman` user access to the `.config` directory: |
| 21 | ++ |
| 22 | +[options="nowrap" subs="+quotes,verbatim,attributes"] |
| 23 | +---- |
| 24 | +# chown --recursive foreman /usr/share/foreman/.config |
| 25 | +---- |
| 26 | +.. Update the Git global configuration for the `foreman` user with the path to your self-signed CA certificate: |
| 27 | ++ |
| 28 | +[options="nowrap" subs="+quotes,verbatim,attributes"] |
| 29 | +---- |
| 30 | +# sudo --user foreman git config --global http.sslCAPath _Path_To_CA_Certificate_ |
| 31 | +---- |
| 32 | +. If you want to use SSH to connect to the repository: |
14 | 33 | .. Create an SSH key pair if you do not already have it. |
15 | 34 | Do not specify a passphrase. |
16 | 35 | + |
17 | 36 | ---- |
18 | | -# sudo -u foreman ssh-keygen |
| 37 | +# sudo --user foreman ssh-keygen |
19 | 38 | ---- |
20 | 39 | .. Configure your version control server with the public key from your {Project}, which resides in `/usr/share/foreman/.ssh/id_rsa.pub`. |
21 | 40 | .. Accept the Git SSH host key as the `foreman` user: |
22 | 41 | + |
23 | 42 | [subs="+quotes"] |
24 | 43 | ---- |
25 | | -# sudo -u foreman ssh _git.example.com_ |
| 44 | +# sudo --user foreman ssh _git.example.com_ |
26 | 45 | ---- |
27 | 46 | . Configure the TemplateSync plugin settings on a *TemplateSync* tab. |
28 | 47 | .. Change the *Branch* setting to match the target branch on a Git server. |
|
0 commit comments