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

Documentation update for create multiple #62

Open
lavermil opened this issue Feb 8, 2024 · 0 comments
Open

Documentation update for create multiple #62

lavermil opened this issue Feb 8, 2024 · 0 comments

Comments

@lavermil
Copy link

lavermil commented Feb 8, 2024

Hello,

When trying the example in the link below I end up with an error saying duplicate dict key.

[WARNING]: While constructing a mapping from /home/testuser/ansible/createnetobjects.yml, line 15, column 11, found a duplicate dict key (name). Using last defined value only.
[WARNING]: While constructing a mapping from /home/testuser/ansible/createnetobjects.yml, line 15, column 11, found a duplicate dict key (value). Using last defined value only.
[WARNING]: While constructing a mapping from /home/testuser/ansible/createnetobjects.yml, line 15, column 11, found a duplicate dict key (description). Using last defined value only.
[WARNING]: While constructing a mapping from /home/testuser/ansible/createnetobjects.yml, line 15, column 11, found a duplicate dict key (type). Using last defined value only.
- name: Execute 'createMultipleNetworkObject' operation
  cisco.fmcansible.fmc_configuration:
    operation: "createMultipleNetworkObject"
    data:
        name: "net1"
        value: "1.0.0.0/24"
        overridable: False
        description: "Network obj 1"
        type: "NetworkObject"
        name: "net2"
        value: "1.1.0.0/24"
        overridable: False
        description: "Network obj 2"
        type: "NetworkObject"
    path_params:
        domainUUID: "{{ domain_uuid }}"
    query_params:
        bulk: "{{ bulk }}"

https://github.com/CiscoDevNet/FMCAnsible/blob/main/samples/docs/operations/create_multiple_network_object.md

After some testing the problem is in fact the format for which the example shows does have duplicate keys. If you modify the the example as below everything works correctly.

A corrected version of the example

- name: Execute 'createMultipleNetworkObject' operation
  cisco.fmcansible.fmc_configuration:
    operation: "createMultipleNetworkObject"
    data:
        - name: "net1"
          value: "1.0.0.0/24"
          overridable: False
          description: "Network obj 1"
          type: "NetworkObject"
        - name: "net2"
          value: "1.1.0.0/24"
          overridable: False
          description: "Network obj 2"
          type: "NetworkObject"
    path_params:
        domainUUID: "{{ domain_uuid }}"
    query_params:
        bulk: "{{ bulk }}"
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