-
Notifications
You must be signed in to change notification settings - Fork 46
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
[cisco.asa.asa_ogs] Sorting objects groups lead to problems #176
Comments
@kaiseranton Thanks for raising the issue, but I am unable to reproduce the mentioned bug scenario with the following ASA config and Ansible play. OG config:
Ansible play:
Ansible ply run output:
Above, is the expected output for the respective scenario. Let me know if you still have the issue with all of the required details. |
Hello @justjais Your case only works because you try this on a ASA where BGroup already exists. Try: ASA 2: |
Another way to Test it without 2 ASAs is:
|
@kaiseranton Thanks for sharing the steps to reproduce. I've used the steps to reproduce with 1 ASA, and below is the observation I've made.
Gather Play run:
Play run:
This is the expected output but it doesn’t error out/cause the failure of the play run, which imitates Cisco ASA where it throws a warning that If I run the play again with a similar replace play ideally, the play should be idempotent and show no change but as the ref play run:
Now, if I run the play again, the play run will be idempotent and with no change, ref play run:
Can you plz share the play run error that you've mentioned in the issue. |
Hi @justjais, |
@kaiseranton sure, let me check with the team and I'll update the thread ASAP. That said I wanted to check if there's any particular issue that you cannot run the same play again twice, as running the play twice would configure the box as expected in this scenario. |
Thank you! |
Hello, do you have any News? |
I just created a pull request to add a toggle switch. That would be a great solution for me :) #189 |
SUMMARY
When the objcet_groups are getting sorted while parsing the running configuration into a json, then it will lead to problems.
While trying to use the parsed json to configure a device then it will lead to a problem, that subgroups might be needed but will be configured later because of the sorted names.
Example:
on ASA:
object-group network BGroup
network-object host 192.168.1.1
object-group network AGroup
group-object BGroup
in parsed JSON:
object-group network AGroup
group-object BGroup
object-group network BGroup
network-object host 192.168.1.1
The Module will crash because he is trying to configure something not existing. A simple fix would be, to remove the sort function or make the sort function a boolean to toggle off.
ISSUE TYPE
COMPONENT NAME
cisco.asa.asa_ogs
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Redhat Linux
STEPS TO REPRODUCE
Configure a Cisco ASA with:
object-group network BGroup
network-object host 192.168.1.1
object-group network AGroup
group-object BGroup
Afterwards run a play:
cisco.asa.asa_ogs:
config:
state: gathered
Take the output JSON and put it into the same Module with the state "replaced", then it will crash because of the sorted groups.
EXPECTED RESULTS
to configure
object-group network BGroup
network-object host 192.168.1.1
object-group network AGroup
group-object BGroup
ACTUAL RESULTS
it will try to configure
object-group network AGroup
group-object BGroup
object-group network BGroup
network-object host 192.168.1.1
The text was updated successfully, but these errors were encountered: