StarlingX Ansible Playbooks
Go to file
Kyle MacLeod 311386a353 Prestaging support for --for-sw-deploy/--for-install
Add USM prestaging support. This commit introduces support for the
--for-sw-deploy and --for-install prestaging options. The --for-install
option is the default, and is the equivalent of the previous release
prestaging behaviour - the subcloud ostree repo is prestaged in the
platform-backup partition. The --for-sw-deploy option is the new
prestaging behaviour for USM major and minor releases. This commit
focuses on prestaging minor release updates.

The --for-sw-deploy option requires synchronization of ostree commits
and /opt/software/metadata contents from the system controller to the
subcloud.

See the header file of
playbookconfig/src/playbooks/roles/prestage/
    sync-software-metadata/tasks/main.yml
for a detailed overview of the algorithm to synchronize the ostree
commits and metadata from the system controller onto the subcloud.

Notes on --release YY.MM and --release YY.MM.nn handling:
- The --release value can either be a major release, in format YY.MM, or
  a specific minor release, in format YY.MM.nn.
- If format is YY.MM, the behaviour is to prestage ALL minor releases
  present on the system controller to the subcloud.
- If format is YY.MM.nn, the behaviour is to prestage ONLY the given
  minor release
    - Note: there is no sanity checking for dependent minor updates.
      If update YY.MM.nn is given but YY.MM.nn-1 is not present, the
      operation is currently allowed. This will be addressed in a future
      commit (see TODO below)
- TODO: Future commit will expand on this behaviour for YY.MM.nn to
  prestage all missing commits up to and including the YY.MM.nn commit

Unit tests for ostree-metadata-sync.sh:
A local BATS unit test script is added to unit test the
ostree-metadata-sync.sh script. The unit tests must be run manually -
there is no zuul support for BATS testing. See the README.md file in the
test directory for information on running the tests for this file.

This commit also handles the metadata synchronization when a subcloud is
installed. In this case, the /opt/software/metadata is synchronized
during the subcloud install, so that when the subcloud pulls from the
system controller feed ostree repo, the subcloud is bootstrapped with
the correct /opt/software/metadata hierarchy.

NOTE: this commit also turns off line-length checking for bashate. We do
not enforce line-length for bash scripts in metal, since it arguably
makes it more difficult to write bash scripts (due to challenges with
quoting, etc.)

Test Cases
PASS
- Verify when --release YY.MM is given, all minor releases are included
  for synchronizaton to the subcloud
- Verify when there is only one release on system controller, the
  synchronization is skipped (there are no updates to synchronize)
- For prestaging a minor release, verify the minor release appears in
  the correct location/state onthe subcloud:

  | System Controller state | Subcloud state | Subcloud result |
  | ----------------------- | -------------- | --------------- |
  | available               | -              | available       |
  | deploying               | -              | available       |
  | deployed                | -              | available       |
  | deployed                | deployed       | deployed        |
  |                         |                |                 |

- Verify prestaging --for-install
    - verify that prestaging works as in previous release:
        - ostree_repo staged in /opt/platform-backup

Story: 2010676
Task: 50325

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I4c67f03d0cfcf60e1bf78fc4c80ec18271fc49c1
2024-06-19 00:38:00 +00:00
examples Update default password 2024-05-09 14:28:18 -03:00
playbookconfig Prestaging support for --for-sw-deploy/--for-install 2024-06-19 00:38:00 +00:00
.ansible-lint Fix zuul failures from new release of ansible-lint 2020-08-18 10:49:30 -05:00
.gitignore Fixing up tox -e cover for stx-config 2018-12-20 08:53:15 -06:00
.gitreview Added .gitreview 2019-06-15 14:03:07 -05:00
.yamllint Enable yamllint for ansible playbook .yml files 2019-06-24 13:27:26 -05:00
.zuul.yaml Fix github mirroring for this repo 2023-04-28 12:38:49 -04:00
centos_build_layer.cfg Build layering, add layer build config file 2019-10-15 19:47:15 +08:00
centos_iso_image.inc Fix remote bootstrap from Windows control host 2019-07-09 17:28:06 -04:00
centos_pkg_dirs Clean up repo import 2019-06-15 14:21:19 -05:00
CONTRIBUTORS.wrs Clean up repo import 2019-06-15 14:21:19 -05:00
debian_build_layer.cfg Add debian_build_layer.cfg file 2021-10-05 14:04:06 -04:00
debian_iso_image.inc Add debian_iso_image.inc file 2021-10-27 01:56:02 -04:00
debian_pkg_dirs Add debian package for playbookconfig 2021-09-29 18:32:15 +03:00
LICENSE Clean up repo import 2019-06-15 14:21:19 -05:00
README.rst starlingx/ansible-playbooks README improvement 2023-07-19 12:13:55 -03:00
requirements.txt Fix remote play for backup and restore 2022-08-17 14:51:35 -03:00
test-requirements.txt Fix tox ansible lint failure due to a new module 2022-01-10 11:04:20 -06:00
tox.ini Prestaging support for --for-sw-deploy/--for-install 2024-06-19 00:38:00 +00:00

stx-ansible-playbooks

StarlingX Bootstrap and Deployment Ansible1 Playbooks

Execution environment

  • Unix like OS (recent Linux based distributions, MacOS, Cygwin)
  • Python 3.8 and later

Additional Required Packages

In addition to the pakages listed in requirements.txt and test-requirements.txt, the following packages are required to run the playbooks remotely:

  • python3-pexpect
  • python3-ptyprocess
  • sshpass

Supported StarlingX Releases

The playbooks are compatible with StarlingX R8.0 and later.

Executing StarlingX Playbooks

Bootstrap Playbook

For instructions on how to set up and execute the bootstrap playbook from another host, please refer to the StarlingX Documentation2, at Installation Guides, section Configure controller-0 of the respective system deployment type.

Developer Notes

This repository is not intended to be developed standalone, but rather as part of the StarlingX Source System, which is defined by the StarlingX manifest3.

References


  1. https://docs.ansible.com/ansible/latest/installation_guide↩︎

  2. https://docs.starlingx.io↩︎

  3. https://opendev.org/starlingx/manifest.git↩︎