summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/hrobot
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/community/hrobot')
-rw-r--r--ansible_collections/community/hrobot/.github/workflows/ansible-test.yml38
-rw-r--r--ansible_collections/community/hrobot/.github/workflows/ee.yml18
-rw-r--r--ansible_collections/community/hrobot/.github/workflows/extra-tests.yml9
-rw-r--r--ansible_collections/community/hrobot/CHANGELOG.md156
-rw-r--r--ansible_collections/community/hrobot/CHANGELOG.rst28
-rw-r--r--ansible_collections/community/hrobot/FILES.json20
-rw-r--r--ansible_collections/community/hrobot/MANIFEST.json8
-rw-r--r--ansible_collections/community/hrobot/README.md2
-rw-r--r--ansible_collections/community/hrobot/changelogs/changelog.yaml31
-rw-r--r--ansible_collections/community/hrobot/meta/runtime.yml2
-rw-r--r--ansible_collections/community/hrobot/plugins/inventory/robot.py54
-rw-r--r--ansible_collections/community/hrobot/tests/unit/plugins/inventory/test_robot.py2
12 files changed, 218 insertions, 150 deletions
diff --git a/ansible_collections/community/hrobot/.github/workflows/ansible-test.yml b/ansible_collections/community/hrobot/.github/workflows/ansible-test.yml
index 6aadd1b4f..fe133e857 100644
--- a/ansible_collections/community/hrobot/.github/workflows/ansible-test.yml
+++ b/ansible_collections/community/hrobot/.github/workflows/ansible-test.yml
@@ -26,53 +26,29 @@ jobs:
ansible:
# It's important that Sanity is tested against all stable-X.Y branches
# Testing against `devel` may fail as new tests are added.
- - stable-2.9
- - stable-2.10
- - stable-2.11
- - stable-2.12
- - stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- devel
- # Ansible-test on various stable branches does not yet work well with cgroups v2.
- # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
- # image for these stable branches. The list of branches where this is necessary will
- # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
- # for the latest list.
- runs-on: >-
- ${{ contains(fromJson(
- '["stable-2.9", "stable-2.10", "stable-2.11"]'
- ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
+ runs-on: ubuntu-latest
steps:
- name: Perform sanity testing
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: sanity
+ pre-test-cmd: >-
+ git clone --depth=1 --single-branch --branch stable-1 https://github.com/ansible-collections/community.library_inventory_filtering.git ../../community/library_inventory_filtering_v1
units:
- # Ansible-test on various stable branches does not yet work well with cgroups v2.
- # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
- # image for these stable branches. The list of branches where this is necessary will
- # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28
- # for the latest list.
- runs-on: >-
- ${{ contains(fromJson(
- '["stable-2.9", "stable-2.10", "stable-2.11"]'
- ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
+ runs-on: ubuntu-latest
name: Units (Ⓐ${{ matrix.ansible }})
strategy:
# As soon as the first unit test fails, cancel the others to free up the CI queue
fail-fast: true
matrix:
ansible:
- - stable-2.9
- - stable-2.10
- - stable-2.11
- - stable-2.12
- - stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
@@ -87,6 +63,6 @@ jobs:
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: units
- # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
- pre-test-cmd: >-
- git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
+ test-deps: >-
+ git+https://github.com/ansible-collections/community.internal_test_tools.git,main
+ git+https://github.com/ansible-collections/community.library_inventory_filtering.git,stable-1
diff --git a/ansible_collections/community/hrobot/.github/workflows/ee.yml b/ansible_collections/community/hrobot/.github/workflows/ee.yml
index c4e751a79..ba356758d 100644
--- a/ansible_collections/community/hrobot/.github/workflows/ee.yml
+++ b/ansible_collections/community/hrobot/.github/workflows/ee.yml
@@ -62,22 +62,6 @@ jobs:
ansible_runner: ansible-runner
base_image: quay.io/centos/centos:stream9
pre_base: '"#"'
- - name: ansible-core 2.13 @ RHEL UBI 8
- ansible_core: https://github.com/ansible/ansible/archive/stable-2.13.tar.gz
- ansible_runner: ansible-runner
- other_deps: |2
- python_interpreter:
- package_system: python39 python39-pip python39-wheel python39-cryptography
- base_image: docker.io/redhat/ubi8:latest
- pre_base: '"#"'
- - name: ansible-core 2.12 @ CentOS Stream 8
- ansible_core: https://github.com/ansible/ansible/archive/stable-2.12.tar.gz
- ansible_runner: ansible-runner
- other_deps: |2
- python_interpreter:
- package_system: python39 python39-pip python39-wheel python39-cryptography
- base_image: quay.io/centos/centos:stream8
- pre_base: '"#"'
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -88,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
- python-version: '3.11'
+ python-version: '3.12'
- name: Install ansible-builder and ansible-navigator
run: pip install ansible-builder ansible-navigator
diff --git a/ansible_collections/community/hrobot/.github/workflows/extra-tests.yml b/ansible_collections/community/hrobot/.github/workflows/extra-tests.yml
index ee8964c3f..9b9e56009 100644
--- a/ansible_collections/community/hrobot/.github/workflows/extra-tests.yml
+++ b/ansible_collections/community/hrobot/.github/workflows/extra-tests.yml
@@ -33,15 +33,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
- python-version: '3.11'
+ python-version: '3.12'
- name: Install ansible-core
run: pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
- name: Install collection dependencies
- run: git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ./ansible_collections/community/internal_test_tools
- # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
- # run: ansible-galaxy collection install community.internal_test_tools -p .
+ run: >-
+ ansible-galaxy collection install -p .
+ git+https://github.com/ansible-collections/community.internal_test_tools.git,main
+ git+https://github.com/ansible-collections/community.library_inventory_filtering.git,stable-1
- name: Run sanity tests
run: ../../community/internal_test_tools/tools/run.py --color
diff --git a/ansible_collections/community/hrobot/CHANGELOG.md b/ansible_collections/community/hrobot/CHANGELOG.md
index fec73109e..d995f8d6d 100644
--- a/ansible_collections/community/hrobot/CHANGELOG.md
+++ b/ansible_collections/community/hrobot/CHANGELOG.md
@@ -2,77 +2,111 @@
**Topics**
-- <a href="#v1-9-2">v1\.9\.2</a>
+- <a href="#v2-0-0">v2\.0\.0</a>
- <a href="#release-summary">Release Summary</a>
+ - <a href="#major-changes">Major Changes</a>
+ - <a href="#minor-changes">Minor Changes</a>
+ - <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
+ - <a href="#removed-features-previously-deprecated">Removed Features \(previously deprecated\)</a>
+- <a href="#v1-9-2">v1\.9\.2</a>
+ - <a href="#release-summary-1">Release Summary</a>
- <a href="#bugfixes">Bugfixes</a>
- <a href="#v1-9-1">v1\.9\.1</a>
- - <a href="#release-summary-1">Release Summary</a>
+ - <a href="#release-summary-2">Release Summary</a>
- <a href="#security-fixes">Security Fixes</a>
- <a href="#v1-9-0">v1\.9\.0</a>
- - <a href="#release-summary-2">Release Summary</a>
- - <a href="#minor-changes">Minor Changes</a>
+ - <a href="#release-summary-3">Release Summary</a>
+ - <a href="#minor-changes-1">Minor Changes</a>
- <a href="#deprecated-features">Deprecated Features</a>
- <a href="#v1-8-2">v1\.8\.2</a>
- - <a href="#release-summary-3">Release Summary</a>
+ - <a href="#release-summary-4">Release Summary</a>
- <a href="#bugfixes-1">Bugfixes</a>
- <a href="#v1-8-1">v1\.8\.1</a>
- - <a href="#release-summary-4">Release Summary</a>
+ - <a href="#release-summary-5">Release Summary</a>
- <a href="#known-issues">Known Issues</a>
- <a href="#v1-8-0">v1\.8\.0</a>
- - <a href="#release-summary-5">Release Summary</a>
- - <a href="#major-changes">Major Changes</a>
- - <a href="#minor-changes-1">Minor Changes</a>
-- <a href="#v1-7-0">v1\.7\.0</a>
- <a href="#release-summary-6">Release Summary</a>
+ - <a href="#major-changes-1">Major Changes</a>
+ - <a href="#minor-changes-2">Minor Changes</a>
+- <a href="#v1-7-0">v1\.7\.0</a>
+ - <a href="#release-summary-7">Release Summary</a>
- <a href="#new-modules">New Modules</a>
- <a href="#v1-6-0">v1\.6\.0</a>
- - <a href="#release-summary-7">Release Summary</a>
- - <a href="#minor-changes-2">Minor Changes</a>
-- <a href="#v1-5-2">v1\.5\.2</a>
- <a href="#release-summary-8">Release Summary</a>
- <a href="#minor-changes-3">Minor Changes</a>
-- <a href="#v1-5-1">v1\.5\.1</a>
+- <a href="#v1-5-2">v1\.5\.2</a>
- <a href="#release-summary-9">Release Summary</a>
-- <a href="#v1-5-0">v1\.5\.0</a>
- - <a href="#release-summary-10">Release Summary</a>
- <a href="#minor-changes-4">Minor Changes</a>
-- <a href="#v1-4-0">v1\.4\.0</a>
+- <a href="#v1-5-1">v1\.5\.1</a>
+ - <a href="#release-summary-10">Release Summary</a>
+- <a href="#v1-5-0">v1\.5\.0</a>
- <a href="#release-summary-11">Release Summary</a>
- <a href="#minor-changes-5">Minor Changes</a>
-- <a href="#v1-3-1">v1\.3\.1</a>
+- <a href="#v1-4-0">v1\.4\.0</a>
- <a href="#release-summary-12">Release Summary</a>
+ - <a href="#minor-changes-6">Minor Changes</a>
+- <a href="#v1-3-1">v1\.3\.1</a>
+ - <a href="#release-summary-13">Release Summary</a>
- <a href="#bugfixes-2">Bugfixes</a>
- <a href="#v1-3-0">v1\.3\.0</a>
- - <a href="#release-summary-13">Release Summary</a>
- - <a href="#minor-changes-6">Minor Changes</a>
+ - <a href="#release-summary-14">Release Summary</a>
+ - <a href="#minor-changes-7">Minor Changes</a>
- <a href="#bugfixes-3">Bugfixes</a>
- <a href="#v1-2-3">v1\.2\.3</a>
- - <a href="#release-summary-14">Release Summary</a>
-- <a href="#v1-2-2">v1\.2\.2</a>
- <a href="#release-summary-15">Release Summary</a>
+- <a href="#v1-2-2">v1\.2\.2</a>
+ - <a href="#release-summary-16">Release Summary</a>
- <a href="#bugfixes-4">Bugfixes</a>
- <a href="#v1-2-1">v1\.2\.1</a>
- - <a href="#release-summary-16">Release Summary</a>
- - <a href="#minor-changes-7">Minor Changes</a>
-- <a href="#v1-2-0">v1\.2\.0</a>
- <a href="#release-summary-17">Release Summary</a>
- <a href="#minor-changes-8">Minor Changes</a>
+- <a href="#v1-2-0">v1\.2\.0</a>
+ - <a href="#release-summary-18">Release Summary</a>
+ - <a href="#minor-changes-9">Minor Changes</a>
- <a href="#new-modules-1">New Modules</a>
- <a href="#v1-1-1">v1\.1\.1</a>
- - <a href="#release-summary-18">Release Summary</a>
+ - <a href="#release-summary-19">Release Summary</a>
- <a href="#bugfixes-5">Bugfixes</a>
- <a href="#v1-1-0">v1\.1\.0</a>
- - <a href="#release-summary-19">Release Summary</a>
+ - <a href="#release-summary-20">Release Summary</a>
- <a href="#new-plugins">New Plugins</a>
- <a href="#inventory">Inventory</a>
- <a href="#v1-0-0">v1\.0\.0</a>
- - <a href="#release-summary-20">Release Summary</a>
- - <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
+ - <a href="#release-summary-21">Release Summary</a>
+ - <a href="#breaking-changes--porting-guide-1">Breaking Changes / Porting Guide</a>
+
+<a id="v2-0-0"></a>
+## v2\.0\.0
+
+<a id="release-summary"></a>
+### Release Summary
+
+\.\.\.
+
+<a id="major-changes"></a>
+### Major Changes
+
+* The <code>community\.hrobot</code> collection now depends on the <code>community\.library\_inventory\_filtering\_v1</code> collection\. This utility collection provides host filtering functionality for inventory plugins\. If you use the Ansible community package\, both collections are included and you do not have to do anything special\. If you install the collection with <code>ansible\-galaxy collection install</code>\, it will be installed automatically\. If you install the collection by copying the files of the collection to a place where ansible\-core can find it\, for example by cloning the git repository\, you need to make sure that you also have to install the dependency if you are using the inventory plugin \([https\://github\.com/ansible\-collections/community\.hrobot/pull/101](https\://github\.com/ansible\-collections/community\.hrobot/pull/101)\)\.
+
+<a id="minor-changes"></a>
+### Minor Changes
+
+* robot inventory plugin \- add <code>filter</code> option which allows to include and exclude hosts based on Jinja2 conditions \([https\://github\.com/ansible\-collections/community\.hrobot/pull/101](https\://github\.com/ansible\-collections/community\.hrobot/pull/101)\)\.
+
+<a id="breaking-changes--porting-guide"></a>
+### Breaking Changes / Porting Guide
+
+* robot inventory plugin \- <code>filters</code> is now no longer an alias of <code>simple\_filters</code>\, but a new\, different option \([https\://github\.com/ansible\-collections/community\.hrobot/pull/101](https\://github\.com/ansible\-collections/community\.hrobot/pull/101)\)\.
+
+<a id="removed-features-previously-deprecated"></a>
+### Removed Features \(previously deprecated\)
+
+* The collection no longer supports Ansible\, ansible\-base\, and ansible\-core releases that are currently End of Life at the time of the 2\.0\.0 release\. This means that Ansible 2\.9\, ansible\-base 2\.10\, ansible\-core 2\.11\, ansible\-core 2\.12\, ansible\-core 2\.13\, and ansible\-core 2\.14 are no longer supported\. The collection might still work with these versions\, but it can stop working at any moment without advance notice\, and this will not be considered a bug \([https\://github\.com/ansible\-collections/community\.hrobot/pull/101](https\://github\.com/ansible\-collections/community\.hrobot/pull/101)\)\.
<a id="v1-9-2"></a>
## v1\.9\.2
-<a id="release-summary"></a>
+<a id="release-summary-1"></a>
### Release Summary
Bugfix release\.
@@ -85,7 +119,7 @@ Bugfix release\.
<a id="v1-9-1"></a>
## v1\.9\.1
-<a id="release-summary-1"></a>
+<a id="release-summary-2"></a>
### Release Summary
Bugfix release\.
@@ -98,12 +132,12 @@ Bugfix release\.
<a id="v1-9-0"></a>
## v1\.9\.0
-<a id="release-summary-2"></a>
+<a id="release-summary-3"></a>
### Release Summary
Feature and maintenance release\.
-<a id="minor-changes"></a>
+<a id="minor-changes-1"></a>
### Minor Changes
* robot inventory plugin \- the <code>filters</code> option has been renamed to <code>simple\_filters</code>\. The old name still works until community\.hrobot 2\.0\.0\. Then it will change to allow more complex filtering with the <code>community\.library\_inventory\_filtering\_v1</code> collection\'s functionality \([https\://github\.com/ansible\-collections/community\.hrobot/pull/94](https\://github\.com/ansible\-collections/community\.hrobot/pull/94)\)\.
@@ -116,7 +150,7 @@ Feature and maintenance release\.
<a id="v1-8-2"></a>
## v1\.8\.2
-<a id="release-summary-3"></a>
+<a id="release-summary-4"></a>
### Release Summary
Maintenance release with updated documentation\.
@@ -129,7 +163,7 @@ Maintenance release with updated documentation\.
<a id="v1-8-1"></a>
## v1\.8\.1
-<a id="release-summary-4"></a>
+<a id="release-summary-5"></a>
### Release Summary
Maintenance release with updated documentation\.
@@ -150,17 +184,17 @@ for the rendered HTML version of the documentation of the latest release\.
<a id="v1-8-0"></a>
## v1\.8\.0
-<a id="release-summary-5"></a>
+<a id="release-summary-6"></a>
### Release Summary
Feature release for the Hetzner firewall changes\.
-<a id="major-changes"></a>
+<a id="major-changes-1"></a>
### Major Changes
* firewall \- Hetzner added output rules support to the firewall\. This change unfortunately means that using old versions of the firewall module will always set the output rule list to empty\, thus disallowing the server to send out packets \([https\://github\.com/ansible\-collections/community\.hrobot/issues/75](https\://github\.com/ansible\-collections/community\.hrobot/issues/75)\, [https\://github\.com/ansible\-collections/community\.hrobot/pull/76](https\://github\.com/ansible\-collections/community\.hrobot/pull/76)\)\.
-<a id="minor-changes-1"></a>
+<a id="minor-changes-2"></a>
### Minor Changes
* firewall\, firewall\_info \- add <code>filter\_ipv6</code> and <code>rules\.output</code> output to support the new IPv6 filtering and output rules features \([https\://github\.com/ansible\-collections/community\.hrobot/issues/75](https\://github\.com/ansible\-collections/community\.hrobot/issues/75)\, [https\://github\.com/ansible\-collections/community\.hrobot/pull/76](https\://github\.com/ansible\-collections/community\.hrobot/pull/76)\)\.
@@ -169,7 +203,7 @@ Feature release for the Hetzner firewall changes\.
<a id="v1-7-0"></a>
## v1\.7\.0
-<a id="release-summary-6"></a>
+<a id="release-summary-7"></a>
### Release Summary
Feature release\.
@@ -182,12 +216,12 @@ Feature release\.
<a id="v1-6-0"></a>
## v1\.6\.0
-<a id="release-summary-7"></a>
+<a id="release-summary-8"></a>
### Release Summary
Feature release with improved documentation\.
-<a id="minor-changes-2"></a>
+<a id="minor-changes-3"></a>
### Minor Changes
* Added a <code>community\.hrobot\.robot</code> module defaults group / action group\. Use with <code>group/community\.hrobot\.robot</code> to provide options for all Hetzner Robot modules \([https\://github\.com/ansible\-collections/community\.hrobot/pull/65](https\://github\.com/ansible\-collections/community\.hrobot/pull/65)\)\.
@@ -195,12 +229,12 @@ Feature release with improved documentation\.
<a id="v1-5-2"></a>
## v1\.5\.2
-<a id="release-summary-8"></a>
+<a id="release-summary-9"></a>
### Release Summary
Maintenance release with a documentation improvement\.
-<a id="minor-changes-3"></a>
+<a id="minor-changes-4"></a>
### Minor Changes
* The collection repository conforms to the [REUSE specification](https\://reuse\.software/spec/) except for the changelog fragments \([https\://github\.com/ansible\-collections/community\.hrobot/pull/60](https\://github\.com/ansible\-collections/community\.hrobot/pull/60)\)\.
@@ -208,7 +242,7 @@ Maintenance release with a documentation improvement\.
<a id="v1-5-1"></a>
## v1\.5\.1
-<a id="release-summary-9"></a>
+<a id="release-summary-10"></a>
### Release Summary
Maintenance release with small documentation fixes\.
@@ -216,12 +250,12 @@ Maintenance release with small documentation fixes\.
<a id="v1-5-0"></a>
## v1\.5\.0
-<a id="release-summary-10"></a>
+<a id="release-summary-11"></a>
### Release Summary
Maintenance release changing the way licenses are declared\. No functional changes\.
-<a id="minor-changes-4"></a>
+<a id="minor-changes-5"></a>
### Minor Changes
* All software licenses are now in the <code>LICENSES/</code> directory of the collection root\. Moreover\, <code>SPDX\-License\-Identifier\:</code> is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.hrobot/pull/52](https\://github\.com/ansible\-collections/community\.hrobot/pull/52)\)\.
@@ -229,12 +263,12 @@ Maintenance release changing the way licenses are declared\. No functional chang
<a id="v1-4-0"></a>
## v1\.4\.0
-<a id="release-summary-11"></a>
+<a id="release-summary-12"></a>
### Release Summary
Feature release\.
-<a id="minor-changes-5"></a>
+<a id="minor-changes-6"></a>
### Minor Changes
* robot inventory plugin \- allow to template <code>hetzner\_user</code> and <code>hetzner\_password</code> \([https\://github\.com/ansible\-collections/community\.hrobot/pull/49](https\://github\.com/ansible\-collections/community\.hrobot/pull/49)\)\.
@@ -242,7 +276,7 @@ Feature release\.
<a id="v1-3-1"></a>
## v1\.3\.1
-<a id="release-summary-12"></a>
+<a id="release-summary-13"></a>
### Release Summary
Maintenance release\.
@@ -255,12 +289,12 @@ Maintenance release\.
<a id="v1-3-0"></a>
## v1\.3\.0
-<a id="release-summary-13"></a>
+<a id="release-summary-14"></a>
### Release Summary
Feature and bugfix release\.
-<a id="minor-changes-6"></a>
+<a id="minor-changes-7"></a>
### Minor Changes
* Prepare collection for inclusion in an Execution Environment by declaring its dependencies \([https\://github\.com/ansible\-collections/community\.hrobot/pull/45](https\://github\.com/ansible\-collections/community\.hrobot/pull/45)\)\.
@@ -273,7 +307,7 @@ Feature and bugfix release\.
<a id="v1-2-3"></a>
## v1\.2\.3
-<a id="release-summary-14"></a>
+<a id="release-summary-15"></a>
### Release Summary
Docs update release\.
@@ -281,7 +315,7 @@ Docs update release\.
<a id="v1-2-2"></a>
## v1\.2\.2
-<a id="release-summary-15"></a>
+<a id="release-summary-16"></a>
### Release Summary
Bugfix release\.
@@ -294,12 +328,12 @@ Bugfix release\.
<a id="v1-2-1"></a>
## v1\.2\.1
-<a id="release-summary-16"></a>
+<a id="release-summary-17"></a>
### Release Summary
Maintenance release\.
-<a id="minor-changes-7"></a>
+<a id="minor-changes-8"></a>
### Minor Changes
* Generic module HTTP support code \- fix usage of <code>fetch\_url</code> with changes in latest ansible\-core <code>devel</code> branch \([https\://github\.com/ansible\-collections/community\.hrobot/pull/30](https\://github\.com/ansible\-collections/community\.hrobot/pull/30)\)\.
@@ -307,12 +341,12 @@ Maintenance release\.
<a id="v1-2-0"></a>
## v1\.2\.0
-<a id="release-summary-17"></a>
+<a id="release-summary-18"></a>
### Release Summary
Feature release with multiple new modules\.
-<a id="minor-changes-8"></a>
+<a id="minor-changes-9"></a>
### Minor Changes
* Avoid internal ansible\-core module\_utils in favor of equivalent public API available since at least Ansible 2\.9 \([https\://github\.com/ansible\-collections/community\.hrobot/pull/18](https\://github\.com/ansible\-collections/community\.hrobot/pull/18)\)\.
@@ -334,7 +368,7 @@ Feature release with multiple new modules\.
<a id="v1-1-1"></a>
## v1\.1\.1
-<a id="release-summary-18"></a>
+<a id="release-summary-19"></a>
### Release Summary
Bugfix release which reduces the number of HTTPS queries for the modules and plugins\.
@@ -347,7 +381,7 @@ Bugfix release which reduces the number of HTTPS queries for the modules and plu
<a id="v1-1-0"></a>
## v1\.1\.0
-<a id="release-summary-19"></a>
+<a id="release-summary-20"></a>
### Release Summary
Release with a new inventory plugin\.
@@ -363,12 +397,12 @@ Release with a new inventory plugin\.
<a id="v1-0-0"></a>
## v1\.0\.0
-<a id="release-summary-20"></a>
+<a id="release-summary-21"></a>
### Release Summary
The <code>community\.hrobot</code> continues the work on the Hetzner Robot modules from their state in <code>community\.general</code> 1\.2\.0\. The changes listed here are thus relative to the modules <code>community\.general\.hetzner\_\*</code>\.
-<a id="breaking-changes--porting-guide"></a>
+<a id="breaking-changes--porting-guide-1"></a>
### Breaking Changes / Porting Guide
* firewall \- now requires the [ipaddress](https\://pypi\.org/project/ipaddress/) library \([https\://github\.com/ansible\-collections/community\.hrobot/pull/2](https\://github\.com/ansible\-collections/community\.hrobot/pull/2)\)\.
diff --git a/ansible_collections/community/hrobot/CHANGELOG.rst b/ansible_collections/community/hrobot/CHANGELOG.rst
index fdb9c4a23..18407d29f 100644
--- a/ansible_collections/community/hrobot/CHANGELOG.rst
+++ b/ansible_collections/community/hrobot/CHANGELOG.rst
@@ -4,6 +4,34 @@ Community Hetzner Robot Collection Release Notes
.. contents:: Topics
+v2.0.0
+======
+
+Release Summary
+---------------
+
+...
+
+Major Changes
+-------------
+
+- The ``community.hrobot`` collection now depends on the ``community.library_inventory_filtering_v1`` collection. This utility collection provides host filtering functionality for inventory plugins. If you use the Ansible community package, both collections are included and you do not have to do anything special. If you install the collection with ``ansible-galaxy collection install``, it will be installed automatically. If you install the collection by copying the files of the collection to a place where ansible-core can find it, for example by cloning the git repository, you need to make sure that you also have to install the dependency if you are using the inventory plugin (https://github.com/ansible-collections/community.hrobot/pull/101).
+
+Minor Changes
+-------------
+
+- robot inventory plugin - add ``filter`` option which allows to include and exclude hosts based on Jinja2 conditions (https://github.com/ansible-collections/community.hrobot/pull/101).
+
+Breaking Changes / Porting Guide
+--------------------------------
+
+- robot inventory plugin - ``filters`` is now no longer an alias of ``simple_filters``, but a new, different option (https://github.com/ansible-collections/community.hrobot/pull/101).
+
+Removed Features (previously deprecated)
+----------------------------------------
+
+- The collection no longer supports Ansible, ansible-base, and ansible-core releases that are currently End of Life at the time of the 2.0.0 release. This means that Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14 are no longer supported. The collection might still work with these versions, but it can stop working at any moment without advance notice, and this will not be considered a bug (https://github.com/ansible-collections/community.hrobot/pull/101).
+
v1.9.2
======
diff --git a/ansible_collections/community/hrobot/FILES.json b/ansible_collections/community/hrobot/FILES.json
index e5964a9b0..1f4f1fc3f 100644
--- a/ansible_collections/community/hrobot/FILES.json
+++ b/ansible_collections/community/hrobot/FILES.json
@@ -25,7 +25,7 @@
"name": ".github/workflows/ansible-test.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "6745e283a9f1578108ad5f14efed6558cdfb1a25c5e04426836b343baa7f1ccc",
+ "chksum_sha256": "597f0f97a3486451bdf364c20f5b4b899486c0350422811b76fc57922ee50f6a",
"format": 1
},
{
@@ -46,14 +46,14 @@
"name": ".github/workflows/ee.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "03c5a4a0a65ebe7d5b9683d95f2752cdbbcac4d4b8cca513d4332d80dd1c79c2",
+ "chksum_sha256": "bd2cbf8bd79099e4f848a41d3fbf00e5b6d14037cfd2e9a2b4674d36c3ef0ae4",
"format": 1
},
{
"name": ".github/workflows/extra-tests.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "3d4972a65972c0091b7343e287eba10382716e29fd184091b1f8b4df4892fe44",
+ "chksum_sha256": "445358ff7ba521cc629303462ab71eccd79aa840b17b90b1c7f4d1dab82fffe7",
"format": 1
},
{
@@ -137,7 +137,7 @@
"name": "changelogs/changelog.yaml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "e941d53c423339dae173424865a5f4e2c892aa52818bebd6999d2444ff2188a3",
+ "chksum_sha256": "44809fb2e5dc28dd9948e07f4987e0785b1835f56d82129d2feabd0ac6acd699",
"format": 1
},
{
@@ -200,7 +200,7 @@
"name": "meta/runtime.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "24fe3900ecea43c7ba9092f959869454c77877400c6af713fb56f0c8465d564e",
+ "chksum_sha256": "dcc07fa47601566d57bf94bccf30fd3d495865324899761ce689e96f6b6ce6e9",
"format": 1
},
{
@@ -242,7 +242,7 @@
"name": "plugins/inventory/robot.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "9ebb90b3fa1ce6a294b1d56b7d943e86ada342b9e288bdd416bde2e39e9989db",
+ "chksum_sha256": "db25dddf103d07d71c2f20727b40d7ced1420056095573074a96ed969297e972",
"format": 1
},
{
@@ -683,7 +683,7 @@
"name": "tests/unit/plugins/inventory/test_robot.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "e77768bf19cc0b1743641419d4b0360b6725b8dbb4e79d2ecacfac69d0886db9",
+ "chksum_sha256": "9dd685da29afd94c09b74f057e78c98326c8b4931b5bbe4e86bc42e0a2e0c8f2",
"format": 1
},
{
@@ -823,7 +823,7 @@
"name": "CHANGELOG.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "ec9612359cac38411b264cb53d67607a383a08d1a2bffc3ff84cdb1d9ad1de4c",
+ "chksum_sha256": "86fd0f752604f3fa70164f00acf0ad9e5d1567c6499701e555eeeedd59c6fbc7",
"format": 1
},
{
@@ -837,7 +837,7 @@
"name": "CHANGELOG.rst",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "84b7a7e9f7b8280abe9151db53d4fc3235b37db19686030e8d8fd000513e41ad",
+ "chksum_sha256": "e8ca25b706ccb628b73cd623cc1720c34df09756bc716aa07827c161648207a1",
"format": 1
},
{
@@ -858,7 +858,7 @@
"name": "README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "df4f5e5e0c88eb6caf14a6b2d3916a5849ac18a2ee6c748d0276d1788d145911",
+ "chksum_sha256": "4a16caa53d97e1924daaabaf372ab085aba6fc95af3cca830d1eda04f22ae41d",
"format": 1
},
{
diff --git a/ansible_collections/community/hrobot/MANIFEST.json b/ansible_collections/community/hrobot/MANIFEST.json
index 1ac2e2da3..65cba09e0 100644
--- a/ansible_collections/community/hrobot/MANIFEST.json
+++ b/ansible_collections/community/hrobot/MANIFEST.json
@@ -2,7 +2,7 @@
"collection_info": {
"namespace": "community",
"name": "hrobot",
- "version": "1.9.2",
+ "version": "2.0.0",
"authors": [
"Felix Fontein (github.com/felixfontein)"
],
@@ -20,7 +20,9 @@
"BSD-2-Clause"
],
"license_file": null,
- "dependencies": {},
+ "dependencies": {
+ "community.library_inventory_filtering_v1": ">=1.0.0"
+ },
"repository": "https://github.com/ansible-collections/community.hrobot",
"documentation": "https://docs.ansible.com/ansible/devel/collections/community/hrobot/",
"homepage": "https://github.com/ansible-collections/community.hrobot",
@@ -30,7 +32,7 @@
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "a5c77f86ec2889eb57623d0ccd7ffbae9635537c46dc4539324e8da92b7ddf27",
+ "chksum_sha256": "47a01d4394191e0a36c408e3add9b1a0434bfcf4fd39a7d11ba1d7b4cd2f39b8",
"format": 1
},
"format": 1
diff --git a/ansible_collections/community/hrobot/README.md b/ansible_collections/community/hrobot/README.md
index bdc481de9..8ef8be19b 100644
--- a/ansible_collections/community/hrobot/README.md
+++ b/ansible_collections/community/hrobot/README.md
@@ -15,7 +15,7 @@ Please note that this collection does **not** support Windows targets.
## Tested with Ansible
-Tested with the current Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, and ansible-core 2.17 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported.
+Tested with the current ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, and ansible-core 2.17 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported.
## External requirements
diff --git a/ansible_collections/community/hrobot/changelogs/changelog.yaml b/ansible_collections/community/hrobot/changelogs/changelog.yaml
index eca36fc8f..1862813f3 100644
--- a/ansible_collections/community/hrobot/changelogs/changelog.yaml
+++ b/ansible_collections/community/hrobot/changelogs/changelog.yaml
@@ -290,3 +290,34 @@ releases:
- 1.9.2.yml
- 102-unsafe.yml
release_date: '2024-04-16'
+ 2.0.0:
+ changes:
+ breaking_changes:
+ - robot inventory plugin - ``filters`` is now no longer an alias of ``simple_filters``,
+ but a new, different option (https://github.com/ansible-collections/community.hrobot/pull/101).
+ major_changes:
+ - The ``community.hrobot`` collection now depends on the ``community.library_inventory_filtering_v1``
+ collection. This utility collection provides host filtering functionality
+ for inventory plugins. If you use the Ansible community package, both collections
+ are included and you do not have to do anything special. If you install the
+ collection with ``ansible-galaxy collection install``, it will be installed
+ automatically. If you install the collection by copying the files of the collection
+ to a place where ansible-core can find it, for example by cloning the git
+ repository, you need to make sure that you also have to install the dependency
+ if you are using the inventory plugin (https://github.com/ansible-collections/community.hrobot/pull/101).
+ minor_changes:
+ - robot inventory plugin - add ``filter`` option which allows to include and
+ exclude hosts based on Jinja2 conditions (https://github.com/ansible-collections/community.hrobot/pull/101).
+ release_summary: '...
+
+ '
+ removed_features:
+ - The collection no longer supports Ansible, ansible-base, and ansible-core
+ releases that are currently End of Life at the time of the 2.0.0 release.
+ This means that Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core
+ 2.12, ansible-core 2.13, and ansible-core 2.14 are no longer supported. The
+ collection might still work with these versions, but it can stop working at
+ any moment without advance notice, and this will not be considered a bug (https://github.com/ansible-collections/community.hrobot/pull/101).
+ fragments:
+ - 2.0.0.yml
+ release_date: '2024-05-11'
diff --git a/ansible_collections/community/hrobot/meta/runtime.yml b/ansible_collections/community/hrobot/meta/runtime.yml
index 7ea33e019..77e68505d 100644
--- a/ansible_collections/community/hrobot/meta/runtime.yml
+++ b/ansible_collections/community/hrobot/meta/runtime.yml
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
-requires_ansible: '>=2.9.10'
+requires_ansible: '>=2.14.0'
action_groups:
robot:
- boot
diff --git a/ansible_collections/community/hrobot/plugins/inventory/robot.py b/ansible_collections/community/hrobot/plugins/inventory/robot.py
index 409c90992..675be7f2c 100644
--- a/ansible_collections/community/hrobot/plugins/inventory/robot.py
+++ b/ansible_collections/community/hrobot/plugins/inventory/robot.py
@@ -25,6 +25,7 @@ DOCUMENTATION = r"""
- ansible.builtin.constructed
- ansible.builtin.inventory_cache
- community.hrobot.robot
+ - community.library_inventory_filtering_v1.inventory_filter
notes:
- The O(hetzner_user) and O(hetzner_password) options can be templated.
options:
@@ -43,12 +44,13 @@ DOCUMENTATION = r"""
- A dictionary of filter value pairs.
- Available filters are listed here are keys of server like C(status) or C(server_ip).
- See U(https://robot.your-server.de/doc/webservice/en.html#get-server) for all values that can be used.
- - This option has been renamed from O(filters) to O(simple_filters) in community.hrobot 1.9.0.
- The old name can still be used until community.hrobot 2.0.0.
+ - This option used to be called O(filters) before community.hrobot 2.0.0. It has been renamed from
+ O(filters) to O(simple_filters) in community.hrobotdns 1.9.0, and the old name was still available
+ as an alias until community.hrobot 2.0.0. O(filters) is now used for something else.
type: dict
default: {}
- aliases:
- - filters
+ filters:
+ version_added: 2.0.0
"""
EXAMPLES = r"""
@@ -58,12 +60,18 @@ plugin: community.hrobot.robot
filters:
status: ready
-# Example showing encrypted credentials
+# Example showing encrypted credentials and using filters
# (This assumes that Mozilla sops was used to encrypt keys/hetzner.sops.yaml, which contains two values
# hetzner_username and hetzner_password. Needs the community.sops collection to decode that file.)
plugin: community.hrobot.robot
hetzner_user: '{{ (lookup("community.sops.sops", "keys/hetzner.sops.yaml") | from_yaml).hetzner_username }}'
hetzner_password: '{{ (lookup("community.sops.sops", "keys/hetzner.sops.yaml") | from_yaml).hetzner_password }}'
+filters:
+ # Accept all servers in FSN1-DC1 and FSN1-DC2
+ - include: >-
+ hrobot_dc in ["FSN1-DC1", "FSN1-DC2"]
+ # Exclude all servers that didn't match any of the above filters
+ - exclude: true
# Example using constructed features to create groups
plugin: community.hrobot.robot
@@ -86,6 +94,8 @@ from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cachea
from ansible.template import Templar
from ansible.utils.display import Display
+from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
+
from ansible_collections.community.hrobot.plugins.module_utils.robot import (
BASE_URL,
PluginException,
@@ -114,18 +124,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
def parse(self, inventory, loader, path, cache=True):
super(InventoryModule, self).parse(inventory, loader, path)
servers = {}
- orig_config = self._read_config_data(path)
+ self._read_config_data(path)
self.load_cache_plugin()
cache_key = self.get_cache_key(path)
- if 'filters' in orig_config:
- display.deprecated(
- 'The `filters` option of the community.hrobot.robot inventory plugin has been renamed to `simple_filters`. '
- 'The old name will stop working in community.hrobot 2.0.0.',
- collection_name='community.hrobot',
- version='2.0.0',
- )
-
self.templar = Templar(loader=loader)
# cache may be True or False at this point to indicate if the inventory is being refreshed
@@ -156,16 +158,26 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self.populate(servers)
def populate(self, servers):
- filters = self.get_option('simple_filters')
+ simple_filters = self.get_option('simple_filters')
+ filters = parse_filters(self.get_option('filters'))
strict = self.get_option('strict')
server_lists = []
for server in servers:
s = server['server']
server_name = s.get('server_name') or s.get('server_ip') or str(s['server_number'])
- matched = self.filter(s, filters)
+ matched = self.filter(s, simple_filters)
if not matched:
continue
+ facts = {}
+ if 'server_ip' in s:
+ facts['ansible_host'] = make_unsafe(s['server_ip'])
+ for hostvar, hostval in s.items():
+ facts["{0}_{1}".format('hrobot', hostvar)] = make_unsafe(hostval)
+
+ if not filter_host(self, server_name, facts, filters):
+ continue
+
if server_name in server_lists:
display.warning('Two of your Hetzner servers use the same server name ({0}). '
'Please make sure that your server names are unique. '
@@ -174,10 +186,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self.inventory.add_host(server_name)
server_lists.append(server_name)
- if 'server_ip' in s:
- self.inventory.set_variable(server_name, 'ansible_host', make_unsafe(s['server_ip']))
- for hostvar, hostval in s.items():
- self.inventory.set_variable(server_name, "{0}_{1}".format('hrobot', hostvar), make_unsafe(hostval))
+ for key, value in facts.items():
+ self.inventory.set_variable(server_name, key, value)
# Composed variables
server_vars = self.inventory.get_host(server_name).get_vars()
@@ -189,9 +199,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
# Create groups based on variable values and add the corresponding hosts to it
self._add_host_to_keyed_groups(self.get_option('keyed_groups'), server, server_name, strict=strict)
- def filter(self, server, filters):
+ def filter(self, server, simple_filters):
matched = True
- for key, value in filters.items():
+ for key, value in simple_filters.items():
if server.get(key) != value:
matched = False
break
diff --git a/ansible_collections/community/hrobot/tests/unit/plugins/inventory/test_robot.py b/ansible_collections/community/hrobot/tests/unit/plugins/inventory/test_robot.py
index c10524f7e..eb8c52a8f 100644
--- a/ansible_collections/community/hrobot/tests/unit/plugins/inventory/test_robot.py
+++ b/ansible_collections/community/hrobot/tests/unit/plugins/inventory/test_robot.py
@@ -63,6 +63,8 @@ def inventory():
def get_option(option):
if option == 'simple_filters':
return {}
+ if option == 'filters':
+ return []
if option == 'hetzner_user':
return 'test'
if option == 'hetzner_password':