From 5e3bb1778757b56a9a3bd4569d6d5975791a180b Mon Sep 17 00:00:00 2001 From: Mikhail Yohman Date: Sun, 12 Jul 2020 13:05:16 -0600 Subject: [PATCH] V0.3.0 (#271) --- .travis.yml | 2 +- CHANGELOG.md | 65 +++++++++++++++++++ galaxy.yml | 2 +- plugins/inventory/nb_inventory.py | 2 +- plugins/modules/netbox_cable.py | 2 +- plugins/modules/netbox_device_bay_template.py | 2 +- .../netbox_device_interface_template.py | 2 +- plugins/modules/netbox_virtual_chassis.py | 2 +- 8 files changed, 72 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd2041079..568ba87f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: global: - COLLECTION_NAMESPACE: netbox - COLLECTION_NAME: netbox - - COLLECTION_VERSION: 0.2.3 + - COLLECTION_VERSION: 0.3.0 - secure: "tE6GtwrRU+Kjobx/94xqR2MqM20pHCnrLcHgPzIHA3npdwuA+GjCBiBLTkEEQM4fUWIfzUTyjSr9bZErm1PTI1GcIRdniTgJ3ZzSSkE7tgeYALB/7xsusB57SlmbBQm2SGwU558uWZ3NHEsi0WTgD8GKZo77OpGX72FZKsVXOz6k2wve51sOtoSVjgCsvWTmZHx4ynGdiA5wFkZfaEcjXECahKtunW+MlB5kpJzkVeLRUEXFMhWlsIYiA5nj8OI/X3Nk9ugh1ribENX9LrjpgrqQ9YariZ8G6py1ONuKZIn2g7xs5kNQ3qL6HL6N7SoUxiwH16CfSyugFaYiMfaxQ4NUVGGRHS4vSGbNIf+gLHcYvP40miI1f/+pntCzqygZMhW73FX2o+KH2OGv09khOl8k1nDg2/XvW0kCc/FU6l+Jp5wCC8H9X2uiULtQpRqts5TzIonlPEzGIpfGFgJ5m54Emhv9gjG1Z5OOyL/qae1Wr+L/uhiFafcglZYh8NHEMWCUCkeqFqR2kDmUMtdgYLD7Q7NdwlL/PSVVs1l7UPiQHlnecQKEHN7CvR3eKByTEmkCKafRYh/JQ9rBt9sZc7aAPVu+w3wWUwbHS4o4vVnmyXvJb1PeJSiuynF7CBo4Qd6qj4YwX8gLK6PylGyaMOp169u6xw1mo5/CX0pJ3x4=" jobs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0847d9a92..b3b2a6375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,67 @@ # Changelog +## v0.3.0 + +### Breaking Changes + +- [#270](https://github.com/netbox-community/ansible_modules/pull/270) - To pass in integers via Ansible Jinja filters for a key in `data` that requires querying an endpoint is now done by making it a dictionary with an `id` key. + The previous behavior was to just pass in an integer and it was converted when normalizing the data, but some people may have names that are all integers and those were being converted erroneously so we made the decision to change + the method to convert to an integer for the NetBox API. + + ```yaml + tasks: + - name: Create device within NetBox with only required information + netbox_device: + netbox_url: http://netbox-demo.org:32768 + netbox_token: 0123456789abcdef0123456789abcdef01234567 + data: + name: Test66 + device_type: + id: "{{ some_jinja_variable }}" + device_role: Core Switch + site: Test Site + status: Staged + state: present + ``` + +- [#269](https://github.com/netbox-community/ansible_modules/pull/269) - `pynetbox` changed to using `requests.Session()` to manage the HTTP session which broke passing in `ssl_verify` when building the NetBox API client. + This PR makes `pynetbox 5.0.4+` the new required version of `pynetbox` for the Ansible modules and lookup plugin. + +### Enhancements + +- [#251](https://github.com/netbox-community/ansible_modules/pull/251) - Add `virtual_chassis`, `vc_position`, `vc_priority` to `netbox_device` options +- [#258](https://github.com/netbox-community/ansible_modules/pull/258) - Add `local_context_data` and `flatten_local_context_data` option to `nb_inventory` +- [#258](https://github.com/netbox-community/ansible_modules/pull/258) - Add `local_context_data` option to `netbox_device` + +### Bugfix + +- [#242](https://github.com/netbox-community/ansible_modules/issues/242) - Compares tags as a set to prevent issues with order difference between user supplied tags and NetBox API +- [#243](https://github.com/netbox-community/ansible_modules/issues/243) - Normalize descriptions to remove any extra whitespace +- [#246](https://github.com/netbox-community/ansible_modules/issues/246) - Allows OR operations in API fitlers for `nb_lookup` plugin +- [#254](https://github.com/netbox-community/ansible_modules/issues/254) - Normalize `mac_address` to upper case +- [#261](https://github.com/netbox-community/ansible_modules/pull/261) - Fixes typo for `CONVERT_TO_ID` mapping in `netbox_utils` for `dcim.rearport` +- [#265](https://github.com/netbox-community/ansible_modules/pull/265) - Fixes typo for `CONVERT_TO_ID` mapping in `netbox_utils` for `dcim.powerport` and `dcim.poweroutlet` +- [#262](https://github.com/netbox-community/ansible_modules/issues/262) - Build the `rear_port` and `rear_port_template` query_params to properly find rear port + +### New Modules + +- [#251](https://github.com/netbox-community/ansible_modules/pull/251) - `netbox_cable` +- [#251](https://github.com/netbox-community/ansible_modules/pull/251) - `netbox_device_bay_template` +- [#251](https://github.com/netbox-community/ansible_modules/pull/251) - `netbox_virtual_chassis` +- [#259](https://github.com/netbox-community/ansible_modules/pull/259) - `netbox_interface_template` + +### Thanks to the following contributors + +- @toerb +- @ThomasADavis +- @monkz +- @jkuzma07 +- @AdamMack2007 +- @smutel +- @pugnacity +- @adamwoolhether +- @ghost + ## v0.2.3 ### Documentation @@ -8,6 +70,7 @@ - [#180](https://github.com/netbox-community/ansible_modules/issues/180) - Fix documentation errors when using ansible-lint `validate-modules` ### Enchancements + - [#216](https://github.com/netbox-community/ansible_modules/issues/216) - Allows private key to be passed in to `validate_certs` within modules - [#187](https://github.com/netbox-community/ansible_modules/issues/187) - Adds `discovered` field to `netbox_inventory_item` - [#219](https://github.com/netbox-community/ansible_modules/pull/219) - Adds `tenant` field to `netbox_cluster` @@ -15,11 +78,13 @@ - [#238](https://github.com/netbox-community/ansible_modules/pull/238) - Better error handling if read-only token is provided for modules. Updated README as well to say that a `write-enabled` token is required ### Bug Fixes + - [#214](https://github.com/netbox-community/ansible_modules/issues/214) - Fixes bug in inventory plugin that fails if there are either no virtual machines, but devices defined in NetBox or vice versa from failing when `fetch_all` is set to `False` - [#228](https://github.com/netbox-community/ansible_modules/issues/228) - Fixes bug in `netbox_prefix` failing when using `check_mode` - [#231](https://github.com/netbox-community/ansible_modules/issues/231) - Normalize any string values that are passed in via Jinja into an integer within the `_normalize_data` method ### New Modules + - [#235](https://github.com/netbox-community/ansible_modules/pull/235) - `netbox_power_feed` - [#235](https://github.com/netbox-community/ansible_modules/pull/235) - `netbox_power_outlet` - [#235](https://github.com/netbox-community/ansible_modules/pull/235) - `netbox_power_outlet_template` diff --git a/galaxy.yml b/galaxy.yml index 69f9ca061..d83aa10bd 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,7 +9,7 @@ namespace: netbox name: netbox # The version of the collection. Must be compatible with semantic versioning -version: 0.2.3 +version: 0.3.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/plugins/inventory/nb_inventory.py b/plugins/inventory/nb_inventory.py index 814e2f828..0a7c009da 100644 --- a/plugins/inventory/nb_inventory.py +++ b/plugins/inventory/nb_inventory.py @@ -55,7 +55,7 @@ - If flatten_local_context_data is set to True, the config context variables will be added directly to the host instead. default: False type: boolean - version_added: "0.2.4" + version_added: "0.3.0" flatten_custom_fields: description: - By default, host custom fields are added as a dictionary host var named custom_fields. diff --git a/plugins/modules/netbox_cable.py b/plugins/modules/netbox_cable.py index 68131c863..aab2dc946 100644 --- a/plugins/modules/netbox_cable.py +++ b/plugins/modules/netbox_cable.py @@ -27,7 +27,7 @@ - Tobias Groß (@toerb) requirements: - pynetbox -version_added: '0.2.4' +version_added: '0.3.0' options: netbox_url: description: diff --git a/plugins/modules/netbox_device_bay_template.py b/plugins/modules/netbox_device_bay_template.py index 226649d3a..3b4893b55 100644 --- a/plugins/modules/netbox_device_bay_template.py +++ b/plugins/modules/netbox_device_bay_template.py @@ -27,7 +27,7 @@ - Tobias Groß (@toerb) requirements: - pynetbox -version_added: '0.2.4' +version_added: '0.3.0' options: netbox_url: description: diff --git a/plugins/modules/netbox_device_interface_template.py b/plugins/modules/netbox_device_interface_template.py index 8504f754f..f60071f30 100644 --- a/plugins/modules/netbox_device_interface_template.py +++ b/plugins/modules/netbox_device_interface_template.py @@ -27,7 +27,7 @@ - Tobias Groß (@toerb) requirements: - pynetbox -version_added: "0.2.4" +version_added: "0.3.0" options: netbox_url: description: diff --git a/plugins/modules/netbox_virtual_chassis.py b/plugins/modules/netbox_virtual_chassis.py index e6677114b..b4be9f09b 100644 --- a/plugins/modules/netbox_virtual_chassis.py +++ b/plugins/modules/netbox_virtual_chassis.py @@ -27,7 +27,7 @@ - Tobias Groß (@toerb) requirements: - pynetbox -version_added: '0.2.4' +version_added: '0.3.0' options: netbox_url: description: