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. diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index 72cee34a992..056184a7c46 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -144,13 +144,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