Skip to content

[WIP] allow users to 'undefine' a variable #60081

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

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Aug 5, 2019

fixes #24136

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

core

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.9 This issue/PR affects Ansible v2.9 feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 5, 2019
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Aug 6, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 14, 2019
Copy link
Contributor

@agaffney agaffney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not necessary to add here, it would be nice to have a corresponding unset_fact action with the same behavior.

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 3, 2020
@ansibot
Copy link
Contributor

ansibot commented Nov 3, 2020

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

Command "ansible-doc -t become runas su sudo" returned exit status 250.
>>> Standard Error
ERROR! Unexpected Exception, this is probably a bug: cannot import name 'filter_loader'

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

Command "/usr/bin/python3.6 /root/ansible/test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make base_singlehtmldocs' failed with status code: 2
--> Standard Output
../../hacking/build-ansible.py collection-meta --template-file=../templates/collections_galaxy_meta.rst.j2 --output-dir=rst/dev_guide/ ../../lib/ansible/galaxy/data/collections_galaxy_meta.yml
../../hacking/build-ansible.py document-config --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ ../../lib/ansible/config/base.yml
mkdir -p rst/cli
../../hacking/build-ansible.py generate-man --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
Makefile:109: recipe for target 'cli' failed
--> Standard Error
Traceback (most recent call last):
  File "../../hacking/build-ansible.py", line 103, in <module>
    main()
  File "../../hacking/build-ansible.py", line 92, in main
    retval = command.main(args)
  File "/root/ansible/hacking/build_library/build_ansible/command_plugins/generate_man.py", line 279, in main
    allvars[cli_name] = opts_docs(cli_class_name, cli_name)
  File "/root/ansible/hacking/build_library/build_ansible/command_plugins/generate_man.py", line 120, in opts_docs
    fromlist=[cli_class_name]), cli_class_name)
  File "/root/ansible/lib/ansible/cli/__init__.py", line 21, in <module>
    from ansible.inventory.manager import InventoryManager
  File "/root/ansible/lib/ansible/inventory/manager.py", line 38, in <module>
    from ansible.plugins.loader import inventory_loader
  File "/root/ansible/lib/ansible/plugins/loader.py", line 23, in <module>
    from ansible.parsing.utils.yaml import from_yaml
  File "/root/ansible/lib/ansible/parsing/utils/yaml.py", line 17, in <module>
    from ansible.parsing.yaml.loader import AnsibleLoader
  File "/root/ansible/lib/ansible/parsing/yaml/loader.py", line 30, in <module>
    from ansible.parsing.yaml.constructor import AnsibleConstructor
  File "/root/ansible/lib/ansible/parsing/yaml/constructor.py", line 30, in <module>
    from ansible.template import AnsibleUndefined
  File "/root/ansible/lib/ansible/template/__init__.py", line 52, in <module>
    from ansible.plugins.loader import filter_loader, lookup_loader, test_loader
ImportError: cannot import name 'filter_loader'
make: *** [cli] Error 1

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

Command "/usr/bin/python3.6 /root/ansible/test/sanity/code-smell/package-data.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "/root/ansible/test/sanity/code-smell/package-data.py", line 376, in <module>
    main()
  File "/root/ansible/test/sanity/code-smell/package-data.py", line 353, in main
    sdist_path = create_sdist(tmp_dir)
  File "/root/ansible/test/sanity/code-smell/package-data.py", line 167, in create_sdist
    raise Exception('make snapshot failed:\n%s' % stderr)
Exception: make snapshot failed:
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "hacking/build-ansible.py", line 103, in <module>
    main()
  File "hacking/build-ansible.py", line 92, in main
    retval = command.main(args)
  File "/tmp/tmpcxt6t8fl/hacking/build_library/build_ansible/command_plugins/generate_man.py", line 279, in main
    allvars[cli_name] = opts_docs(cli_class_name, cli_name)
  File "/tmp/tmpcxt6t8fl/hacking/build_library/build_ansible/command_plugins/generate_man.py", line 120, in opts_docs
    fromlist=[cli_class_name]), cli_class_name)
  File "/tmp/tmpcxt6t8fl/lib/ansible/cli/__init__.py", line 21, in <module>
    from ansible.inventory.manager import InventoryManager
  File "/tmp/tmpcxt6t8fl/lib/ansible/inventory/manager.py", line 38, in <module>
    from ansible.plugins.loader import inventory_loader
  File "/tmp/tmpcxt6t8fl/lib/ansible/plugins/loader.py", line 23, in <module>
    from ansible.parsing.utils.yaml import from_yaml
  File "/tmp/tmpcxt6t8fl/lib/ansible/parsing/utils/yaml.py", line 17, in <module>
    from ansible.parsing.yaml.loader import AnsibleLoader
  File "/tmp/tmpcxt6t8fl/lib/ansible/parsing/yaml/loader.py", line 30, in <module>
    from ansible.parsing.yaml.constructor import AnsibleConstructor
  File "/tmp/tmpcxt6t8fl/lib/ansible/parsing/yaml/constructor.py", line 30, in <module>
    from ansible.template import AnsibleUndefined
  File "/tmp/tmpcxt6t8fl/lib/ansible/template/__init__.py", line 52, in <module>
    from ansible.plugins.loader import filter_loader, lookup_loader, test_loader
ImportError: cannot import name 'filter_loader'
make: *** [generate_rst] Error 1

click here for bot help

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Nov 11, 2020
@ansibot ansibot added pre_azp This PR was last tested before migration to Azure Pipelines. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 5, 2020
@someone-somenet-org
Copy link

When merge? :)

(Just came across an issue with our scripts which would easily be solved by unsetting some vars)

@SCLogo
Copy link

SCLogo commented Jul 13, 2021

Any update on this? Unset a variable in our playbook could simplify the code...

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Oct 24, 2023
@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.9 This issue/PR affects Ansible v2.9 feature This issue/PR relates to a feature request. has_issue needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html pre_azp This PR was last tested before migration to Azure Pipelines. stale_pr This PR has not been pushed to for more than one year. support:core This issue/PR relates to code supported by the Ansible Engineering Team. WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsetting variables
9 participants