Subcloud rehoming support for usm

The subcloud rehoming process was previously migrating the
patching user/password in the subcloud. Similarly, it is
required to migrate the usm user password and id and update
related services during subcloud rehoming.

Test Plan:
PASS: Perform rehoming on DC subcloud and ensure usm services
are running

Story: 2010676
Task: 50503

Change-Id: I2117e6ea794c405cccec90f5b5f78f728d39c9ce
Signed-off-by: sshathee <shunmugam.shatheesh@windriver.com>
This commit is contained in:
sshathee 2024-07-04 07:18:32 -04:00
parent e0f1de0cad
commit 1d023f087a
4 changed files with 17 additions and 1 deletions
playbookconfig/src/playbooks/roles/rehome-enroll-common/update-keystone-data/tasks

@ -25,6 +25,7 @@
- { username: 'fm', password: "{{ users['fm'] }}", service: 'fm-mgr' }
- { username: 'mtce', password: "{{ users['mtce'] }}", service: 'mtc-agent' }
- { username: 'patching', password: "{{ users['patching'] }}", service: 'sw-patch-controller-daemon' }
- { username: 'usm', password: "{{ users['usm'] }}", service: 'software-controller-daemon' }
- { username: 'vim', password: "{{ users['vim'] }}", service: 'vim' }
- name: Update keystone passwords in secure hieradata

@ -67,6 +67,7 @@
- "fm-api"
- "sm-api"
- "sw-patch-controller-daemon"
- "software-controller-daemon"
- name: Wait until services are restarted after changing keystone IDs
shell: sm-query service {{ item }} | grep -c enabled-active

@ -81,7 +81,7 @@
until: service_status.stdout == '1'
retries: 6
delay: 10
when: username != 'patching'
when: username != 'patching' and username != 'usm'
- name: Check sw-patch-controller-daemon service status
command: systemctl is-active sw-patch-controller-daemon
@ -91,6 +91,14 @@
delay: 10
when: username == 'patching'
- name: Check software-controller-daemon service status
command: systemctl is-active software-controller-daemon
register: usm_status
until: usm_status.rc == 0
retries: 6
delay: 10
when: username == 'usm'
when: service != 'dcmanager'
when: password_check_result.rc != 0

@ -55,6 +55,12 @@
To: "patching::keystone::auth::password: !!python/unicode '{{ users['patching'] }}'" }
- { From: "^patching::keystone::authtoken::password",
To: "patching::keystone::authtoken::password: !!python/unicode '{{ users['patching'] }}'" }
- { From: "^usm::api::keystone_password",
To: "usm::api::keystone_password: !!python/unicode '{{ users['usm'] }}'" }
- { From: "^usm::keystone::auth::password",
To: "usm::keystone::auth::password: !!python/unicode '{{ users['usm'] }}'" }
- { From: "^usm::keystone::authtoken::password",
To: "usm::keystone::authtoken::password: !!python/unicode '{{ users['usm'] }}'" }
- { From: "^platform::mtce::params::auth_pw",
To: "platform::mtce::params::auth_pw: !!python/unicode '{{ users['mtce'] }}'" }
- { From: "^sysinv::api::keystone_password",