Commit 36c628b
authored
fix(plugins): replace ansible.utils.ipaddr with stdlib-based test plugin (#24)
* fix(plugins): replace ansible.utils.ipaddr with stdlib-based test plugin
The role used ansible.utils.ipaddr to validate master node IPs, which
requires the netaddr Python package. netaddr is not installed by
ansible-galaxy collection install and was not documented as a prerequisite,
causing runtime failures for users who followed the README.
Replace the single ipaddr usage with a new test plugin that uses the
Python standard library ipaddress module. The plugin has no external
dependencies and supports both IPv4 and IPv6.
- Add plugins/test/ip_address.py with is_ip_address test
- Use cozystack.installer.is_ip_address in compute-master-nodes.yml
- Drop ansible.utils collection dependency (galaxy.yml, requirements.yml)
- Drop netaddr pip install and ansible.utils install from CI
- Add IPv6 inventory fixture and CI step to verify IPv6 acceptance
Closes #18
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* test(plugins): address review feedback — add unit tests, changelog, IPv6 fix
- Replace fe80::1 with 2001:db8::12 in IPv6 test inventory:
link-local addresses without scope ID are not realistic cluster
IPs and make the test misleading.
- Add unit tests for plugins/test/ip_address.py with ansible-test
units coverage for IPv4, IPv6, hostnames, malformed strings, and
None input.
- Add CI step to run ansible-test units.
- Add version_added to plugin DOCUMENTATION.
- Document the dependency drop and new test in CHANGELOG.rst.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* fix(plugins): enforce string type and bump collection version
- is_ip_address now rejects non-string inputs. ipaddress.ip_address()
silently accepts int/bool (treating them as 32-bit address values),
violating the documented type: str contract.
- Bump collection version to 1.2.3 to match CHANGELOG entry and
plugin version_added so ansible-test sanity passes.
- Unit tests cover int, bool, bytes, and list rejection.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* docs: bump example requirements to v1.2.3 and backfill CHANGELOG
- Update examples/*/requirements.yml from 1.2.2 to v1.2.3. Also
adopts the v prefix — git tags are v-prefixed and installs via
type: git fail without it.
- Fill in missing CHANGELOG entries for v1.1.3, v1.2.1 and v1.2.2
so the v1.2.3 entry does not appear to jump from v1.1.2.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* fix: unit test package init files and README chart version
- Add empty __init__.py to tests/unit/, tests/unit/plugins/ and
tests/unit/plugins/test/. ansible-test units (ansible-core >= 2.15)
requires these for pytest to resolve the FQCN import of the plugin
module, otherwise the new Run unit tests CI step would fail with a
collection import error.
- Fix stale cozystack_chart_version default in README (1.1.2 to 1.2.2).
The actual default in roles/cozystack/defaults/main.yml is 1.2.2.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* test(plugins): document CIDR rejection behavior
ipaddress.ip_address() rejects CIDR notation since CIDR represents
a network rather than a single address. Add explicit test cases to
document this for both IPv4 and IPv6 CIDR inputs.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* docs(changelog): fix RST title underline length
The title 'cozystack.installer Release Notes' is 33 characters, but
the overline and underline were only 28. RST requires them to be at
least as long as the title, so tooling that parses the file strictly
would reject it.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* ci(sanity): install pytest for ansible-test units
ansible-test units runs pytest against the controller interpreter and
expects pytest (plus the -n auto helpers pytest-xdist/pytest-forked
and the commonly-used pytest-mock) to be importable there. Without
these the job fails with 'No module named pytest' before any test
runs.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
---------
Signed-off-by: Aleksei Sviridkin <f@lex.la>1 parent 07f63dd commit 36c628b
15 files changed
Lines changed: 211 additions & 18 deletions
File tree
- .github/workflows
- examples
- rhel
- suse
- ubuntu
- plugins/test
- roles/cozystack/tasks
- tests
- unit
- plugins
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
80 | | - | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | | - | |
83 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
| |||
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
133 | | - | |
134 | | - | |
| 144 | + | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
4 | 37 | | |
5 | 38 | | |
6 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments