Jerry Sun 0aa76b50b8 Enable certificate tasks for enrollment
This commit enables the certificate tasks for the enrollment playbook.
- rehome-subcloud/update-ca-cert
- common/update-sc-cert

We install the file admin-ep-cert.pem through ansible because cert-mon
is running in a "regular system" mode as opposed to DC mode at the
moment, and does not monitor the admin-ep-cert or install a new
copy.

Test Cases:

The test environment is a standard system controller with a single
node subcloud, installed with the existing factory install procedure.

PASS: get certificate on the subcloud, ensure sc-adminep-certificate
      is updated
PASS: ensure /etc/ssl/private/admin-ep-cert.pem contains the cert
      and key, like a regular DC deployment

Story: 2011100
Task: 50226

Change-Id: I12b5fb8a7b13fdcec6985a599347ff184e6287e0
Signed-off-by: Jerry Sun <jerry.sun@windriver.com>
2024-05-31 12:51:56 -04:00

43 lines
1.3 KiB
YAML

---
#
# Copyright (c) 2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# This playbook convert a factory installed system into a subcloud of a
# distributed cloud system.
#
# Example command:
# ansible-playbook /usr/share/ansible/stx-ansible/playbooks/enroll_subcloud.yml \
# -i <inventory-file> --limit <subcloudname> -e '@<subcloudname>.yml'
# -e 'override_files_dir=<overrides-files-dir>'
#
- hosts: all
gather_facts: no
vars_files:
- vars/common/main.yml
- host_vars/enroll-subcloud/default.yml
vars:
mode: "enroll"
distributed_cloud_role: "subcloud"
# TODO(yuxing) uncomment the roles below onces enabled the support of subcloud enrollment
roles:
- common/prepare-env
- common/validate-target
# - common/recover-subcloud-certificates
- rehome-enroll-common/prepare-env
- enroll-subcloud/validate-before-enroll
- rehome-subcloud/update-ca-cert
# - common/update-sc-admin-endpoints
- role: common/update-sc-cert
when: subcloud_dc_admin_ep_cert_chain_recovered is undefined
# - rehome-subcloud/update-network-config
# - role: rehome-subcloud/update-keystone-data
# become: yes
- rehome-enroll-common/persist-configuration
# - enroll-subcloud/complete-enrollment