Skip to content

Commit fc0aa2c

Browse files
vakwetuclaude
authored andcommitted
[multiple] Handle already-unlocked state in usroverlay task
rpm-ostree usroverlay returns exit code 1 with the message "Deployment is already in unlocked state: development" when the CoreOS node is already in the unlocked overlay state from a previous run. This caused the pcp_metrics hook to abort the entire deployment on re-runs without a full node reboot. Register the result and only treat non-zero exit codes as failures when the stderr does not contain the "already in unlocked state" message, making the task idempotent across multiple deploy attempts. Signed-off-by: Ade Lee <alee@redhat.com> Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 079d44c commit fc0aa2c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

roles/pcp_metrics/tasks/coreos.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
become: true
1616
ansible.builtin.command:
1717
cmd: rpm-ostree usroverlay
18+
register: _pcp_usroverlay
19+
changed_when: _pcp_usroverlay.rc == 0
20+
failed_when:
21+
- _pcp_usroverlay.rc != 0
22+
- >-
23+
"already in unlocked state" not in _pcp_usroverlay.stderr
1824
1925
- name: Create required directory
2026
become: true

0 commit comments

Comments
 (0)