From df998d9e4ed61a5134086bf726f499cf6f64f8cf Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 5 Jun 2024 17:14:30 -0400 Subject: [PATCH 1/2] play_context, actually set values from plugin (cherry picked from commit 21df603cea0927e9cc35ac4d3a3df9345e6e9440) --- lib/ansible/playbook/play_context.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index e384ce0fb2f..a873ff52a64 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -146,13 +146,9 @@ class PlayContext(Base): def set_attributes_from_plugin(self, plugin): # generic derived from connection plugin, temporary for backwards compat, in the end we should not set play_context properties - # get options for plugins options = C.config.get_configuration_definitions(plugin.plugin_type, plugin._load_name) - for option in options: - if option: - flag = options[option].get('name') - if flag: - setattr(self, flag, plugin.get_option(flag)) + for option in options.keys(): + setattr(self, option, plugin.get_option(option)) def set_attributes_from_play(self, play): self.force_handlers = play.force_handlers From a96e1c28ec717ae34be5aa7bc59fc895a6e2de5a Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 12 Jun 2024 18:34:29 -0400 Subject: [PATCH 2/2] clog --- changelogs/fragments/play_context_attribute_fix.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/play_context_attribute_fix.yml diff --git a/changelogs/fragments/play_context_attribute_fix.yml b/changelogs/fragments/play_context_attribute_fix.yml new file mode 100644 index 00000000000..74c07e25b97 --- /dev/null +++ b/changelogs/fragments/play_context_attribute_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - playcontext now correctly mirrors the settings from the plugins with which it overlaps.