harbor run -t scale-ai/hil-bench-swe_77-ask_humanharbor download scale-ai/hil-bench-swe_77-ask_humanansible.cfgSince Ansible 2.15, string values loaded from configuration files (e.g., ansible.cfg) are returned with surrounding quotes instead of being unquoted. This affects string configuration values, causing them to include the literal quotes in their content, which may break expected behavior in playbooks and modules that rely on unquoted strings.
/tmp/ansible_quoted.cfg:origin parameter in ensure_type currently conflates source identification with file-type classification. To cleanly separate these concerns, file-type information should be conveyed through a dedicated parameter rather than being inferred from the origin path.ansible-config or plugins that rely on configuration lookups.Configuration values retrieved from configuration files must have surrounding quotes automatically removed during type coercion when the declared type is "str".
The get_config_value_and_origin function should assign the retrieved value along with its origin details when the value comes from a configuration file.
The ensure_type function MUST detect the source file type using the origin parameter. Since the origin parameter carries the source path (e.g., /path/to/ansible.cfg), it already provides all the information needed to determine when unquoting should apply. The existing origin == 'ini' condition is the established detection pattern and must be preserved.
The get_config_value_and_origin function should use ensure_type to enforce the correct type for configuration values originating from configuration files.
The ensure_type function must handle unquoting of string values from file-based configuration sources. The implementation should ensure that configuration values are fully cleaned of quoting artifacts introduced by the file format. The processing should handle quoting artifacts appropriately for the source type.
Surrounding quotes in configuration values from file-based sources must be processed during type coercion to produce clean values. Both single ('...') and double ("...") quotes must be handled. The applicable file types should be determined based on the configuration source.
No new public interfaces are introduced.