mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
feature-flag experimental module metadata (#85351)
* added ansible-test integration env/set directive for aliases
* applied to module-serialization-profiles test to enable feature flag
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 46abcfcc82)
This commit is contained in:
+2
@@ -1 +1,3 @@
|
||||
context/controller
|
||||
env/set/A_VAR/something
|
||||
env/set/A_PATH//an/absolute/path
|
||||
|
||||
+2
@@ -5,3 +5,5 @@
|
||||
- assert:
|
||||
that:
|
||||
- hello.message == 'Hello Ansibull'
|
||||
- lookup('env', 'A_VAR') == 'something'
|
||||
- lookup('env', 'A_PATH') == '/an/absolute/path'
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
context/target
|
||||
shippable/posix/group1
|
||||
env/set/_ANSIBLE_MODULE_METADATA/1
|
||||
|
||||
@@ -825,6 +825,7 @@ def integration_environment(
|
||||
env.update(ANSIBLE_TEST_REMOTE_INTERPRETER='')
|
||||
|
||||
env.update(integration)
|
||||
env.update(target.env_set)
|
||||
|
||||
return env
|
||||
|
||||
|
||||
@@ -582,6 +582,14 @@ class IntegrationTarget(CompletionTarget):
|
||||
else:
|
||||
static_aliases = tuple()
|
||||
|
||||
# non-group aliases which need to be extracted before group mangling occurs
|
||||
|
||||
self.env_set: dict[str, str] = {
|
||||
match.group('key'): match.group('value') for match in (
|
||||
re.match(r'env/set/(?P<key>[^/]+)/(?P<value>.*)', alias) for alias in static_aliases
|
||||
) if match
|
||||
}
|
||||
|
||||
# modules
|
||||
|
||||
if self.name in modules:
|
||||
|
||||
Reference in New Issue
Block a user