Commit Graph

40 Commits

Author SHA1 Message Date
Felix Fontein
dbc7b0ec18
Cleanup with ruff check (#1182)
* Implement improvements suggested by ruff check.

* Add ruff check to CI.
2025-10-28 06:58:15 +01:00
Felix Fontein
6ad4bfcd40
Add typing information, 2/n (#1178)
* Add typing to Docker Stack modules. Clean modules up.

* Add typing to Docker Swarm modules.

* Add typing to unit tests.

* Add more typing.

* Add ignore.txt entries.
2025-10-25 01:16:04 +02:00
Felix Fontein
3ff2cfe615
Drop support for docker-py. (#1171) 2025-10-15 21:55:07 +02:00
Felix Fontein
c75aa5dd64
Python code modernization, 5/n (#1165)
* Address raise-missing-from.

* Address simplifiable-if-expression.

* Address unnecessary-dunder-call.

* Address unnecessary-pass.

* Address use-list-literal.

* Address unused-variable.

* Address use-dict-literal.
2025-10-12 16:02:27 +02:00
Felix Fontein
cad22de628
Python code modernization, 4/n (#1162)
* Address attribute-defined-outside-init.

* Address broad-exception-raised.

* Address broad-exception-caught.

* Address consider-iterating-dictionary.

* Address consider-using-dict-comprehension.

* Address consider-using-f-string.

* Address consider-using-in.

* Address consider-using-max-builtin.

* Address some consider-using-with.

* Address invalid-name.

* Address keyword-arg-before-vararg.

* Address line-too-long.

* Address no-else-continue.

* Address no-else-raise.

* Address no-else-return.

* Remove broken dead code.

* Make consider-using-f-string changes compatible with older Python versions.

* Python 3.11 and earlier apparently do not like multi-line f-strings.
2025-10-11 23:06:50 +02:00
Felix Fontein
e8ec22d3b1
Python code modernization, 3/n (#1157)
* Remove __metaclass__ = type.

for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
  sed -e '/^__metaclass__ = type/d' -i $i;
done

* Remove super arguments, and stop inheriting from object.
2025-10-10 08:11:58 +02:00
Felix Fontein
a3efa26e2e
Address some pylint issues (#1155)
* Address cyclic-import.

* Address redefined-builtin.

* Address redefined-argument-from-local.

* Address many redefined-outer-name.

* Address pointless-string-statement.

* No longer needed due to separate bugfix.

* Address useless-return.

* Address possibly-used-before-assignment.

* Add TODOs.

* Address super-init-not-called.

* Address function-redefined.

* Address unspecified-encoding.

* Clean up more imports.
2025-10-09 20:11:36 +02:00
Felix Fontein
117271579e
Make all doc fragments, module utils, and plugin utils private (#1144)
* Make all doc fragments, module utils, and plugin utils private.

* Remove some unused and no longer needed imports.

This hopefully also fixes the CI issues, which do not happen locally for me...

* Fix formatting.

* Try to make CI happy, again.

* Fix imports.

* Lint.
2025-10-07 07:32:33 +02:00
Felix Fontein
d65d37e9e9 Reformat code with black and isort. 2025-10-06 18:34:59 +02:00
Felix Fontein
f45232635c
Python code modernization, 1/n (#1141)
* Remove unicode text prefixes.

* Replace str.format() uses with f-strings.

* Replace % with f-strings, and do some cleanup.

* Fix wrong variable.

* Avoid unnecessary string conversion.
2025-10-06 18:30:54 +02:00
Felix Fontein
1f2817fa20
Prepare 5.0.0 (#1123)
* Bump version to 5.0.0-a1.

* Drop support for ansible-core 2.15 and 2.16.

* Remove Python 2 and early Python 3 compatibility.
2025-10-05 20:22:50 +02:00
Felix Fontein
2487d1a0bf Fix linting errors. 2025-04-26 12:39:00 +02:00
Felix Fontein
5bfec5d4d2
Add 'idempotent' attribute (#1022)
* Add 'idempotent' attribute.

* Mention check mode in attribute description.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-12-30 21:11:14 +01:00
Felix Fontein
769d15de63
Reformat documentation with 'andebox yaml-doc' (#1020)
* Reformat documentation with 'andebox yaml-doc'.

* Revert unwanted changes.

* Fix too long lines.

* Fix broken quotes.

* Forgot two line breaks.
2024-12-28 16:40:50 +01:00
Felix Fontein
f69536ef3b Improve language. 2024-12-28 14:30:49 +01:00
Felix Fontein
1e10834905
Sanitize labels. (#985) 2024-11-09 23:53:22 +01:00
Felix Fontein
1c66f880ee
Fix typos, improve markup, improve scenario guide (#699)
* Fix typos.

* Improve markup.

* Mention missing 'new' modules in scenario guide.
2023-10-29 08:30:24 +01:00
Felix Fontein
fbc2750b6a
Do not pass data_path_addr for older Docker SDK for Python versions. (#696) 2023-10-14 23:48:46 +02:00
Felix Fontein
024bdec919
Use semantic markup (#645)
* Use semantic markup.

* Linting.

* Define docsite targets.

* Forgot one env var.

* Add array stubs.
2023-06-22 07:01:31 +02:00
Felix Fontein
6187068ee5
Improve time units of docker_swarm documentation. (#623) 2023-05-13 15:25:42 +00:00
Ville Ojamo
634da44f67
docker_swarm: document docker_node module for manager removal (#602)
* docker_swarm: document manager removal

Add note that community.docker.swarm_node needs to
be used to demote a manager before it can be removed.

Fixes #601.

* docker_swarm: improve wording

* docker_swarm: fix formatting
2023-04-08 18:09:57 +02:00
Felix Fontein
2261dff49f
Document attributes (#497)
* Add 'docker' action group attribute.

* Compatibility with older ansible-core releases.

* Fix typo.

* Docment standard attributes.

* Improve docs.

* Add shortcuts for common combinations.
2022-11-06 21:15:09 +01:00
Max
c9ea1d3f92
docker_swarm: add data_path_port option for swarm init (#466)
* Add data_path_port option for swarm init and swarm join

* Add changelog fragment

* Update changelogs/fragments/466-add-data-path-port.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/docker_swarm.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* add change for docker sdk, remove reference to swarm join

* remove duplicate entry

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-03 11:20:02 +02:00
Felix Fontein
be58ccc13f
Normalize booleans in all other plugins and modules. (#440) 2022-08-10 21:25:10 +02:00
Felix Fontein
bc6757d3b8
Fix docs. (#436) 2022-08-04 14:23:52 +02:00
Felix Fontein
a4539a309e
Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml (#430)
* Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml.

* ignore.txt lines cannot be empty or contain only a comment.

* Cleanup.

* This particular __init__.py seems to be crucial.

* Try extra newline.

* Markdown comments are a real mess. I hope this won't break Galaxy...

* More licenses.

* Add sanity test.

* Skip some files, lint.

* Make sure there is a copyright line everywhere.

* Also check for copyright line in sanity tests.

* Remove colon after 'Copyright'.

* Normalize lint script.

* Avoid colon after 'Copyright' in lint script.

* Improve license checker.

* Update README.md

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>

* Remove superfluous space.

* Referencing target instead of symlink

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>
2022-07-20 07:45:33 +02:00
Felix Fontein
623786c659
Implement all remaining deprecations for 3.0.0 (#400)
* Remove support for Ansible 2.9 and ansible-base 2.10.

* Remove Ansible 2.9 compatiblity code.

* Remove docker-compose from EE.

* Drop support for Python 2.6. Stop advertising docker-py for Python 2.6.

* Drop support for API versions 1.20 to 1.24.

* Fix condition.
2022-07-02 17:13:53 +02:00
Felix Fontein
f41d7ac1b8
Move common utility code to plugins.module_utils.util (#390)
* Move common utility code to plugins.module_utils.util.

* Also adjust plugins.

* Fix import.
2022-06-20 18:39:13 +02:00
chrische
98b227003e
docker_swarm: adds data_path_addr option for swarm init and swarm join (#344)
* adds data_path_addr option for swarm init and swarm join. (ansible-collections/community.docker#339)

* adds changelog fragment (ansible-collections/community.docker#339)

* adds formatting to changelog entry

Co-authored-by: Felix Fontein <felix@fontein.de>

* adds version to doc entry in ansible_swarm

Co-authored-by: Felix Fontein <felix@fontein.de>

* rewrites doc entry to formal language

Co-authored-by: Felix Fontein <felix@fontein.de>

* Correct docker api version (src: docker api docs)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-09 20:37:27 +02:00
Felix Fontein
badcd61a74
Replace ansible.module_utils._text by ansible.module_utils.common.text.converters. (#164) 2021-06-26 13:39:51 +02:00
Felix Fontein
a3b9648233
Improve exception handling. (#121) 2021-04-08 08:00:01 +02:00
Felix Fontein
b42b76fc45
[security] docker_swarm: mark join_token as no_log (#103)
* Mark join_token as no_log.

* Apply suggestions from code review

Co-authored-by: Piotr Wojciechowski <23406016+WojciechowskiPiotr@users.noreply.github.com>

Co-authored-by: Piotr Wojciechowski <23406016+WojciechowskiPiotr@users.noreply.github.com>
2021-03-12 22:31:39 +01:00
David Moreau Simard
58babf738b
docker swarm - Add no_log to the signing_ca_key argument (#80)
* docker swarm - Add no_log to the signing_ca_key argument

This will prevent accidental disclosure.

See: CVE-2021-20191

* Update changelogs/fragments/CVE-2021-20191_no_log.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-04 21:03:43 +01:00
Felix Fontein
5dba331bc7 Adjust deprecations (#1)
* First batch of c.g 2.0.0 deprecations.

* Remove use_tls and force from docker_image.

* More removals.

* Change community.general 3.0.0 deprecations to community.docker 2.0.0.

* Fix sanity.

* Fixing some bugs.

* Add PR URL to fragment.

ci_complete
ci_coverage

* Improve docs, remove superfluous code.
2020-10-30 07:05:51 +01:00
Minh Ha
19f35bae91 removes advertise_addr from required parameters when state is "join" (#646)
* removes advertise_addr from required parameters when state is "join"

addressing this issue: https://github.com/ansible-collections/community.general/issues/439

* adjusts test

* adds changelog
2020-10-30 07:05:51 +01:00
Andrew Klychkov
564dd62c80 modules: fix examples to use FQCN (#644)
* modules: fix examples to use FQCN

* fix

* fix

* fix
2020-10-30 07:05:51 +01:00
Felix Fontein
baf78aca3a Fix M(). (#591)
* Fix M().

* Break long line.

* Fix the remaining M(...).

* Break long line.
2020-10-30 07:05:51 +01:00
Felix Fontein
87230c1c2f Clean up deprecations (#504)
* Adjust deprecation versions.

* Remove redirects that are already made in ansible/ansible's ansible_builtin_runtime.yml

* Remove modules that were moved to the google.cloud collection according to ansible/ansible's ansible_builtin_runtime.yml.

* The _info module is in google.cloud.

* The gcp doc_fragment is a copy of the one in google.cloud and is only used by one lookup. Mark as deprecated/internal.

* Remove entries of modules that no longer exist.

* Update ignore.txt.

* Try to fix test.

* Remove debug output.
2020-10-30 07:05:51 +01:00
Andrew Klychkov
6a179835ed Remove ANSIBLE_METADATA (#339)
* Remove ANSIBLE_METADATA

* remove from other modules

* remove from plugins and scripts
2020-10-30 07:05:51 +01:00
Ansible Core Team
a1f472244d Initial commit 2020-10-30 07:05:50 +01:00