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

ucs_server_maintenance doesn't properly handle empty trigger_config attribute #21

Open
gve-vse-tim opened this issue Jan 19, 2021 · 0 comments

Comments

@gve-vse-tim
Copy link

When trigger_config is not specified in the task, Ansible 2.10 complains about a value not matching the valid choices of "on-next-boot":

failed: [ci-ucs] (item={'name': 'CI-Immediate', 'uptime_disr': 'immediate', 'state': 'present'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "CI-Immediate", "state": "present", "uptime_disr": "immediate"}, "msg": "value of trigger_config must be one of: on-next-boot, got: "}

When I do specify the trigger_config for uptime_disr with value 'immediate', I get the proper error from UCS that the combination is not possible:

failed: [ci-ucs] (item={'name': 'CI-Immediate', 'uptime_disr': 'immediate', 'trigger_config': 'on-next-boot', 'state': 'present'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "CI-Immediate", "state": "present", "trigger_config": "on-next-boot", "uptime_disr": "immediate"}, "msg": "setup error: [ErrorCode]: 1[ErrorDescription]: On next boot can only be set along with User Ack/Timer Automatic "}

So, in the current state, you can't create any Server Maintenance policies of type "immediate". And, for all other types, you are forced to accept "on-next-boot" because otherwise you get an error when Ansible sees the missing attribute as an empty value, which is not in the permitted range of valid choices.

I'm using Python 3.7.9 for this particular example, Ansible 2.10, and UCSM SDK 0.9.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant