Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panos_admpwd output detection #433

Closed
tfwong36 opened this issue May 8, 2023 · 2 comments · Fixed by #457
Closed

panos_admpwd output detection #433

tfwong36 opened this issue May 8, 2023 · 2 comments · Fixed by #457
Labels
bug Something isn't working released

Comments

@tfwong36
Copy link

tfwong36 commented May 8, 2023

Describe the bug

panos_admpwd.py line 169-170 detects keyword 'success' to interpret if the commit is success, but 'success' also printed in failed cases. Therefore, the script interpret the state wrongly, the job is not actually completed.

For example, "Server error : Commit job was not queued since auto-commit not yet finished successfully. Please use "commit force" to schedule commit job\r\n[edit]"

Expected behavior

It is expected not to count the failed commit command as finished/changed state.

Current behavior

It counted a commit failed as finished/changed.

Possible solution

Change the expected keyword to a more specific keyword in panos_admpwd.py line 169, such as "committed successfully", etc.

Steps to reproduce

  1. request restart system in panos
  2. run the script with retries
  3. make sure the script/the-commit-command run before the system startup auto commit

Screenshots

image

Context

I am using terraform to trigger ansible to change the admin password in Alibaba Cloud, which do not have option to set admin password at boostrap. This bug makes my further terraform script cannot configure the panos. I am hoping the ansible can retry if it met other error with keyword 'success'

Your Environment

  • Collection: paloaltonetworks.panos
  • Python: Python 3.10.6
  • Ansible: ansible [core 2.14.5]
  • PAN-OS Python Library & version (e.g. pandevice 0.14.0, pan-os-python 1.0.2): paramiko 2.12.0
@tfwong36 tfwong36 added the bug Something isn't working label May 8, 2023
@welcome-to-palo-alto-networks
Copy link

🎉 Thanks for opening your first issue here! Welcome to the community!

@github-actions
Copy link

🎉 This issue has been resolved in version 2.17.3 🎉

The release is available on Ansible Galaxy and GitHub release

Posted by semantic-release bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant