Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore AnsibleUndefinedVariable for set_fact, include_vars, and gather_facts tasks #53978

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@samdoran
Copy link
Member

commented Mar 18, 2019

SUMMARY

#41411 fixed an issue where any undefined environment variable was silently ignored. That had the side effect of failing the play too early if environment settings are populated by variables set in set_fact and include_vars tasks.

This PR adds more conditions under which the exception is ignored, allowing set_fact and include_vars to be used to set values for variables used in environment.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/playbook/task.py

ADDITIONAL INFORMATION

This may be the incorrect way to solve this. I am quite open to feedback on the bigger issue and how to better solve it.

@samdoran samdoran requested review from bcoca and sivel Mar 18, 2019

@samdoran samdoran force-pushed the samdoran:ignore-undef-environment-vars-on-certain-tasks branch Mar 18, 2019

@bcoca

This comment has been minimized.

Copy link
Member

commented Mar 18, 2019

why not 'debug' or 'add_host' or 'meta' or others? this list might get long on 'plugins that don't use environment'

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2019

The test ansible-test sanity --test changelog [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/changelog.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "packaging/release/changelogs/changelog.py", line 833, in <module>
    main()
  File "packaging/release/changelogs/changelog.py", line 101, in main
    args.func(args)
  File "packaging/release/changelogs/changelog.py", line 112, in command_lint
    lint_fragments(fragments, exceptions)
  File "packaging/release/changelogs/changelog.py", line 234, in lint_fragments
    errors += linter.lint(fragment)
  File "packaging/release/changelogs/changelog.py", line 307, in lint
    for section, lines in fragment.content.items():
AttributeError: 'str' object has no attribute 'items'
Traceback (most recent call last):
  File "test/sanity/code-smell/changelog.py", line 24, in <module>
    main()
  File "test/sanity/code-smell/changelog.py", line 20, in main
    subprocess.check_call(cmd)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['packaging/release/changelogs/changelog.py', 'lint', 'changelogs/fragments/11349-add-ansible_play_name-var.yaml', 'changelogs/fragments/11935-slack-add_hex_color_values.yaml', 'changelogs/fragments/2.8-core-deprecations.yaml', 'changelogs/fragments/2.8-removed-modules.yaml', 'changelogs/fragments/22766-fact-cmdline-return_multiple_lvm_values.yaml', 'changelogs/fragments/24004-yum-dnf-add-download_dir-param.yml', 'changelogs/fragments/24633-copy-coherency-between-check-normal-mode.yaml', 'changelogs/fragments/29135-include_vars-check_for_main.yml', 'changelogs/fragments/32366-test-match_fix_docs.yaml', 'changelogs/fragments/33740-osx_say_callback_renamed_say.yml', 'changelogs/fragments/33754-docker_image_fix_changed_in_force_mode.yaml', 'changelogs/fragments/34209-template-lookup-vault-support.yaml', 'changelogs/fragments/35331-postgres_privs-add-all_in_schema-for-functions.yaml', 'changelogs/fragments/35370-add_support_for_docker_network_internal_flag.yaml', 'changelogs/fragments/36811-fix-lvol-valueerror-with-float-size.yaml', 'changelogs/fragments/37150-make_modprobe_module_check_for_builtins_as_well.yaml', 'changelogs/fragments/38118-postgresql_user-fix_conn_limit_type.yml', 'changelogs/fragments/38803-postgresql_privs_fdw_and_fs_obj_types.yaml', 'changelogs/fragments/38833-docker_volume-option-minimum-versions.yml', 'changelogs/fragments/38878-hashi_vault-support_userpass.yaml', 'changelogs/fragments/40092-mysql_user-match-backticks.yml', 'changelogs/fragments/40174-junit-test-case-prefix-filter.yaml', 'changelogs/fragments/40176-junit-hide-task-arguments.yaml', 'changelogs/fragments/40424_postgresql_db_not_failed_when_dump_err.yml', 'changelogs/fragments/42482-ipa_dnsrecord-srv_mx_record.yml', 'changelogs/fragments/42866-galaxy-search-unicode.yaml', 'changelogs/fragments/43123-add_support_for_per_host_no_stats.yaml', 'changelogs/fragments/43874-docker_container-stop_timeout.yaml', 'changelogs/fragments/44278-pamd_valid_simple_controls.yaml', 'changelogs/fragments/44428-inventory-plugin-list.yml', 'changelogs/fragments/44561-vmware_host_config_manager-fix_key_error.yml', 'changelogs/fragments/44692-docker-find-image.yaml', 'changelogs/fragments/44789-docker_container-comparisons.yaml', 'changelogs/fragments/44988-acme-post-as-get.yaml', 'changelogs/fragments/45155-vmware_host_service_facts-update_docs.yaml', 'changelogs/fragments/45628-fetch_url-error-headers.yaml', 'changelogs/fragments/45824-uri-fix-TypeError.yaml', 'changelogs/fragments/46322-docker_container-image-not-given.yaml', 'changelogs/fragments/46443-mongodb_user-fix-roles-default-value.yaml', 'changelogs/fragments/46483-role_names-change.yaml', 'changelogs/fragments/46594-docker_container-publish-all-ports.yml', 'changelogs/fragments/46595-docker_container-expected_ports.yml', 'changelogs/fragments/46596-docker_container-published_ports.yml', 'changelogs/fragments/46598-docker_container-volume-modes.yml', 'changelogs/fragments/46608_azure_rm_inv_py3.yaml', 'changelogs/fragments/46658-plugin_filter-improve_error_handling.yaml', 'changelogs/fragments/46739-gcp-compute-instance-metadata.yaml', 'changelogs/fragments/46740-gcp-utils-credentials-scoping.yaml', 'changelogs/fragments/46743-fix-native-jinja-newlines.yaml', 'changelogs/fragments/46772-docker_container-healthcheck.yaml', 'changelogs/fragments/46961_fix_aws_ec2_cache.yaml', 'changelogs/fragments/47019-mail-fix-py27-regression.yaml', 'changelogs/fragments/47134-elasticsearch_plugin-fix_param_type.yml', 'changelogs/fragments/47193-fix-gce-and-scaleway-vm-detection.yml', 'changelogs/fragments/47213-onepassword_facts_fix_password_lookup.yaml', 'changelogs/fragments/47247-docker_container-add-runtime-option.yaml', 'changelogs/fragments/47281-pamd-dont-delete-named_temporary_file_on_close.yaml', 'changelogs/fragments/47300-ios-check_rc.yaml', 'changelogs/fragments/47307-handler-include-task.yml', 'changelogs/fragments/47313-vmware-fix_module_error.yaml', 'changelogs/fragments/47393-docker_image-id.yaml', 'changelogs/fragments/47395-docker_container-ipvX_address.yaml', 'changelogs/fragments/47396-docker_container-detach-auto-remove.yaml', 'changelogs/fragments/47459_grafana_dashboard_consistency_fix.yaml', 'changelogs/fragments/47492-docker_network-add-ipv6-support.yaml', 'changelogs/fragments/47500-rds_instance.yaml', 'changelogs/fragments/47539-fix-netaddr-network.yaml', 'changelogs/fragments/47668-aci_switch_leaf_selector-support_empty_policy_group.yaml', 'changelogs/fragments/47689-yum-fix-version-syntax.yaml', 'changelogs/fragments/47695-pamd-fix-idempotence-and-parsing-issues.yml', 'changelogs/fragments/47704-apt-warn-auto-intall.yml', 'changelogs/fragments/47711-docker_container-minimal-version-checks.yml', 'changelogs/fragments/47712-docker_container-detach-auto-remove.yml', 'changelogs/fragments/47722-vmware_guest_powerstate-restore_timeout.yaml', 'changelogs/fragments/47809-module_utils_mysql-unexpected-keyword-argument-cursorclass.yml', 'changelogs/fragments/47814-docker_container-device-io-limit-parameters.yaml', 'changelogs/fragments/47846-cs_ip_address-fix-vpc-vs-network.yaml', 'changelogs/fragments/47859-vmware_guest-convert_vm_disk_clone.yaml', 'changelogs/fragments/47900-docker_container-paused.yml', 'changelogs/fragments/47916-grafana_dashboard-fix-logic-behind-overwrite-param.yaml', 'changelogs/fragments/47920-vmware_guest-handle_no_root_snapshot.yaml', 'changelogs/fragments/47938-docker_swarm_service-requirements.yaml', 'changelogs/fragments/47997-docker_container-ipc-pid-mode.yml', 'changelogs/fragments/48036-vultr-fix-empty-list-handling.yaml', 'changelogs/fragments/48061-docker_container-auto_removal.yml', 'changelogs/fragments/48069-default-callback-unreachable_stderr.yml', 'changelogs/fragments/48306-ansible-connection-json.yml', 'changelogs/fragments/48342-vultr_server_facts-fix-firewall-group.yml', 'changelogs/fragments/48471-win_xml-xml-parser.yaml', 'changelogs/fragments/48536-docker_volume-labels.yml', 'changelogs/fragments/48546-docker-diff.yml', 'changelogs/fragments/48547-assert-incorrect_msg_type.yml', 'changelogs/fragments/48551-docker_container-idempotency.yml', 'changelogs/fragments/48599-rabbitmq_binding-state-absent.yaml', 'changelogs/fragments/48673-fix-omit-on-play-keywords.yaml', 'changelogs/fragments/48675-cs_template-fix-keyerror-state-extracted.yml', 'changelogs/fragments/48728-win_nssm-credential-quoting.yml', 'changelogs/fragments/48730-zabbix_hostmacro-fixes.yaml', 'changelogs/fragments/48936-import-handlers.yaml', 'changelogs/fragments/48950-vault-encrypted-data-native-jinja.yaml', 'changelogs/fragments/49078-docker_container-min-version-fix.yml', 'changelogs/fragments/49081-add-launch-type-to-ecs-task.yml', 'changelogs/fragments/49084-influxdb_user-default-password-fix.yaml', 'changelogs/fragments/49158-detect-kvm-on-freebsd.yaml', 'changelogs/fragments/49184-facts-rpm-ostree-pkgmgr.yml', 'changelogs/fragments/49188-zabbix_template-fix-idempotency.yaml', 'changelogs/fragments/49191-module_utils_mysql-unexpected-keyword-argument-cursorclass.yml', 'changelogs/fragments/49212-require-git-ansible-galaxy.yaml', 'changelogs/fragments/49235-docker_swarm_service-user-default.yaml', 'changelogs/fragments/49262-user.yml', 'changelogs/fragments/49266-acme-error-messages.yml', 'changelogs/fragments/49319-docker_container-pids_limit.yaml', 'changelogs/fragments/49409-lineinfile_must_not_insert_lines_multiples_times_with_insertbefore_insertafter.yml', 'changelogs/fragments/49410-acme-diff.yml', 'changelogs/fragments/49473-multiple-ipv6-addresses-per-device.yaml', 'changelogs/fragments/49545-ansible-doc_version_help.yaml', 'changelogs/fragments/49553-aci_rest-fix-ignoring-custom-port.yaml', 'changelogs/fragments/49615-ascii-devuan-support.yml', 'changelogs/fragments/49664-npm-added-ci-param.yaml', 'changelogs/fragments/49676-s3bucket-requester_pays_change_if_condition.yml', 'changelogs/fragments/49688-docker_secret-config-base64-data.yml', 'changelogs/fragments/49723-jenkins-plugin-install-latest.yaml', 'changelogs/fragments/49734-facts-set-virtualization_role-for-kvm-hosts.yaml', 'changelogs/fragments/49776-product_fix_katello_foreman_module.yaml', 'changelogs/fragments/49787-docker_image-cache_from.yaml', 'changelogs/fragments/49794-docker_container-network-mode.yml', 'changelogs/fragments/49796-ufw-insert-relative-to.yml', 'changelogs/fragments/49843-docker_container-wrap-env.yaml', 'changelogs/fragments/49884-tower-project-scm-cred-org-fallback.yaml', 'changelogs/fragments/49952-avoid-loading-kube-config-when-auth-given.yml', 'changelogs/fragments/49981-filter-dnsimple-request-by-record-name.yaml', 'changelogs/fragments/50006-azure_rm_inventory_batchrequest_fix.yaml', 'changelogs/fragments/50025-gcp_compute_filters_default.yml', 'changelogs/fragments/50059-ecs-service-add-features.yml', 'changelogs/fragments/50076-os-sec-group-rule-proper-module-exit.yaml', 'changelogs/fragments/50134-influxdb_user-invalid_auth_fix.yml', 'changelogs/fragments/50143-win_firewall_rule-invalid-bypass.yml', 'changelogs/fragments/50185-win_updates-report-changes-correctly.yml', 'changelogs/fragments/50249-vmware_vm_inventory-fix_host_ip.yaml', 'changelogs/fragments/50298-redfish_utils_fix_reference_to_local_variable_systems_service.yaml', 'changelogs/fragments/50316-ansible-vault_utf-8_in_vault_filename.yaml', 'changelogs/fragments/50322-openssl-path-error.yml', 'changelogs/fragments/50337-fix-vultr_server-ssh_keys-handling.yml', 'changelogs/fragments/50361-openssl_csr-idempotency.yml', 'changelogs/fragments/50402-ufw-check-direction.yml', 'changelogs/fragments/50448-paramiko_ssh_add_auth_timeout.yaml', 'changelogs/fragments/50483-docker_swarm_service-option-typo.yml', 'changelogs/fragments/50570-relative_time_crypto.yaml', 'changelogs/fragments/50654-docker-swarm-service-docker-api-fix.yaml', 'changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml', 'changelogs/fragments/50657-bubble-k8s-import-exception.yml', 'changelogs/fragments/50834-50833-zabbix_template-json.yaml', 'changelogs/fragments/50843.yaml', 'changelogs/fragments/50861-docker_swarm_service-documentation-fixes.yml', 'changelogs/fragments/50871-facts-ip-addr-busybox.yaml', 'changelogs/fragments/50882-docker_swarm_service-fix-publish-idempotency.yml', 'changelogs/fragments/50883-docker_network-labels-support.yaml', 'changelogs/fragments/50894-openssl_csr-san-commonname-optional.yaml', 'changelogs/fragments/50984-docker_swarm_service-command-option.yml', 'changelogs/fragments/51035-docker_service-docker_compose-rename.yaml', 'changelogs/fragments/51059-dnf-support-substitutions.yml', 'changelogs/fragments/51110-docker_swarm_service-drop-user-default.yml', 'changelogs/fragments/51134-docker_swarm_service-change-on-updated-image.yml', 'changelogs/fragments/51136-fix-ansible-inventory-tracebacks.yml', 'changelogs/fragments/51145-docker_volume-force.yaml', 'changelogs/fragments/51166-ufw-gre-igmp.yaml', 'changelogs/fragments/51170-docker_swarm_service-handle-out-of-sequence-error.yml', 'changelogs/fragments/51406-aci_aaa_user-description.yaml', 'changelogs/fragments/51473-openssl_csr-idempotence.yaml', 'changelogs/fragments/51495-k8s-load-envvars.yaml', 'changelogs/fragments/51535-ec2-fix-spot-request-end-date.yaml', 'changelogs/fragments/51600-provider_segmentation_id-is-int.yaml', 'changelogs/fragments/51602-ec2_instance_single_iface_description.yaml', 'changelogs/fragments/51653-fixing-azure-postgresql-parameters.yaml', 'changelogs/fragments/51661-fixing-azure-mysql-parameters.yaml', 'changelogs/fragments/51697-disable_excludes-errors-with-disable-includes-message.yaml', 'changelogs/fragments/51762-docker_swarm_service-extend-env-and-add-env-file.yml', 'changelogs/fragments/51781-fixing-managed-disk-facts.yaml', 'changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml', 'changelogs/fragments/51824-slack-req-content-type.yaml', 'changelogs/fragments/51827-openstack_logs_to_stderr.yml', 'changelogs/fragments/51885-ec2_instance-fix-eventual-consistency.yaml', 'changelogs/fragments/52004-fix-terraform-state-planned.yml', 'changelogs/fragments/52031-gssapi-for-identity-ipa.yaml', 'changelogs/fragments/52032-add_quiet_option_to_assert.yml', 'changelogs/fragments/52045-keyed-group-features.yaml', 'changelogs/fragments/52051-jenkins_plugin-state_present_fix.yaml', 'changelogs/fragments/52158-jinja2-native-types-contructed-keyed-groups.yaml', 'changelogs/fragments/52166-fix_rabbitmq_plugin_idempotence.yml', 'changelogs/fragments/52278-mysql_user-fix-regex.yml', 'changelogs/fragments/52322-cron_fix_missing_deprecation_warn.yaml', 'changelogs/fragments/52381-vmware_vm_inventory-fix_yaml_flag.yaml', 'changelogs/fragments/52388-postgresqldatabase-fix-force-update.yml', 'changelogs/fragments/52389-mysqldatabase-fix-force-update.yaml', 'changelogs/fragments/52412-docker_image-deprecate.yml', 'changelogs/fragments/52419-docker_swarm_service-add-healthcheck-option.yml', 'changelogs/fragments/52420-docker_swarm_service-remove-update-defaults.yml', 'changelogs/fragments/52424-docker_swarm_service-add_stop_signal_option.yml', 'changelogs/fragments/52425-docker_swarm_service-add_working_dir_option.yml', 'changelogs/fragments/52428-docker_swarm_service-add_groups_option.yml', 'changelogs/fragments/52499-ovirt_network_label_fail.yaml', 'changelogs/fragments/52519-docker_swarm_service-add_stop_grace_period_option.yml', 'changelogs/fragments/52519-docker_swarm_service-period_options.yml', 'changelogs/fragments/52536-jenkins_plugin-update_url.yaml', 'changelogs/fragments/52574-postgresql_privs-add_warn_if_role_not_exist.yml', 'changelogs/fragments/52581-change-default-behaviour-of-retry_files_enabled.yaml', 'changelogs/fragments/52634-docker_swarm_service-dont_remove_service_on_network.yml', 'changelogs/fragments/52760-fix-last-task-time-with-multiple-plays.yaml', 'changelogs/fragments/52822-cloudscale_fix-py3.yaml', 'changelogs/fragments/52825-docker_swarm-detection-check-mode.yaml', 'changelogs/fragments/52894-docker_image.yaml', 'changelogs/fragments/52895-docker_swarm-labels.yaml', 'changelogs/fragments/52947-docker_swarm-diff.yaml', 'changelogs/fragments/53003-docker_swarm-force-new-cluster.yml', 'changelogs/fragments/53039-docker_swarm-ca_force_rotate.yml', 'changelogs/fragments/53129-docker_swarm-older-docker-py.yaml', 'changelogs/fragments/53134-yum-fix-disable_excludes-when-repoquery.yaml', 'changelogs/fragments/53152-create-groups-using-composed-variables.yaml', 'changelogs/fragments/53170-iptables-support_gateway.yml', 'changelogs/fragments/53198-openssl_csr-subject-validation.yml', 'changelogs/fragments/53201-openssl_csr-improve-invalid-san.yml', 'changelogs/fragments/53207-openssl_certificate-assertonly-extensions.yml', 'changelogs/fragments/53213-docker_swarm_service-option_groups.yaml', 'changelogs/fragments/53229-docker_swarm_service-return-value.yml', 'changelogs/fragments/53289-module-option-int-long.yml', 'changelogs/fragments/53290-docker_swarm_service-add_hosts_option.yml', 'changelogs/fragments/53295-docker_swarm_service-docker-py-versions.yaml', 'changelogs/fragments/53323-no-psycopg2-for-dump-and-restore.yaml', 'changelogs/fragments/53440-docker_container-warnings.yml', 'changelogs/fragments/53451-docker_image-fix-changed-tag-push.yml', 'changelogs/fragments/53479-docker_swarm_service-documentation-fixes.yaml', 'changelogs/fragments/53482-docker_swarm_service-read_only_option.yaml', 'changelogs/fragments/53489-openssl-private-key-passphrase.yml', 'changelogs/fragments/53503-docker_swarm_fix_node_id.yml', 'changelogs/fragments/53559-docker_swarm_service-mounts-options.yaml', 'changelogs/fragments/53593-openssl_privatekey-backup.yml', 'changelogs/fragments/53594-docker_swarm_service-rollback_config.yaml', 'changelogs/fragments/53649-allow-parent-group-as-variable.yaml', 'changelogs/fragments/53660-acme_certificate-ip-identifiers.yml', 'changelogs/fragments/53661-acme_challenge_cert_helper-ip-identifiers.yml', 'changelogs/fragments/53669-ec2_asg_fix_race_condition.yml', 'changelogs/fragments/53710-docker-warnings.yml', 'changelogs/fragments/53732-iptables-add-iprange-support.yml', 'changelogs/fragments/53738-cs_iso-missing_is_public.yml', 'changelogs/fragments/53899-cs_network_offering-supported_services_choices.yml', 'changelogs/fragments/53911-docker_image-build-pull-default.yml', 'changelogs/fragments/aci_access_port_to_interface_policy_leaf_profile-missing_policy_group.yaml', 'changelogs/fragments/aci_interface_policy_leaf_policy_group-missing_aep.yaml', 'changelogs/fragments/acl_doc_fix.yml', 'changelogs/fragments/add-elapsed-return-value-to-select-modules.yaml', 'changelogs/fragments/agnostic-become-prompt.yaml', 'changelogs/fragments/ajson-nested-decode.yaml', 'changelogs/fragments/allow_bad_things.yml', 'changelogs/fragments/allow_regions_aws_invp.yml', 'changelogs/fragments/ansible-doc-fixes.yml', 'changelogs/fragments/ansible-template-error.yml', 'changelogs/fragments/apt_repository-no-tty.yaml', 'changelogs/fragments/async-dir.yaml', 'changelogs/fragments/async-wrapper-stdin.yaml', 'changelogs/fragments/async_statys_pyx_compat_fix.yml', 'changelogs/fragments/auto_nice_error.yml', 'changelogs/fragments/avoid_race.yml', 'changelogs/fragments/avoid_spurious_unique_warnings.yml', 'changelogs/fragments/avoid_ssh_retry_discolsures.yml', 'changelogs/fragments/aws_ec2_inventory_integration_tests.yaml', 'changelogs/fragments/aws_kms_grants.yml', 'changelogs/fragments/azure_rm_appgateway-probe.yaml', 'changelogs/fragments/azure_rm_deployment_fix_45941.yaml', 'changelogs/fragments/basic-no-state-absent-when-path-or-dest.yaml', 'changelogs/fragments/become-plugins.yaml', 'changelogs/fragments/better-kv-error-reporting.yml', 'changelogs/fragments/better_cfgmgr_errors.yml', 'changelogs/fragments/better_json_option_error.yml', 'changelogs/fragments/blockinfile-bytes-fix.yaml', 'changelogs/fragments/callback-keep-more-debug-keys.yml', 'changelogs/fragments/cfg_mgr_fix.yml', 'changelogs/fragments/change_failed_when_example.yaml', 'changelogs/fragments/check_type_string-option-when-converting.yaml', 'changelogs/fragments/checkpoint-object-facts-type-param.yaml', 'changelogs/fragments/chroot_exe.yml', 'changelogs/fragments/clear_system_variablse.yml', 'changelogs/fragments/cli-refactor.yaml', 'changelogs/fragments/code-cleanup-no-get-exception.yaml', 'changelogs/fragments/command-stdin-no-newline.yaml', 'changelogs/fragments/conditionals_fix.yml', 'changelogs/fragments/contains-test.yaml', 'changelogs/fragments/copy-diff-text.yaml', 'changelogs/fragments/copy-recursive-remote-src.yml', 'changelogs/fragments/dd-put-empty-files.yaml', 'changelogs/fragments/deal_with_bad_config_types.yml', 'changelogs/fragments/debconf_bool_fix.yml', 'changelogs/fragments/delegate_to_loop_hostvars.yaml', 'changelogs/fragments/detect_interpreter_stdout.yml', 'changelogs/fragments/dict2items-mapping.yaml', 'changelogs/fragments/diff_yaml.yml', 'changelogs/fragments/disallow-relative-homedir.yaml', 'changelogs/fragments/display-singleton.yaml', 'changelogs/fragments/distribution-file-processing.yaml', 'changelogs/fragments/distribution_support.yaml', 'changelogs/fragments/dnf-conf-file.yaml', 'changelogs/fragments/dnf-fix-plugin-loading.yaml', 'changelogs/fragments/dnf-group-removal.yaml', 'changelogs/fragments/dnf-ignore-weak-deps.yaml', 'changelogs/fragments/dnf-localgpgcheck.yaml', 'changelogs/fragments/dnf-modularity.yaml', 'changelogs/fragments/dnf-packagename-parse.yaml', 'changelogs/fragments/dnf-update-cache-broken-transaction.yaml', 'changelogs/fragments/dnfyum-disable-excludes.yaml', 'changelogs/fragments/doc_debug_var.yml', 'changelogs/fragments/doc_module_paths_unresolved.yml', 'changelogs/fragments/docfixes.yml', 'changelogs/fragments/docker-facts.yaml', 'changelogs/fragments/docker-image-ids.yaml', 'changelogs/fragments/docker-swarm-service-defaults.yml', 'changelogs/fragments/docker_container-idempotency.yaml', 'changelogs/fragments/docker_network-adding-scope-and-attachable-flags.yaml', 'changelogs/fragments/docker_network-driver_options.yaml', 'changelogs/fragments/docker_network-requirements.yaml', 'changelogs/fragments/docker_volume-force-change-detection-revert.yaml', 'changelogs/fragments/docker_volume-force-change-detection.yaml', 'changelogs/fragments/drop-pkg_resources.yaml', 'changelogs/fragments/ec2_asg-launch-template-support.yml', 'changelogs/fragments/ec2_asg_retry_deletion_when_busy.yaml', 'changelogs/fragments/ec2_fix_assigning_private_without_public_ip.yml', 'changelogs/fragments/ec2_group_fix_target_containing_list_within_list.yaml', 'changelogs/fragments/ec2_vpc_peer_describe_peer_with_exception_handling.yaml', 'changelogs/fragments/ec2_vpc_peer_parameter_checking.yaml', 'changelogs/fragments/ec2_vpc_peering_facts_tags.yml', 'changelogs/fragments/elb_target_group_fix_KeyError.yaml', 'changelogs/fragments/end-host-meta-task.yaml', 'changelogs/fragments/explain_bare.yml', 'changelogs/fragments/fibre_channel_wwn_fact.yaml', 'changelogs/fragments/file-touch-non-owner.yaml', 'changelogs/fragments/firewalld-missing-port-protocol.yml', 'changelogs/fragments/fix-Amazon-system-release-version-parsing.yaml', 'changelogs/fragments/fix-callbacks-mixed-keys.yaml', 'changelogs/fragments/fix-lvg-reduce-by-better-listing-pv.yml', 'changelogs/fragments/fix-password-lookup-on-fips.yaml', 'changelogs/fragments/fix-python3-compatibility-with-AWS-policies.yaml', 'changelogs/fragments/fix_adhoc_includes.yml', 'changelogs/fragments/fix_ec2_group_target_vpc_precedence.yaml', 'changelogs/fragments/fix_ec2_group_vpc_precedence_classic.yaml', 'changelogs/fragments/fix_ir_dupes.yml', 'changelogs/fragments/fix_order_serial.yml', 'changelogs/fragments/fix_plugin_loader_cache.yml', 'changelogs/fragments/fix_pull_extra.yml', 'changelogs/fragments/fix_taggged_gather.yml', 'changelogs/fragments/force_role_with_deps.yml', 'changelogs/fragments/free-strategy-include-var-tags.yaml', 'changelogs/fragments/from_handlers.yml', 'changelogs/fragments/get-url-fix-idempotency.yaml', 'changelogs/fragments/get_url-checksum.yaml', 'changelogs/fragments/get_url.yaml', 'changelogs/fragments/handle_non_strings_in_requirements.yaml', 'changelogs/fragments/host-start-callback.yaml', 'changelogs/fragments/ibm-storag_add_domain_keywords_to_module.yml', 'changelogs/fragments/icinga2_host-47671-fix-use_proxy.yaml', 'changelogs/fragments/ignore-undefined-errors-for-env-var-on-certain-tasks.yaml', 'changelogs/fragments/improved-fieldattribute-inheritance.yaml', 'changelogs/fragments/improved_stats.yaml', 'changelogs/fragments/include-import-promotion.yaml', 'changelogs/fragments/include-run-once.yaml', 'changelogs/fragments/include_tasks_parent_templating.yml', 'changelogs/fragments/includevars_nonascii.yaml', 'changelogs/fragments/influxdb_user-admin-role-update.yaml', 'changelogs/fragments/interpreter_discovery.yaml', 'changelogs/fragments/inv_fixes.yml', 'changelogs/fragments/inventory-docker-service-stack-groups.yaml', 'changelogs/fragments/iscsi_facts_hp-ux_aix.yaml', 'changelogs/fragments/jinja-now.yml', 'changelogs/fragments/jinja2_native-fallback-warning.yaml', 'changelogs/fragments/jinja2_nested_undefined.yaml', 'changelogs/fragments/jira_fix_description_field.yaml', 'changelogs/fragments/k8s_append_hash.yml', 'changelogs/fragments/k8s_facts_fix.yaml', 'changelogs/fragments/k8s_module_defaults_group.yml', 'changelogs/fragments/k8s_validate.yml', 'changelogs/fragments/k8s_wait.yml', 'changelogs/fragments/last-loaded-handler-same-name-wins.yaml', 'changelogs/fragments/lineinfile-insertbefore-index-out-of-range.yaml', 'changelogs/fragments/loop-cache-include-apply.yml', 'changelogs/fragments/loop-control-label-template-error.yaml', 'changelogs/fragments/loop-empty-literal-list.yaml', 'changelogs/fragments/loop-info.yaml', 'changelogs/fragments/loop_undefined_delegate_to.yaml', 'changelogs/fragments/mac-product-name.yaml', 'changelogs/fragments/macports-upgrade-selfupdate.yml', 'changelogs/fragments/mathstuff-filter-py3-scope.yaml', 'changelogs/fragments/md5-hash-algorithms-pop-fix.yaml', 'changelogs/fragments/meraki_configuration_template_net_id_fix.yml', 'changelogs/fragments/meraki_orgnet_fix.yml', 'changelogs/fragments/meraki_ssid_number_fix.yml', 'changelogs/fragments/mount-optional-fields.yaml', 'changelogs/fragments/mysql-migrate_to_pymysql.yaml', 'changelogs/fragments/network_configurable_backup_path.yaml', 'changelogs/fragments/nicer_role_list.yml', 'changelogs/fragments/nmap_bytes_fix.yml', 'changelogs/fragments/no-mutable-fieldattribute-defaults.yaml', 'changelogs/fragments/no-overwrite-roles.yaml', 'changelogs/fragments/no_empty_groups.yml', 'changelogs/fragments/no_strippers.yml', 'changelogs/fragments/nvme_fact.yaml', 'changelogs/fragments/omit-list-of-dicts.yaml', 'changelogs/fragments/openssl-cryptography.yml', 'changelogs/fragments/openssl-python3.yaml', 'changelogs/fragments/openssl_certificate_fix_has_expired.yml', 'changelogs/fragments/openstack_inventory_fix.yml', 'changelogs/fragments/os-server-facts-all-projects.yaml', 'changelogs/fragments/ovirt_host_network_fix_type_conversion.yaml', 'changelogs/fragments/pause_subsecs.yml', 'changelogs/fragments/pear_better_error.yml', 'changelogs/fragments/persistent_command_timeout_increase.yaml', 'changelogs/fragments/pip-fix-idempotence-in-check-mode.yaml', 'changelogs/fragments/piped-transfer-empty-files.yaml', 'changelogs/fragments/platform-dist-to-nir0s-distro.yaml', 'changelogs/fragments/playbook-order-reverse_inventory.yaml', 'changelogs/fragments/plugin-docs-list-fix.yaml', 'changelogs/fragments/plugin-filters-cfg.yaml', 'changelogs/fragments/postgresql_user-not-sup-error.yaml', 'changelogs/fragments/powershell_basic_util.yaml', 'changelogs/fragments/ps_sb_logging.yaml', 'changelogs/fragments/psexec-handle-socket-errors.yaml', 'changelogs/fragments/psexec-imp-error.yaml', 'changelogs/fragments/psrp-display-exec-output.yaml', 'changelogs/fragments/psrp-utf8-stdio.yaml', 'changelogs/fragments/psrp-utf8.yaml', 'changelogs/fragments/pure_facts_fix.yaml', 'changelogs/fragments/reboot-add-aix-support.yml', 'changelogs/fragments/reboot-add-search-paths-parameter.yaml', 'changelogs/fragments/reboot-change-default-boot-command.yaml', 'changelogs/fragments/reboot-conn-timeout-reset.yaml', 'changelogs/fragments/reboot-fix-exception-type.yaml', 'changelogs/fragments/reboot-path-alpine-solaris.yaml', 'changelogs/fragments/reboot-show-timeout.yaml', 'changelogs/fragments/reboot-unicode-string.yaml', 'changelogs/fragments/reboot-vmware-esxi.yaml', 'changelogs/fragments/reboot_missing_parameter.yaml', 'changelogs/fragments/reboot_openbsd_support.yaml', 'changelogs/fragments/redis-3-compat.yaml', 'changelogs/fragments/regex-escape-basic.yaml', 'changelogs/fragments/remove_redundant_md5.yml', 'changelogs/fragments/restore_sigpipe_dfl.yml', 'changelogs/fragments/restructure_inventory_cache.yaml', 'changelogs/fragments/rhn_regiter-user-pass-unregister.yaml', 'changelogs/fragments/rhsm_repository-handle-no-repos.yml', 'changelogs/fragments/rhsm_repository-loop-fix-improvements.yaml', 'changelogs/fragments/run-command-expand-shell.yaml', 'changelogs/fragments/rundeck-acl-policy-python-version.yaml', 'changelogs/fragments/s3_bucket_delete_nonexistent_bucket.yml', 'changelogs/fragments/s3_bucket_fix_non_str_tags.yaml', 'changelogs/fragments/s3_bucket_requester_pays_default_value.yaml', 'changelogs/fragments/s3_bucket_walrus_endpoint.yaml', 'changelogs/fragments/scaleway-getheaders.yaml', 'changelogs/fragments/scan_packages.yml', 'changelogs/fragments/script-module-no-file-path.yaml', 'changelogs/fragments/service-facts-dont-hist-systemd-disabled-units.yaml', 'changelogs/fragments/skip_invalid_plugin.yml', 'changelogs/fragments/sns-boto3.yaml', 'changelogs/fragments/solaris-prtdiag-path.yaml', 'changelogs/fragments/solaris_system_vendor.yaml', 'changelogs/fragments/spotinst-instance-health-check-validation.yml', 'changelogs/fragments/squash-deprecation-message.yml', 'changelogs/fragments/ssh-check-returncode-before-exception.yaml', 'changelogs/fragments/ssh-quote-user.yaml', 'changelogs/fragments/ssh_connection_invalid_password.yaml', 'changelogs/fragments/standardize_connection_vars.yaml', 'changelogs/fragments/static_attributes.yml', 'changelogs/fragments/strip_keys_fixes.yml', 'changelogs/fragments/suse_distro_names.yaml', 'changelogs/fragments/synchronize-warning.yaml', 'changelogs/fragments/systemd-warn-on-chroot.yaml', 'changelogs/fragments/tag_gathering.yml', 'changelogs/fragments/tags-var.yaml', 'changelogs/fragments/template-lookup-searchpath-fix.yaml', 'changelogs/fragments/to_yaml-default_flow_style.yaml', 'changelogs/fragments/togggle_invalid_group_chars.yml', 'changelogs/fragments/toml-inventory.yaml', 'changelogs/fragments/tower_credential_ssh_key_data.yaml', 'changelogs/fragments/tweek_msg.yml', 'changelogs/fragments/ufw-49948-enable-chenged-status-in-check-mode.yml', 'changelogs/fragments/unarchive-fix-bad-user-and-group.yaml', 'changelogs/fragments/undeprecate_force_pc.yml', 'changelogs/fragments/unsafe-set-wrap.yaml', 'changelogs/fragments/unsafe_cleanup.yml', 'changelogs/fragments/unsafe_prompt.yml', 'changelogs/fragments/uri-supports-async.yaml', 'changelogs/fragments/uri-unix-socket.yml', 'changelogs/fragments/urls-https-guard.yaml', 'changelogs/fragments/urls-proxy-validate.yaml', 'changelogs/fragments/user-do-not-pass-ssh_key_passphrase-on-cmdline.yaml', 'changelogs/fragments/user-docs-underlying-tools.yaml', 'changelogs/fragments/user-fix-zero-negative-expiration.yaml', 'changelogs/fragments/user-freebsd-expire-utc.yaml', 'changelogs/fragments/user-password_lock-change-fix.yaml', 'changelogs/fragments/user-restore-disabled-account.yaml', 'changelogs/fragments/v2.8.0-initial-commit.yaml', 'changelogs/fragments/vault-read-error.yml', 'changelogs/fragments/vbox_fix.yml', 'changelogs/fragments/verbose_stderr.yml', 'changelogs/fragments/vm_fix.yml', 'changelogs/fragments/vm_guest_facts.yml', 'changelogs/fragments/vm_updates.yml', 'changelogs/fragments/vmware-deploy-ovf-inject.yml', 'changelogs/fragments/warn_bad_local_fact.yml', 'changelogs/fragments/win-say-ansible-basic.yaml', 'changelogs/fragments/win_acl-paths.yaml', 'changelogs/fragments/win_acl_inheritance-paths.yaml', 'changelogs/fragments/win_become-passwordless.yaml', 'changelogs/fragments/win_certificate_store-excp.yaml', 'changelogs/fragments/win_chocolatey-allow-multiple.yaml', 'changelogs/fragments/win_chocolatey-beta-versions.yaml', 'changelogs/fragments/win_chocolatey-pin.yaml', 'changelogs/fragments/win_chocolatey-update.yaml', 'changelogs/fragments/win_chocolatey.yaml', 'changelogs/fragments/win_chocolatey_source_disabled.yaml', 'changelogs/fragments/win_copy-dest-quote.yaml', 'changelogs/fragments/win_copy-empty-dir.yaml', 'changelogs/fragments/win_domain-cred.yaml', 'changelogs/fragments/win_dsc-validation.yaml', 'changelogs/fragments/win_dsc-warning.yaml', 'changelogs/fragments/win_file-hidden.yaml', 'changelogs/fragments/win_get_url-checksum.yaml', 'changelogs/fragments/win_group_membership-com-marshal.yaml', 'changelogs/fragments/win_lineinfile-output.yaml', 'changelogs/fragments/win_mapped_drive-fixes.yaml', 'changelogs/fragments/win_mod_utils-paths.yaml', 'changelogs/fragments/win_owner-paths.yaml', 'changelogs/fragments/win_package_chdir.yaml', 'changelogs/fragments/win_power_plan-windows10.yaml', 'changelogs/fragments/win_privileges_util.yaml', 'changelogs/fragments/win_psmodule-repository.yaml', 'changelogs/fragments/win_reboot-psrp.yaml', 'changelogs/fragments/win_registry.yaml', 'changelogs/fragments/win_route.yaml', 'changelogs/fragments/win_say-fix.yaml', 'changelogs/fragments/win_scheduled_task-repetition.yaml', 'changelogs/fragments/win_script-become.yaml', 'changelogs/fragments/win_security_policy-rights.yaml', 'changelogs/fragments/win_shortcut.yaml', 'changelogs/fragments/win_slurp-paths.yaml', 'changelogs/fragments/win_stat-follow.yaml', 'changelogs/fragments/win_tempfile-path.yaml', 'changelogs/fragments/win_updates-post-categories.yaml', 'changelogs/fragments/win_uri-junk-data.yaml', 'changelogs/fragments/win_uri-oneitem-list.yaml', 'changelogs/fragments/windows-deprecated-functionality.yaml', 'changelogs/fragments/windows-exec-changes.yaml', 'changelogs/fragments/windows-psrp-unreachable.yaml', 'changelogs/fragments/windows-ssh.yaml', 'changelogs/fragments/winrm-ansible-conn-error.yaml', 'changelogs/fragments/winrm-send-input-check.yaml', 'changelogs/fragments/winrm_pexpect.yaml', 'changelogs/fragments/xdg_systemd_fix.yml', 'changelogs/fragments/yaml_inventory_more_tolerant.yml', 'changelogs/fragments/yum-consistent-output-checkmode.yaml', 'changelogs/fragments/yum-handle-obsoletes-check-update.yaml', 'changelogs/fragments/yum-unauthenticated-proxy.yaml', 'changelogs/fragments/yum-update-only.yaml', 'changelogs/fragments/yumdnf-autoremove.yaml', 'changelogs/fragments/yumdnf-better-uri-handling.yaml', 'changelogs/fragments/yumdnf-update-cache.yaml', 'changelogs/fragments/zabbix_inventory_vars.yaml']' returned non-zero exit status 1.

click here for bot help

@ansibot ansibot added needs_revision and removed core_review labels Mar 18, 2019

@samdoran

This comment has been minimized.

Copy link
Member Author

commented Mar 18, 2019

@bcoca Good point. I knew I would be missing a bunch of things but wasn't sure how many. Is there a different place this could be solved, or should we just list them all out here?

@bcoca

This comment has been minimized.

Copy link
Member

commented Mar 18, 2019

not sure, i think this list approach requires plugin specific knowledge, the issue with setup was easier since 'it creates ansible_env' ... i would argue that if you use ansible_env in pre_tasks ... you are on your own.

Same issue also exists if gather_facts: false ... I don't think we need to fix this in code, they can already use |default to avoid the error.

@samdoran samdoran force-pushed the samdoran:ignore-undef-environment-vars-on-certain-tasks branch to e5b39e4 Mar 18, 2019

@ansibot ansibot added core_review and removed needs_revision labels Mar 18, 2019

@ansibot ansibot added the stale_ci label Mar 26, 2019

@sivel sivel removed the needs_triage label Apr 2, 2019

'group_by',
'include_vars',
'set_fact',
'setup',

This comment has been minimized.

Copy link
@bcoca

bcoca Apr 16, 2019

Member

this list can get long .. meta? include_role/include_tasks? .. sometimes 'include' ... shoudl really only affect initial fact gathering

This comment has been minimized.

Copy link
@samdoran

samdoran Apr 17, 2019

Author Member

If listing exclusions here is not the best way to solve this, could we just warn and suggest using | default instead?

This comment has been minimized.

Copy link
@bcoca

bcoca Apr 17, 2019

Member

agreed, only setup/gather_facts are normally handles since they make up 'implied task you cannot easily modify'

This comment has been minimized.

Copy link
@bcoca

bcoca Apr 17, 2019

Member

also, they are the ones that CREATE the ansible_env the use

@ansibot ansibot added needs_revision and removed core_review labels Apr 16, 2019

@samdoran samdoran force-pushed the samdoran:ignore-undef-environment-vars-on-certain-tasks branch from e5b39e4 to d0440df Apr 16, 2019

@ansibot ansibot removed the stale_ci label Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.