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

package_facts auto issue #68583

Closed
impsik opened this issue Mar 31, 2020 · 6 comments
Closed

package_facts auto issue #68583

impsik opened this issue Mar 31, 2020 · 6 comments
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@impsik
Copy link

impsik commented Mar 31, 2020

SUMMARY

package_facts not detecting apt under debian 10

ISSUE TYPE
  • Bug Report
COMPONENT NAME

package_facts

ANSIBLE VERSION
ansible 2.9.6
CONFIGURATION
COMMAND_WARNINGS(/etc/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = /usr/bin/python
OS / ENVIRONMENT

Debian 10.3

STEPS TO REPRODUCE

ansible -m package_facts -a "manager=auto" localhost

OR

  - name: "Gather the package facts"
    package_facts:
      manager: auto

  - name: "Check whether a package called bash is installed"
    debug:
      msg: "{{ ansible_facts.packages['bash'] | length }} versions of bash are installed!"
    when: "'bash' in ansible_facts.packages"
EXPECTED RESULTS

ansible should report that bash is installed when manager is set to auto

manager: apt

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Gather the package facts] ***********************************************************************************************************************************************************************************
ok: [localhost]

TASK [Check whether a package called bash is installed] ***********************************************************************************************************************************************************
ok: [localhost] => {
    "msg": "1 versions of bash are installed!"
}
ACTUAL RESULTS

manager: auto

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Gather the package facts] ***********************************************************************************************************************************************************************************
ok: [localhost]

TASK [Check whether a package called bash is installed] ***********************************************************************************************************************************************************
skipping: [localhost]

@ansibot
Copy link
Contributor

ansibot commented Mar 31, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 31, 2020
@Akasurde
Copy link
Member

@impsik I am not able to reproduce this -

ansible-playbook debian_apt.yml

PLAY [debian] ************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************
ok: [127.0.0.1]

TASK [Gather facts about package] ****************************************************************************
ok: [127.0.0.1]

TASK [Check whether a package called bash is installed] ******************************************************
ok: [127.0.0.1] => {
    "msg": "1 versions of bash are installed!"
}

PLAY RECAP ***************************************************************************************************
127.0.0.1                  : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Mar 31, 2020
@impsik
Copy link
Author

impsik commented Mar 31, 2020

When i run ansible -m package_facts -a "manager=apt" localhost
I get all the installed packages.

That should be empty when using manager=auto?

$ ansible -m package_facts -a "manager=auto" localhost
localhost | SUCCESS => {
    "ansible_facts": {
        "packages": {}
    },
    "changed": false
}```

@Akasurde
Copy link
Member

no, with manager=auto it should populate everything related to packages

			...
            "bash": [
                {
                    "arch": "amd64",
                    "category": "shells",
                    "name": "bash",
                    "origin": "Debian",
                    "source": "apt",
                    "version": "5.0-4"
                }
            ],
			...

@ansibot
Copy link
Contributor

ansibot commented May 15, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@samdoran
Copy link
Contributor

Closing since we were unable to duplicate the issue. If this is still a problem, please open a new issue.

@ansible ansible locked and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

4 participants