mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-30 02:16:50 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48c50fa335 | ||
|
|
a1e2ada993 | ||
|
|
d7eb5432f3 | ||
|
|
26f19db2f8 | ||
|
|
8bc0c103ad | ||
|
|
0e495aae75 | ||
|
|
840b1b82ac | ||
|
|
2b08a308bc | ||
|
|
04305e8d9d | ||
|
|
15109a26fd | ||
|
|
d1730adce0 | ||
|
|
69d7cce55c | ||
|
|
d80aca951c | ||
|
|
6f5462fb27 | ||
|
|
1c5c622ae8 |
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
2
.github/workflows/nox.yml
vendored
2
.github/workflows/nox.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
name: "Run extra sanity tests"
|
||||
steps:
|
||||
- name: Check out collection
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run nox
|
||||
|
||||
62
CHANGELOG.md
62
CHANGELOG.md
@@ -2,37 +2,40 @@
|
||||
|
||||
**Topics**
|
||||
|
||||
- <a href="#v11-2-0">v11\.2\.0</a>
|
||||
- <a href="#v11-2-1">v11\.2\.1</a>
|
||||
- <a href="#release-summary">Release Summary</a>
|
||||
- <a href="#bugfixes">Bugfixes</a>
|
||||
- <a href="#v11-2-0">v11\.2\.0</a>
|
||||
- <a href="#release-summary-1">Release Summary</a>
|
||||
- <a href="#minor-changes">Minor Changes</a>
|
||||
- <a href="#deprecated-features">Deprecated Features</a>
|
||||
- <a href="#bugfixes">Bugfixes</a>
|
||||
- <a href="#bugfixes-1">Bugfixes</a>
|
||||
- <a href="#new-plugins">New Plugins</a>
|
||||
- <a href="#lookup">Lookup</a>
|
||||
- <a href="#new-modules">New Modules</a>
|
||||
- <a href="#v11-1-2">v11\.1\.2</a>
|
||||
- <a href="#release-summary-1">Release Summary</a>
|
||||
- <a href="#minor-changes-1">Minor Changes</a>
|
||||
- <a href="#bugfixes-1">Bugfixes</a>
|
||||
- <a href="#v11-1-1">v11\.1\.1</a>
|
||||
- <a href="#release-summary-2">Release Summary</a>
|
||||
- <a href="#minor-changes-2">Minor Changes</a>
|
||||
- <a href="#minor-changes-1">Minor Changes</a>
|
||||
- <a href="#bugfixes-2">Bugfixes</a>
|
||||
- <a href="#v11-1-0">v11\.1\.0</a>
|
||||
- <a href="#v11-1-1">v11\.1\.1</a>
|
||||
- <a href="#release-summary-3">Release Summary</a>
|
||||
- <a href="#minor-changes-2">Minor Changes</a>
|
||||
- <a href="#bugfixes-3">Bugfixes</a>
|
||||
- <a href="#v11-1-0">v11\.1\.0</a>
|
||||
- <a href="#release-summary-4">Release Summary</a>
|
||||
- <a href="#minor-changes-3">Minor Changes</a>
|
||||
- <a href="#deprecated-features-1">Deprecated Features</a>
|
||||
- <a href="#bugfixes-3">Bugfixes</a>
|
||||
- <a href="#bugfixes-4">Bugfixes</a>
|
||||
- <a href="#new-plugins-1">New Plugins</a>
|
||||
- <a href="#callback">Callback</a>
|
||||
- <a href="#new-modules-1">New Modules</a>
|
||||
- <a href="#v11-0-0">v11\.0\.0</a>
|
||||
- <a href="#release-summary-4">Release Summary</a>
|
||||
- <a href="#release-summary-5">Release Summary</a>
|
||||
- <a href="#minor-changes-4">Minor Changes</a>
|
||||
- <a href="#deprecated-features-2">Deprecated Features</a>
|
||||
- <a href="#removed-features-previously-deprecated">Removed Features \(previously deprecated\)</a>
|
||||
- <a href="#security-fixes">Security Fixes</a>
|
||||
- <a href="#bugfixes-4">Bugfixes</a>
|
||||
- <a href="#bugfixes-5">Bugfixes</a>
|
||||
- <a href="#known-issues">Known Issues</a>
|
||||
- <a href="#new-plugins-2">New Plugins</a>
|
||||
- <a href="#callback-1">Callback</a>
|
||||
@@ -43,10 +46,27 @@
|
||||
- <a href="#new-modules-2">New Modules</a>
|
||||
This changelog describes changes after version 10\.0\.0\.
|
||||
|
||||
<a id="v11-2-1"></a>
|
||||
## v11\.2\.1
|
||||
|
||||
<a id="release-summary"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release\.
|
||||
|
||||
<a id="bugfixes"></a>
|
||||
### Bugfixes
|
||||
|
||||
* Avoid deprecated functionality in ansible\-core 2\.20 \([https\://github\.com/ansible\-collections/community\.general/pull/10687](https\://github\.com/ansible\-collections/community\.general/pull/10687)\)\.
|
||||
* apache2\_module \- check the <code>cgi</code> module restrictions only during activation \([https\://github\.com/ansible\-collections/community\.general/pull/10423](https\://github\.com/ansible\-collections/community\.general/pull/10423)\)\.
|
||||
* composer \- fix broken command lines \([https\://github\.com/ansible\-collections/community\.general/issues/10662](https\://github\.com/ansible\-collections/community\.general/issues/10662)\, [https\://github\.com/ansible\-collections/community\.general/pull/10669](https\://github\.com/ansible\-collections/community\.general/pull/10669)\)\.
|
||||
* pacemaker\_resource \- fix <code>resource\_type</code> parameter formatting \([https\://github\.com/ansible\-collections/community\.general/issues/10426](https\://github\.com/ansible\-collections/community\.general/issues/10426)\, [https\://github\.com/ansible\-collections/community\.general/pull/10663](https\://github\.com/ansible\-collections/community\.general/pull/10663)\)\.
|
||||
* pids \- prevent error when an empty string is provided for <code>name</code> \([https\://github\.com/ansible\-collections/community\.general/issues/10672](https\://github\.com/ansible\-collections/community\.general/issues/10672)\, [https\://github\.com/ansible\-collections/community\.general/pull/10688](https\://github\.com/ansible\-collections/community\.general/pull/10688)\)\.
|
||||
|
||||
<a id="v11-2-0"></a>
|
||||
## v11\.2\.0
|
||||
|
||||
<a id="release-summary"></a>
|
||||
<a id="release-summary-1"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix and features release\.
|
||||
@@ -89,7 +109,7 @@ Regular bugfix and features release\.
|
||||
* github\_repo \- deprecate <code>force\_defaults\=true</code> \([https\://github\.com/ansible\-collections/community\.general/pull/10435](https\://github\.com/ansible\-collections/community\.general/pull/10435)\)\.
|
||||
* rocketchat \- the default value for <code>is\_pre740</code>\, currently <code>true</code>\, is deprecated and will change to <code>false</code> in community\.general 13\.0\.0 \([https\://github\.com/ansible\-collections/community\.general/pull/10490](https\://github\.com/ansible\-collections/community\.general/pull/10490)\)\.
|
||||
|
||||
<a id="bugfixes"></a>
|
||||
<a id="bugfixes-1"></a>
|
||||
### Bugfixes
|
||||
|
||||
* jenkins\_plugin \- install latest compatible version instead of latest \([https\://github\.com/ansible\-collections/community\.general/issues/854](https\://github\.com/ansible\-collections/community\.general/issues/854)\, [https\://github\.com/ansible\-collections/community\.general/pull/10346](https\://github\.com/ansible\-collections/community\.general/pull/10346)\)\.
|
||||
@@ -113,7 +133,7 @@ Regular bugfix and features release\.
|
||||
<a id="v11-1-2"></a>
|
||||
## v11\.1\.2
|
||||
|
||||
<a id="release-summary-1"></a>
|
||||
<a id="release-summary-2"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release\.
|
||||
@@ -252,7 +272,7 @@ Bugfix release\.
|
||||
* zypper \- remove redundant constructs from argument specs \([https\://github\.com/ansible\-collections/community\.general/pull/10513](https\://github\.com/ansible\-collections/community\.general/pull/10513)\)\.
|
||||
* zypper\_repository \- remove redundant constructs from argument specs \([https\://github\.com/ansible\-collections/community\.general/pull/10513](https\://github\.com/ansible\-collections/community\.general/pull/10513)\)\.
|
||||
|
||||
<a id="bugfixes-1"></a>
|
||||
<a id="bugfixes-2"></a>
|
||||
### Bugfixes
|
||||
|
||||
* apk \- fix check for empty/whitespace\-only package names \([https\://github\.com/ansible\-collections/community\.general/pull/10532](https\://github\.com/ansible\-collections/community\.general/pull/10532)\)\.
|
||||
@@ -266,7 +286,7 @@ Bugfix release\.
|
||||
<a id="v11-1-1"></a>
|
||||
## v11\.1\.1
|
||||
|
||||
<a id="release-summary-2"></a>
|
||||
<a id="release-summary-3"></a>
|
||||
### Release Summary
|
||||
|
||||
Bugfix release for the next Ansible 12 pre\-release\.
|
||||
@@ -302,7 +322,7 @@ Bugfix release for the next Ansible 12 pre\-release\.
|
||||
* filesystem \- remove redundant constructs from argument specs \([https\://github\.com/ansible\-collections/community\.general/pull/10494](https\://github\.com/ansible\-collections/community\.general/pull/10494)\)\.
|
||||
* sysrc \- adjustments to the code \([https\://github\.com/ansible\-collections/community\.general/pull/10417](https\://github\.com/ansible\-collections/community\.general/pull/10417)\)\.
|
||||
|
||||
<a id="bugfixes-2"></a>
|
||||
<a id="bugfixes-3"></a>
|
||||
### Bugfixes
|
||||
|
||||
* apache2\_module \- avoid ansible\-core 2\.19 deprecation \([https\://github\.com/ansible\-collections/community\.general/pull/10459](https\://github\.com/ansible\-collections/community\.general/pull/10459)\)\.
|
||||
@@ -320,7 +340,7 @@ Bugfix release for the next Ansible 12 pre\-release\.
|
||||
<a id="v11-1-0"></a>
|
||||
## v11\.1\.0
|
||||
|
||||
<a id="release-summary-3"></a>
|
||||
<a id="release-summary-4"></a>
|
||||
### Release Summary
|
||||
|
||||
Regular bugfix and feature release\.
|
||||
@@ -380,7 +400,7 @@ Regular bugfix and feature release\.
|
||||
* catapult \- module is deprecated and will be removed in community\.general 13\.0\.0 \([https\://github\.com/ansible\-collections/community\.general/issues/10318](https\://github\.com/ansible\-collections/community\.general/issues/10318)\, [https\://github\.com/ansible\-collections/community\.general/pull/10329](https\://github\.com/ansible\-collections/community\.general/pull/10329)\)\.
|
||||
* pacemaker\_cluster \- the parameter <code>state</code> will become a required parameter in community\.general 12\.0\.0 \([https\://github\.com/ansible\-collections/community\.general/pull/10227](https\://github\.com/ansible\-collections/community\.general/pull/10227)\)\.
|
||||
|
||||
<a id="bugfixes-3"></a>
|
||||
<a id="bugfixes-4"></a>
|
||||
### Bugfixes
|
||||
|
||||
* dependent lookup plugin \- avoid deprecated ansible\-core 2\.19 functionality \([https\://github\.com/ansible\-collections/community\.general/pull/10359](https\://github\.com/ansible\-collections/community\.general/pull/10359)\)\.
|
||||
@@ -406,7 +426,7 @@ Regular bugfix and feature release\.
|
||||
<a id="v11-0-0"></a>
|
||||
## v11\.0\.0
|
||||
|
||||
<a id="release-summary-4"></a>
|
||||
<a id="release-summary-5"></a>
|
||||
### Release Summary
|
||||
|
||||
This is release 11\.0\.0 of <code>community\.general</code>\, released on 2025\-06\-16\.
|
||||
@@ -805,7 +825,7 @@ This is release 11\.0\.0 of <code>community\.general</code>\, released on 2025\-
|
||||
* keycloak\_authentication \- API calls did not properly set the <code>priority</code> during update resulting in incorrectly sorted authentication flows\. This apparently only affects Keycloak 25 or newer \([https\://github\.com/ansible\-collections/community\.general/pull/9263](https\://github\.com/ansible\-collections/community\.general/pull/9263)\)\.
|
||||
* keycloak\_client \- Sanitize <code>saml\.encryption\.private\.key</code> so it does not show in the logs \([https\://github\.com/ansible\-collections/community\.general/pull/9621](https\://github\.com/ansible\-collections/community\.general/pull/9621)\)\.
|
||||
|
||||
<a id="bugfixes-4"></a>
|
||||
<a id="bugfixes-5"></a>
|
||||
### Bugfixes
|
||||
|
||||
* apache2\_mod\_proxy \- make compatible with Python 3 \([https\://github\.com/ansible\-collections/community\.general/pull/9762](https\://github\.com/ansible\-collections/community\.general/pull/9762)\)\.
|
||||
|
||||
@@ -6,6 +6,23 @@ Community General Release Notes
|
||||
|
||||
This changelog describes changes after version 10.0.0.
|
||||
|
||||
v11.2.1
|
||||
=======
|
||||
|
||||
Release Summary
|
||||
---------------
|
||||
|
||||
Bugfix release.
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Avoid deprecated functionality in ansible-core 2.20 (https://github.com/ansible-collections/community.general/pull/10687).
|
||||
- apache2_module - check the ``cgi`` module restrictions only during activation (https://github.com/ansible-collections/community.general/pull/10423).
|
||||
- composer - fix broken command lines (https://github.com/ansible-collections/community.general/issues/10662, https://github.com/ansible-collections/community.general/pull/10669).
|
||||
- pacemaker_resource - fix ``resource_type`` parameter formatting (https://github.com/ansible-collections/community.general/issues/10426, https://github.com/ansible-collections/community.general/pull/10663).
|
||||
- pids - prevent error when an empty string is provided for ``name`` (https://github.com/ansible-collections/community.general/issues/10672, https://github.com/ansible-collections/community.general/pull/10688).
|
||||
|
||||
v11.2.0
|
||||
=======
|
||||
|
||||
|
||||
@@ -1577,3 +1577,24 @@ releases:
|
||||
name: binary_file
|
||||
namespace: null
|
||||
release_date: '2025-08-11'
|
||||
11.2.1:
|
||||
changes:
|
||||
bugfixes:
|
||||
- Avoid deprecated functionality in ansible-core 2.20 (https://github.com/ansible-collections/community.general/pull/10687).
|
||||
- apache2_module - check the ``cgi`` module restrictions only during activation
|
||||
(https://github.com/ansible-collections/community.general/pull/10423).
|
||||
- composer - fix broken command lines (https://github.com/ansible-collections/community.general/issues/10662,
|
||||
https://github.com/ansible-collections/community.general/pull/10669).
|
||||
- pacemaker_resource - fix ``resource_type`` parameter formatting (https://github.com/ansible-collections/community.general/issues/10426,
|
||||
https://github.com/ansible-collections/community.general/pull/10663).
|
||||
- pids - prevent error when an empty string is provided for ``name`` (https://github.com/ansible-collections/community.general/issues/10672,
|
||||
https://github.com/ansible-collections/community.general/pull/10688).
|
||||
release_summary: Bugfix release.
|
||||
fragments:
|
||||
- 10423-apache_module-condition.yml
|
||||
- 10663-pacemaker-resource-fix-resource-type.yml
|
||||
- 10680-composer.yml
|
||||
- 10687-deprecations.yml
|
||||
- 10688-pids.yml
|
||||
- 11.2.1.yml
|
||||
release_date: '2025-08-18'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace: community
|
||||
name: general
|
||||
version: 11.2.0
|
||||
version: 11.2.1
|
||||
readme: README.md
|
||||
authors:
|
||||
- Ansible (https://github.com/ansible)
|
||||
|
||||
@@ -94,7 +94,7 @@ EXAMPLES = r"""
|
||||
from re import compile as re_compile
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
|
||||
ansi_color_codes = re_compile(to_bytes(r'\x1B\[[0-9;]+m'))
|
||||
|
||||
@@ -80,7 +80,7 @@ EXAMPLES = r"""
|
||||
from re import compile as re_compile
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
ansi_color_codes = re_compile(to_bytes(r"\x1B\[[0-9;]+m"))
|
||||
|
||||
|
||||
2
plugins/cache/memcached.py
vendored
2
plugins/cache/memcached.py
vendored
@@ -54,7 +54,7 @@ from multiprocessing import Lock
|
||||
from itertools import chain
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.common._collections_compat import MutableSet
|
||||
from collections.abc import MutableSet
|
||||
from ansible.plugins.cache import BaseCacheModule
|
||||
from ansible.utils.display import Display
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ except ImportError:
|
||||
pass
|
||||
|
||||
from ansible.module_utils.six import binary_type, text_type
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping, MutableSequence
|
||||
from collections.abc import MutableMapping, MutableSequence
|
||||
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
|
||||
from ansible.utils.color import colorize, hostcolor
|
||||
from ansible.utils.display import Display
|
||||
|
||||
@@ -34,7 +34,7 @@ import json
|
||||
|
||||
from ansible.utils.path import makedirs_safe
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
from collections.abc import MutableMapping
|
||||
from ansible.parsing.ajson import AnsibleJSONEncoder
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ from subprocess import call, Popen, PIPE
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound
|
||||
from ansible.module_utils.common.process import get_bin_path
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
from ansible.plugins.connection import ConnectionBase
|
||||
|
||||
|
||||
|
||||
@@ -80,5 +80,6 @@ options: {}
|
||||
notes:
|
||||
- This module uses JSON-RPC over HTTP(S) to communicate with the FreeIPA server.
|
||||
If you need to enroll the managed node into FreeIPA realm, you might want to consider using the collection
|
||||
L(freeipa.ansible_freeipa, https://galaxy.ansible.com/ui/repo/published/freeipa/ansible_freeipa/), but that will require shell access to the managed node.
|
||||
L(freeipa.ansible_freeipa, https://galaxy.ansible.com/ui/repo/published/freeipa/ansible_freeipa/), but shell access to one
|
||||
node from the realm is required to manage the deployment.
|
||||
"""
|
||||
|
||||
@@ -36,7 +36,7 @@ _value:
|
||||
"""
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.common._collections_compat import Sequence
|
||||
from collections.abc import Sequence
|
||||
from collections import Counter
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ _value:
|
||||
"""
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.common._collections_compat import Mapping, Sequence
|
||||
from collections.abc import Mapping, Sequence
|
||||
|
||||
|
||||
def groupby_as_dict(sequence, attribute):
|
||||
|
||||
@@ -197,7 +197,7 @@ _value:
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils.common._collections_compat import Mapping, Sequence
|
||||
from collections.abc import Mapping, Sequence
|
||||
from ansible.utils.vars import merge_hash
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
@@ -51,7 +51,7 @@ _value:
|
||||
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.common._collections_compat import Mapping
|
||||
from collections.abc import Mapping
|
||||
from ansible.module_utils.six.moves import StringIO
|
||||
from ansible.module_utils.six.moves.configparser import ConfigParser
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ except ImportError:
|
||||
HAS_PRETTYTABLE = False
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ from subprocess import Popen, PIPE
|
||||
|
||||
from ansible.errors import AnsibleParserError
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
from collections.abc import MutableMapping
|
||||
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
|
||||
from ansible.module_utils.common.process import get_bin_path
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ _list:
|
||||
"""
|
||||
|
||||
from ansible.errors import AnsibleLookupError
|
||||
from ansible.module_utils.common._collections_compat import Mapping, Sequence
|
||||
from collections.abc import Mapping, Sequence
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
from ansible.template import Templar
|
||||
|
||||
@@ -31,7 +31,7 @@ except ImportError:
|
||||
from ansible.module_utils import six
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.common._collections_compat import Mapping
|
||||
from ansible.module_utils.six.moves.collections_abc import Mapping
|
||||
|
||||
|
||||
def transform_list_to_dict(list_):
|
||||
|
||||
@@ -24,7 +24,7 @@ _state_map = {
|
||||
|
||||
|
||||
def fmt_resource_type(value):
|
||||
return [value[k] for k in ['resource_standard', 'resource_provider', 'resource_name'] if value.get(k) is not None]
|
||||
return [":".join(value[k] for k in ['resource_standard', 'resource_provider', 'resource_name'] if value.get(k) is not None)]
|
||||
|
||||
|
||||
def fmt_resource_operation(value):
|
||||
|
||||
@@ -258,8 +258,8 @@ def main():
|
||||
)
|
||||
|
||||
name = module.params['name']
|
||||
if name == 'cgi' and _run_threaded(module):
|
||||
module.fail_json(msg="Your MPM seems to be threaded. No automatic actions on module cgi possible.")
|
||||
if name == 'cgi' and module.params['state'] == 'present' and _run_threaded(module):
|
||||
module.fail_json(msg="Your MPM seems to be threaded, therefore enabling cgi module is not allowed.")
|
||||
|
||||
if not module.params['identifier']:
|
||||
module.params['identifier'] = create_apache_identifier(module.params['name'])
|
||||
|
||||
@@ -97,7 +97,7 @@ options:
|
||||
type: bool
|
||||
ignore_platform_reqs:
|
||||
description:
|
||||
- Ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill
|
||||
- Ignore C(php), C(hhvm), C(lib-*) and C(ext-*) requirements and force the installation even if the local machine does not fulfill
|
||||
these.
|
||||
default: false
|
||||
type: bool
|
||||
@@ -143,6 +143,7 @@ EXAMPLES = r"""
|
||||
"""
|
||||
|
||||
import re
|
||||
import shlex
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
@@ -160,7 +161,7 @@ def has_changed(string):
|
||||
|
||||
def get_available_options(module, command='install'):
|
||||
# get all available options from a composer command using composer help to json
|
||||
rc, out, err = composer_command(module, "help %s" % command, arguments="--no-interaction --format=json")
|
||||
rc, out, err = composer_command(module, ["help", command], arguments=["--no-interaction", "--format=json"])
|
||||
if rc != 0:
|
||||
output = parse_out(err)
|
||||
module.fail_json(msg=output)
|
||||
@@ -169,14 +170,19 @@ def get_available_options(module, command='install'):
|
||||
return command_help_json['definition']['options']
|
||||
|
||||
|
||||
def composer_command(module, command, arguments="", options=None):
|
||||
def composer_command(module, command, arguments=None, options=None):
|
||||
if options is None:
|
||||
options = []
|
||||
if arguments is None:
|
||||
arguments = []
|
||||
|
||||
global_command = module.params['global_command']
|
||||
|
||||
if not global_command:
|
||||
options.extend(['--working-dir', "'%s'" % module.params['working_dir']])
|
||||
if global_command:
|
||||
global_arg = ["global"]
|
||||
else:
|
||||
global_arg = []
|
||||
options.extend(['--working-dir', module.params['working_dir']])
|
||||
|
||||
if module.params['executable'] is None:
|
||||
php_path = module.get_bin_path("php", True, ["/usr/local/bin"])
|
||||
@@ -188,7 +194,7 @@ def composer_command(module, command, arguments="", options=None):
|
||||
else:
|
||||
composer_path = module.params['composer_executable']
|
||||
|
||||
cmd = [php_path, composer_path, "global" if global_command else "", command] + options + [arguments]
|
||||
cmd = [php_path, composer_path] + global_arg + command + options + arguments
|
||||
return module.run_command(cmd)
|
||||
|
||||
|
||||
@@ -220,7 +226,7 @@ def main():
|
||||
if re.search(r"\s", command):
|
||||
module.fail_json(msg="Use the 'arguments' param for passing arguments with the 'command'")
|
||||
|
||||
arguments = module.params['arguments']
|
||||
arguments = shlex.split(module.params['arguments'])
|
||||
available_options = get_available_options(module=module, command=command)
|
||||
|
||||
options = []
|
||||
@@ -260,7 +266,7 @@ def main():
|
||||
else:
|
||||
module.exit_json(skipped=True, msg="command '%s' does not support check mode, skipping" % command)
|
||||
|
||||
rc, out, err = composer_command(module, command, arguments, options)
|
||||
rc, out, err = composer_command(module, [command], arguments, options)
|
||||
|
||||
if rc != 0:
|
||||
output = parse_out(err)
|
||||
|
||||
@@ -195,7 +195,7 @@ class Pids(object):
|
||||
self._pids = []
|
||||
|
||||
def execute(self):
|
||||
if self._name:
|
||||
if self._name is not None:
|
||||
self._pids = self._ps.get_pids_by_name(self._name)
|
||||
else:
|
||||
try:
|
||||
|
||||
@@ -113,36 +113,40 @@ EXAMPLES = r"""
|
||||
region: fr-par
|
||||
"""
|
||||
|
||||
RETURNS = """
|
||||
{
|
||||
"scaleway_lb": {
|
||||
RETURN = r"""
|
||||
scaleway_lb:
|
||||
description: The load-balancer object.
|
||||
returned: success
|
||||
type: dict
|
||||
sample:
|
||||
{
|
||||
"backend_count": 0,
|
||||
"frontend_count": 0,
|
||||
"description": "Description of my load-balancer",
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"instances": [
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"ip_address": "10.0.0.1",
|
||||
"region": "fr-par",
|
||||
"status": "ready"
|
||||
},
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"ip_address": "10.0.0.2",
|
||||
"region": "fr-par",
|
||||
"status": "ready"
|
||||
}
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"ip_address": "10.0.0.1",
|
||||
"region": "fr-par",
|
||||
"status": "ready"
|
||||
},
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"ip_address": "10.0.0.2",
|
||||
"region": "fr-par",
|
||||
"status": "ready"
|
||||
}
|
||||
],
|
||||
"ip": [
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"ip_address": "192.168.0.1",
|
||||
"lb_id": "00000000-0000-0000-0000-000000000000",
|
||||
"region": "fr-par",
|
||||
"organization_id": "00000000-0000-0000-0000-000000000000",
|
||||
"reverse": ""
|
||||
}
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"ip_address": "192.168.0.1",
|
||||
"lb_id": "00000000-0000-0000-0000-000000000000",
|
||||
"region": "fr-par",
|
||||
"organization_id": "00000000-0000-0000-0000-000000000000",
|
||||
"reverse": ""
|
||||
}
|
||||
],
|
||||
"name": "lb_ansible_test",
|
||||
"organization_id": "00000000-0000-0000-0000-000000000000",
|
||||
@@ -152,8 +156,7 @@ RETURNS = """
|
||||
"first_tag",
|
||||
"second_tag"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
import datetime
|
||||
|
||||
@@ -377,8 +377,8 @@ except ImportError:
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule, json_dict_bytes_to_unicode, missing_required_lib
|
||||
from ansible.module_utils.six import iteritems, string_types
|
||||
from ansible.module_utils.six.moves.collections_abc import MutableMapping
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
|
||||
_IDENT = r"[a-zA-Z-][a-zA-Z0-9_\-\.]*"
|
||||
_NSIDENT = _IDENT + "|" + _IDENT + ":" + _IDENT
|
||||
|
||||
@@ -6,7 +6,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.common._collections_compat import Mapping
|
||||
from collections.abc import Mapping
|
||||
|
||||
try:
|
||||
# Introduced with Data Tagging (https://github.com/ansible/ansible/pull/84621):
|
||||
|
||||
@@ -10,7 +10,7 @@ import re
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils.common._collections_compat import Mapping, Sequence
|
||||
from collections.abc import Mapping, Sequence
|
||||
|
||||
|
||||
def _keys_filter_params(data, matching_parameter):
|
||||
|
||||
@@ -8,7 +8,7 @@ __metaclass__ = type
|
||||
import re
|
||||
|
||||
from ansible.module_utils.six import binary_type, text_type
|
||||
from ansible.module_utils.common._collections_compat import Mapping, Set
|
||||
from collections.abc import Mapping, Set
|
||||
from ansible.module_utils.common.collections import is_sequence
|
||||
from ansible.utils.unsafe_proxy import (
|
||||
AnsibleUnsafe,
|
||||
|
||||
@@ -224,7 +224,7 @@ _value:
|
||||
'''
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
from ansible.module_utils.common._collections_compat import Sequence
|
||||
from ansible.module_utils.six.moves.collections_abc import Sequence
|
||||
from ansible_collections.community.general.plugins.plugin_utils.ansible_type import _ansible_type
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,3 @@
|
||||
|
||||
azp/posix/2
|
||||
skip/python2.7 # jc only supports python3.x
|
||||
skip/freebsd13.3 # FIXME - ruyaml compilation fails
|
||||
skip/freebsd14.0 # FIXME - ruyaml compilation fails
|
||||
skip/freebsd14.1 # FIXME - ruyaml compilation fails
|
||||
skip/freebsd14.2 # FIXME - ruyaml compilation fails
|
||||
skip/freebsd14.3 # FIXME - ruyaml compilation fails
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
- include_tasks: 'update_cache.yml'
|
||||
- include_tasks: 'locally_installed_package.yml'
|
||||
- include_tasks: 'reason.yml'
|
||||
- include_tasks: 'yay-become.yml'
|
||||
# - include_tasks: 'yay-become.yml' # TODO: re-enable once AUR git access works again
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
|
||||
keytool_package_names:
|
||||
- ca-certificates-java
|
||||
- openjdk-11-jre-headless
|
||||
|
||||
@@ -11,7 +11,7 @@ import json
|
||||
import pytest
|
||||
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
from ansible.module_utils.six.moves.collections_abc import MutableMapping
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils import deps
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args as _set_module_args
|
||||
|
||||
17
tests/unit/plugins/modules/test_composer.py
Normal file
17
tests/unit/plugins/modules/test_composer.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: Alexei Znamensky (russoz@gmail.com)
|
||||
#
|
||||
# Copyright (c) Alexei Znamensky (russoz@gmail.com)
|
||||
#
|
||||
# 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
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible_collections.community.general.plugins.modules import composer
|
||||
from .uthelper import UTHelper, RunCommandMock
|
||||
|
||||
|
||||
UTHelper.from_module(composer, __name__, mocks=[RunCommandMock])
|
||||
27
tests/unit/plugins/modules/test_composer.yaml
Normal file
27
tests/unit/plugins/modules/test_composer.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) Alexei Znamensky (russoz@gmail.com)
|
||||
# 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
|
||||
|
||||
---
|
||||
anchors:
|
||||
environ_true: &env-def-true {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
|
||||
environ_false: &env-def-false {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false}
|
||||
test_cases:
|
||||
- id: composer
|
||||
input:
|
||||
command: install
|
||||
working_dir: "/var/www/foo"
|
||||
output:
|
||||
changed: true
|
||||
mocks:
|
||||
run_command:
|
||||
- command: ["/testbin/php", "/testbin/composer", "help", "install", "--working-dir", "/var/www/foo", "--no-interaction", "--format=json"]
|
||||
rc: 0
|
||||
out: |
|
||||
{"definition": {"options": ["a", "b", "c"]}}
|
||||
err: ''
|
||||
- command: ["/testbin/php", "/testbin/composer", "install", "--working-dir", "/var/www/foo"]
|
||||
rc: 0
|
||||
out: ''
|
||||
err: ''
|
||||
@@ -10,7 +10,7 @@ import json
|
||||
from collections import OrderedDict
|
||||
|
||||
from ansible_collections.community.general.plugins.modules.jenkins_plugin import JenkinsPlugin
|
||||
from ansible.module_utils.common._collections_compat import Mapping
|
||||
from ansible.module_utils.six.moves.collections_abc import Mapping
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import (
|
||||
MagicMock,
|
||||
patch,
|
||||
|
||||
@@ -57,6 +57,8 @@ test_cases:
|
||||
name: virtual-ip
|
||||
resource_type:
|
||||
resource_name: IPaddr2
|
||||
resource_standard: ocf
|
||||
resource_provider: heartbeat
|
||||
resource_option:
|
||||
- "ip=[192.168.2.1]"
|
||||
resource_operation:
|
||||
@@ -98,10 +100,10 @@ test_cases:
|
||||
dc-version=2.1.9-1.fc41-7188dbf
|
||||
have-watchdog=false
|
||||
err: ""
|
||||
- command: [/testbin/pcs, resource, create, virtual-ip, IPaddr2, "ip=[192.168.2.1]", op, start, timeout=1200, op, stop, timeout=1200, op, monitor, timeout=1200, meta, test_meta1=123, meta, test_meta2=456, --group, test_group, --wait=200]
|
||||
- command: [/testbin/pcs, resource, create, virtual-ip, ocf:heartbeat:IPaddr2, "ip=[192.168.2.1]", op, start, timeout=1200, op, stop, timeout=1200, op, monitor, timeout=1200, meta, test_meta1=123, meta, test_meta2=456, --group, test_group, --wait=200]
|
||||
environ: *env-def
|
||||
rc: 0
|
||||
out: "Assumed agent name 'ocf:heartbeat:IPaddr2' (deduced from 'IPAddr2')"
|
||||
out: "Assumed agent name 'ocf:heartbeat:IPaddr2'"
|
||||
err: ""
|
||||
- command: [/testbin/pcs, resource, status, virtual-ip]
|
||||
environ: *env-def
|
||||
|
||||
@@ -253,7 +253,7 @@ class RunCommandMock(TestCaseMock):
|
||||
|
||||
def check(self, test_case, results):
|
||||
call_args_list = [(item[0][0], item[1]) for item in self.mock_run_cmd.call_args_list]
|
||||
expected_call_args_list = [(item['command'], item['environ']) for item in self.mock_specs]
|
||||
expected_call_args_list = [(item['command'], item.get('environ', {})) for item in self.mock_specs]
|
||||
print("call args list =\n%s" % call_args_list)
|
||||
print("expected args list =\n%s" % expected_call_args_list)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user