Repository navigation
Skip a vault-encrypted secure.yml in the CLI - #2963
Merged
Merged
Conversation
The osism CLI reads the OpenStack admin password from os_password_<cloud> in environments/openstack/secrets.yml. If that secret is missing, it falls back to a legacy /etc/openstack/secure.yml (or secure.yaml) and copies it to /tmp for openstacksdk. That fallback did not check the file's format. A secure.yml committed vault-encrypted, like every other secret in the configuration repository, was handed to openstacksdk, which cannot read Ansible Vault. The command then failed with "Configuration file ... is empty or not a valid mapping", which points neither at the encryption nor at os_password_<cloud>. A new helper, find_secure_file(), returns the first secure file that is not vault-encrypted, detected by the $ANSIBLE_VAULT header, and logs a warning for each encrypted one it skips. Both places that consulted the fallback use it: - setup_cloud_environment() treats an encrypted file as absent. Without os_password_<cloud>, the command now ends with the existing "No credentials found for cloud ... Set 'os_password_<cloud>' in .../secrets.yml" error. - get_openstack_connection() no longer retries without the password override after Unauthorized when the only secure file is encrypted. It reports "Authentication failed ... Check 'os_password_<cloud>'" instead. A plain-text secure.yml keeps working as a fallback, as before. The osism-ansible run scripts treat an encrypted secure.yml the same way for plays in the openstack environment. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Roger Luethi <luethi@osism.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The osism CLI reads the OpenStack admin password from
os_password_<cloud>inenvironments/openstack/secrets.yml. Without that secret it falls back to a legacysecure.yml, and it handed a vault-encrypted one to openstacksdk, which cannot read Ansible Vault. The command then failed withConfiguration file … is empty or not a valid mapping, which mentions neither the encryption noros_password_<cloud>.The fallback now skips a vault-encrypted
secure.yml/secure.yamlwith a warning that points atos_password_<cloud>:os_password_<cloud>, the command ends with the existing "No credentials found … Set 'os_password_'" error.get_openstack_connectionno longer retries against an encrypted file; it reports "Check 'os_password_'".secure.ymlkeeps working as before.This matches how plays in the openstack environment treat an encrypted
secure.ymlsince osism/container-image-osism-ansible#794.Known gap, not addressed here: openstacksdk fixes its secure-file search path at import time.
osism manage compute …imports it before the CLI switches to/tmp, so for those commands an encrypted/etc/openstack/secure.ymlcan still be read even whenos_password_<cloud>is set. Fixing that means exportingOS_CLIENT_SECURE_FILE, as osism/container-image-osism-ansible#794 does, and it changes the retry fallback, so it is left for a separate change.Related:
osism openstackand the requirements to use it are missing from the documentation issues#1438🤖 Generated with Claude Code