Browse Source

[UG][IaC] Added sections about Git repo

Added sections about the Git repo structure for IaC LCM and
instructions on how to configure a Git repository.

Change-Id: I9cd169a6b563ef860b0d7841c4dbfd0193b5e565
Svetlana Karslioglu 2 years ago
parent
commit
dce6597f39

+ 97
- 1
userdocs/fuel-user-guide/post-deployment-conf/lcm-git-repo/repo-structure.rst View File

@@ -3,4 +3,100 @@
3 3
 Git repository structure
4 4
 ------------------------
5 5
 
6
-TBA
6
+You can have the following configuration priorities in the Git repository:
7
+
8
+* **Cluster** - configuration is applied to all nodes. All cluster level
9
+  configuration  files must be placed in the root directory in the Git
10
+  repository.
11
+* **Role** - configuration is applied to all nodes with the selected role.
12
+  Parameters with the Role level override parameters with the Cluster level.
13
+* **Node** - configuration is applied to the selected node ID. Parameters
14
+  with the Node level override the parameters with Global and Role levels.
15
+
16
+The following text is an example of a Git repository that you can create:
17
+
18
+::
19
+
20
+  .
21
+  |-- cluster.yaml
22
+      |`-- glance-api.conf
23
+  |-- nodes
24
+      |`-- node_1.domain.local.yaml
25
+  |-- roles
26
+      |`-- compute.yaml
27
+      |`-- controller.yaml
28
+      |`-- primaray-controller.yaml
29
+
30
+The example above illustrates what types of files can be
31
+stored in the repository. However, you can modify this structure as needed.
32
+
33
+The configuration files you create must use Puppet's resource types
34
+to describe the required configuration. For more information about the
35
+parameters and attributes that you can specify in the configuration files, see
36
+*Puppet Resource Type Reference*.
37
+
38
+The following table describes the Git repository structure.
39
+
40
+.. list-table:: **Git repository structure**
41
+   :widths: 20 10 15
42
+   :header-rows: 1
43
+
44
+   * - File
45
+     - Description
46
+     - Example
47
+   * - ``cluster.yaml``
48
+     - Describes cluster-level configurations in a form of a dictionary.
49
+     -
50
+       ::
51
+
52
+         configuration:
53
+             nova_config:
54
+                 'DEFAULT/nova_test':
55
+                     value: cluster_param
56
+                 'DEFAULT/another_param':
57
+                     value: another_param_value
58
+
59
+   * - ``nodes/<node-name>.yaml``
60
+
61
+       **Example:** ``node_1.domain.local.yaml``
62
+     - Describes node priority configurations.
63
+     -
64
+       ::
65
+
66
+         configuration:
67
+             nova_config:
68
+                 'DEFAULT/debug':
69
+                     value: True
70
+                 'DEFAULT/nova_cluster_override':
71
+                     value: node_param
72
+         
73
+             package:
74
+                 'mc':
75
+                     ensure: absent
76
+             exec:
77
+                 'some_test':
78
+                     command: '/bin/touch /tmp/test'
79
+                     unless: '/bin/test -f /tmp/test'
80
+                     path: '/bin:/sbin'
81
+
82
+   * - ``roles/<node-role>.yaml``
83
+
84
+       **Example:** ``roles/primary-controller``
85
+     - Describes configuration for all related node roles.
86
+
87
+       To view the list of node roles in this environment, run the
88
+       :command:`fuel node` command.
89
+     -
90
+       ::
91
+
92
+         configuration:
93
+             nova_config:
94
+                 'DEFAULT/nova_test':
95
+                     value: controller_param
96
+
97
+.. seealso::
98
+
99
+   - `Puppet Resource Type Reference
100
+     <https://docs.puppet.com/puppet/latest/reference/type.html>`_
101
+   - `Fuel CLI Reference
102
+     <http://docs.openstack.org/developer/fuel-docs/userdocs/fuel-user-guide/cli/cli_config_openstack.html>`_

+ 46
- 1
userdocs/fuel-user-guide/post-deployment-conf/lcm-git-repo/set-up-git-repo.rst View File

@@ -3,4 +3,49 @@
3 3
 Set up a Git repository
4 4
 =======================
5 5
 
6
-TBA
6
+You need to create a Git repository to store and modify the required
7
+configuration files, as well as configure the repository to work with
8
+the Fuel Nailgun configuration service.
9
+
10
+.. note::
11
+
12
+   Fuel can work with multiple Git repositories.
13
+   However, limit one repository and one branch per an OpenStack environment.
14
+
15
+**To set up a Git repository:**
16
+
17
+#. Create a Git repository in any Git repository management system
18
+   or web-based service, such as GitHub.
19
+
20
+#. Add the public SSH key located in ``.ssh/id_rsa.pub`` to your
21
+   Git repository.
22
+
23
+#. Create a repository object within Nailgun and register the
24
+   repository with Nailgun:
25
+
26
+   :: 
27
+
28
+     fuel2 gitrepo create <ENV_ID> --name <NAME_OF_NAILGUN_OBJECT> \
29
+     --url <URL_TO_REPO> --ref <BRANCH_TO_GRAB_CONFIG_FROM> --key \
30
+     <PATH_TO_SSH_KEY>
31
+
32
+   **Example:**
33
+
34
+   ::
35
+
36
+     fuel2 gitrepo create --env 1 --name oscnf1 --url \
37
+     git@github.com:dukov/oscnf.git --ref master --key .ssh/id_rsa
38
+
39
+#. Create a repository structure similar to the one described in
40
+   :ref:`repo-structure` by adding the required
41
+   files in the repository and committing the changes.
42
+
43
+#. Optionally, configure the Git repository to track changes in your
44
+   OpenStack environment in a separate branch:
45
+
46
+   ::
47
+
48
+     fuel2 gitrepo get configs --env <ENV_ID>
49
+
50
+   You must have write permissions to the Git repository.
51
+

Loading…
Cancel
Save