You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[#696](https://github.com/nautobot/nautobot-ansible/issues/696) - Added meta/execution-environment.yml for Ansible Builder support.
12
+
-[#705](https://github.com/nautobot/nautobot-ansible/issues/705) - Added graphql_info and graphql_facts modules to replace query_graphql, following Ansible naming conventions for info and facts modules.
13
+
-[#711](https://github.com/nautobot/nautobot-ansible/issues/711) - Added provider_network module for managing provider networks within Nautobot.
14
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign secrets to a secrets group when using the `secrets_group` module.
15
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign static group associations when using the `dynamic_group` module.
16
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign prefixes to a cloud network when using the `cloud_network` module.
17
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign cloud networks to a cloud service when using the `cloud_service` module.
18
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign vrfs to a device, virtual machine, or virtual device context when using the respective module.
19
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign clusters to a device when using the `device` module.
20
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign ip addresses to a device interface or vm interface when using the respective module.
21
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign prefixes or vlans to a location when using the `location` module.
22
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to assign provider networks to a provider when using the `provider` module.
23
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to manage custom field choices to a custom field when using the `custom_field` module.
24
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Added the ability to manage metadata choices to a metadata type when using the `metadata_type` module.
25
+
26
+
### Deprecated
27
+
28
+
-[#705](https://github.com/nautobot/nautobot-ansible/issues/705) - Deprecated query_graphql module. Use graphql_info (returns data only) or graphql_facts (sets ansible_facts) instead.
29
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `secrets_groups_association` module. Use the `secrets` option of the `secrets_group` module instead.
30
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `static_group_association` module. Use the `static_group_associations` option of the `dynamic_group` module instead.
31
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `cloud_network_prefix_assignment` module. Use the `prefixes` option of the `cloud_network` module instead.
32
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `cloud_service_network_assignment` module. Use the `cloud_networks` option of the `cloud_service` module instead.
33
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `vrf_device_assignment` module. Use the `vrfs` option of the `device`, `virtual_machine`, or `virtual_device_context` module instead.
34
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `device_cluster_assignment` module. Use the `clusters` option of the `device` module instead.
35
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `ip_address_to_interface` module. Use the `ip_addresses` option of the `device_interface` or `vm_interface` module instead.
36
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `prefix_location` module. Use the `prefixes` option of the `location` module instead.
37
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `vlan_location` module. Use the `vlans` option of the `location` module instead.
38
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `custom_field_choice` module. Use the `custom_field_choices` option of the `custom_field` module instead.
39
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `metadata_choice` module. Use the `metadata_choices` option of the `metadata_type` module instead.
40
+
-[#728](https://github.com/nautobot/nautobot-ansible/issues/728) - Deprecated the `provider_network` module. Use the `provider_networks` option of the `provider` module instead.
41
+
42
+
### Documentation
43
+
44
+
-[#694](https://github.com/nautobot/nautobot-ansible/issues/694) - Added Code of Conduct link to README for Ansible inclusion compliance.
45
+
-[#695](https://github.com/nautobot/nautobot-ansible/issues/695) - Add CONTRIBUTING.md that links to the official documentation.
46
+
-[#697](https://github.com/nautobot/nautobot-ansible/issues/697) - Updated Python and Ansible version requirements in README to reflect actual supported versions.
47
+
-[#703](https://github.com/nautobot/nautobot-ansible/issues/703) - Added Communication section to README with Ansible Forum links per Ansible inclusion requirements.
48
+
-[#709](https://github.com/nautobot/nautobot-ansible/issues/709) - Added missing RETURN block to the service module.
49
+
50
+
### Housekeeping
51
+
52
+
-[#709](https://github.com/nautobot/nautobot-ansible/issues/709) - Added unit tests to validate all modules have required Ansible documentation blocks (DOCUMENTATION, EXAMPLES, RETURN, version_added).
53
+
-[#718](https://github.com/nautobot/nautobot-ansible/issues/718) - Added CI testing against ansible-core devel branch and `--ansible-core-branch` flag on `invoke unit` for local testing.
That guide covers contributing guidelines, MkDocs documentation workflow, changelog fragments, and the release process. This file is intentionally brief and simply redirects to the authoritative docs.
Copy file name to clipboardExpand all lines: README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,13 +69,28 @@ This collection provides Ansible plugins (modules, inventory, lookup/filters) to
69
69
70
70
Testing is completed via the GitHub actions located in the `.github/workflows` directory.
71
71
72
-
## Contributing
72
+
## Communication
73
73
74
-
Check out the docs at https://docs.nautobot.com/projects/ansible/en/stable/getting_started/
74
+
* Join the Ansible forum:
75
+
*[Get Help](https://forum.ansible.com/c/help/6): get help or help others. Please add the [`nautobot`](https://forum.ansible.com/tag/nautobot) tag if you start new discussions.
76
+
*[Posts tagged with 'nautobot'](https://forum.ansible.com/tag/nautobot): subscribe to participate in collection-related conversations.
77
+
*[Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
78
+
*[News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
79
+
80
+
* Additional community resources:
81
+
*[Network to Code Slack](https://networktocode.slack.com) ([sign up](https://slack.networktocode.com))
82
+
*[GitHub Issues](https://github.com/nautobot/nautobot-ansible/issues): report bugs or request features
83
+
84
+
## Code of Conduct
85
+
86
+
This project adheres to the [Network to Code Code of Conduct](CODE_OF_CONDUCT). By participating, you are expected to uphold this code.
75
87
76
88
## Support
89
+
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
90
+
91
+
## Contributing
77
92
78
-
For issues please use [GitHub Issues](https://github.com/nautobot/nautobot-ansible) to open any issue that you may have. Additional community is available at the [Network to Code Slack](https://networktocode.slack.com) and [sign up](https://slack.networktocode.com).
93
+
Check out the docs at https://docs.nautobot.com/projects/ansible/en/stable/getting_started/
Copy file name to clipboardExpand all lines: docs/getting_started/contributing/modules/architecture.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,3 +291,49 @@ The next few lines manipulate the data and prepare it for sending to Nautobot.
291
291
- Converts any fields that are namespaced to prevent conflicts when searching for them (e.g. device_role, ipam_role, rack_group, etc.)
292
292
293
293
If all those pass, it sets the manipulated data to `self.data` that is used in the module util apps.
294
+
295
+
## Inline M2M Fields
296
+
297
+
+++ 6.2.0
298
+
299
+
Some parent modules support inline many-to-many (M2M) association fields. These are declared in the `M2M_FIELDS` global dict in `utils.py`, which maps each endpoint to its supported M2M fields and their association API endpoints:
300
+
301
+
```python
302
+
M2M_FIELDS= {
303
+
"devices": {
304
+
"vrfs": "vrf_device_assignments",
305
+
"clusters": "device_cluster_assignments",
306
+
},
307
+
"locations": {
308
+
"prefixes": "prefix_location_assignments",
309
+
"vlans": "vlan_location_assignments",
310
+
},
311
+
# ... etc.
312
+
}
313
+
```
314
+
315
+
### How M2M Fields Are Processed
316
+
317
+
During `__init__`, M2M fields are handled separately from regular fields to prevent collisions with `_find_ids`:
318
+
319
+
1.**Extraction**: M2M field data is popped from the data dict *before*`_find_ids` runs on the parent data. This prevents M2M field names (like `prefixes`) from being mistakenly resolved as direct FK relationships.
320
+
2.**Child resolution**: Each M2M object's child key (e.g., `vrf`, `prefix`, `ip_address`) is individually run through `_find_ids` to resolve names to UUIDs. This supports both simple strings (`vrf: "My VRF"`) and dicts for disambiguation (`ip_address: {address: "10.0.0.1/24", namespace: "Global"}`).
321
+
3.**Payload stripping**: M2M field names are added to `remove_keys` so they are stripped from the REST API payload sent for the parent object.
322
+
323
+
After the parent object is created or updated, `_ensure_object_exists` calls `_process_m2m_fields` which iterates through each M2M field and:
324
+
325
+
- Fetches current associations from the API
326
+
- Compares desired vs current using normalized comparison keys
327
+
- Applies the requested state (`merge`, `replace`, or `delete`) via bulk create/delete operations
328
+
329
+
### Adding M2M Support to a New Module
330
+
331
+
If a new association endpoint is added to Nautobot and you want to support inline management:
332
+
333
+
1. Add the mapping to `M2M_FIELDS` in `utils.py`
334
+
2. Add the M2M argument to the parent module's `argument_spec` following the standard structure (state/objects/child_key suboptions)
335
+
3. Add matching `DOCUMENTATION` with suboptions
336
+
4. Ensure the child key is in `CONVERT_TO_ID` and has appropriate `QUERY_TYPES`, `ENDPOINT_NAME_MAPPING`, and `ALLOWED_QUERY_PARAMS` entries
337
+
5. Add integration tests covering merge, replace, delete, and idempotency
338
+
339
+
No changes to the module's `main()` function or constructor are needed -- the framework auto-detects M2M fields from `M2M_FIELDS` based on `self.endpoint`.
0 commit comments