Skip to content

Commit f3b4fde

Browse files
committed
docs: update CI/CD documentation
1 parent 8197472 commit f3b4fde

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

doc/source/configuration/ci-cd.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ Runner Deployment
219219
4. Provide all the relevant Kayobe :code:`group_vars` for :code:`gitlab-runners` under :code:`${KAYOBE_CONFIG_PATH}/environments/${KAYOBE_ENVIRONMENT}/inventory/group_vars/gitlab-runners`
220220
* `infra-vms` ensuring all required `infra_vm_extra_network_interfaces` are defined
221221
* `network-interfaces`
222+
* `allocated IPs`
222223

223224
5. Edit the ``${KAYOBE_CONFIG_PATH}/inventory/group_vars/gitlab-runners/runners.yml`` file which will contain the variables required to deploy a series of runners.
224225
Below is an example of how GitLab runners can be configured for deployment.
@@ -271,7 +272,7 @@ Runner Deployment
271272
network_mode: host
272273
273274
6. Obtain a runner token for each runner that is required for deployment.
274-
This token can be obtained by visiting the GitLab project -> Settings -> CI/CD -> Runners -> New project runner -> Complete the form and copy the token.
275+
This token can be obtained by visiting the GitLab project -> Settings -> CI/CD -> Runners -> New project runner -> Complete the form including any tags used by the runners such as kayobe, openstack and environment_name.
275276
Once the token has been obtained, add it to :code:`secrets.yml` under :code:`secrets_gitlab_production_runner_token` and :code:`secrets_gitlab_staging_runner_token`
276277

277278
7. Deploy the infra-vm
@@ -290,7 +291,7 @@ Runner Deployment
290291

291292
10. Check runners have registered properly by visiting the repository's :code:`CI/CD` tab -> :code:`Runners`
292293

293-
11. The contents of :code:`/opt/.docker/config.json` on the runner should be added to GitLab CI/CD settings as a sercret variable.
294+
11. The contents of :code:`/opt/.docker/config.json` on the runner should be added to GitLab CI/CD settings as a sercret variable if GitLab version permits otherwise variable is fine.
294295
This is required to allow the runners to pull images from the registry.
295296
Visit the GitLab project -> Settings -> CI/CD -> Variables -> Add a new variable with the key :code:`DOCKER_AUTH_CONFIG` and the value of the contents of :code:`/opt/.docker/config.json`
296297

@@ -314,6 +315,10 @@ However, if you have a single host that is shared between environments then Open
314315
Once the above playbook has been applied you need to grab the root token from :code:`vault/kayobe-automation-keys.json` as you will need this to enable JWT support.
315316
This would also be an opportune time to encrypt the :code:`vault/kayobe-automation-keys.json` to protect the contents.
316317

318+
.. code-block:: bash
319+
320+
ansible-vault encrypt vault/kayobe-automation-keys.json --vault-password-file ~/.vault.password
321+
317322
In order to enable JWT support the following steps must be carried out within the openbao container on the runner host.
318323

319324
1. SSH into the runner host
@@ -362,6 +367,7 @@ GitLab Pipelines
362367
1. Edit :code:`${KAYOBE_CONFIG_PATH}/inventory/group_vars/gitlab-writer/writer.yml` in the base configuration making the appropriate changes to your deployments specific needs. See documentation for `stackhpc.kayobe_workflows.gitlab <https://github.com/stackhpc/ansible-collection-kayobe-workflows/tree/main/roles/gitlab>`__.
363368
Following the instructions in the documentation will allow you to customise the workflows to fit within your deployment.
364369
For example disabling jobs that might not be relevant such as physical network configuration or overcloud host provision in clouds where this is absent.
370+
If using multiple environments ensure that :code:`gitlab_kayobe_environments` is updated to reflect all environments present in the deployment.
365371
Also consider the impact runbooks might have as the runbooks are designed with a particular cloud in mind and may not be suitable for all deployments such as hyperconverged deployments with Ceph on hypervisors.
366372
367373
2. Run :code:`kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/write-gitlab-pipelines.yml`

etc/kayobe/ansible/deploy-openbao-kayobe-automation.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828

2929
- name: Ensure vault directory exists in environment
3030
ansible.builtin.file:
31-
path: {{ kayobe_env_config_path }}/vault
31+
path: "{{ kayobe_env_config_path }}/vault"
3232
state: directory
3333
become: true
34+
3435
- name: Import OpenBao role
3536
ansible.builtin.import_role:
3637
name: stackhpc.hashicorp.openbao
@@ -75,3 +76,4 @@
7576
kayobe_automation_ssh_private_key: "{{ lookup('ansible.builtin.file', '{{ ssh_private_key_path }}') }}"
7677
kayobe_public_openrc: "{{ lookup('ansible.builtin.file', '{{ kolla_config_path }}/public-openrc.sh') }}"
7778
tags: add_secrets
79+

etc/kayobe/inventory/group_vars/gitlab-writers/writer.yml renamed to etc/kayobe/inventory/group_vars/gitlab-writer/writer.yml

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# See documentation for more information
44
# https://github.com/stackhpc/ansible-collection-kayobe-workflows/blob/main/roles/gitlab/README.md
55

6+
gitlab_output_directory: $KAYOBE_CONFIG_PATH/../../.gitlab/
7+
8+
gitlab_registry: "{{ pulp_url | regex_replace('^https?://|^http?://', '') }}"
9+
10+
gitlab_openstack_release: "{{ openstack_release }}"
11+
612
###############################################################################
713
# Dummy variable to allow Ansible to accept this file.
814
workaround_ansible_issue_8743: yes

0 commit comments

Comments
 (0)