diff --git a/changelogs/fragments/mc_from_config.yml b/changelogs/fragments/mc_from_config.yml new file mode 100644 index 00000000000..df31596f271 --- /dev/null +++ b/changelogs/fragments/mc_from_config.yml @@ -0,0 +1,2 @@ +minor_changes: + - module compression is now sourced directly via config, bypassing play_context possibly stale values. diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 5ded3a8aa36..39c6722152c 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -296,7 +296,8 @@ class ActionBase(ABC): try: (module_data, module_style, module_shebang) = modify_module(module_name, module_path, module_args, self._templar, task_vars=use_vars, - module_compression=self._play_context.module_compression, + module_compression=C.config.get_config_value('DEFAULT_MODULE_COMPRESSION', + variables=task_vars), async_timeout=self._task.async_val, environment=final_environment, remote_is_local=bool(getattr(self._connection, '_remote_is_local', False)),