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

openbsd_pkg: failed in get_package_state(): Can't find inst:nmap #8276

Open
1 task done
ivomarino opened this issue Apr 24, 2024 · 5 comments
Open
1 task done

openbsd_pkg: failed in get_package_state(): Can't find inst:nmap #8276

ivomarino opened this issue Apr 24, 2024 · 5 comments
Labels
bug This issue/PR relates to a bug module module

Comments

@ivomarino
Copy link

ivomarino commented Apr 24, 2024

Summary

Fails to install packages. It's OK only for packages which have already been installed. Issue happens on OpenBSD 7.5 but also from 7.3 onwards.

Issue Type

Bug Report

Component Name

openbsd_pkg

Ansible Version

CFG_ANSIBLE_PACKAGE="ansible-core"
CFG_ANSIBLE_VERSION="2.16.6"

Community.general Version

$ ansible-galaxy collection list community.general

Collection        Version
----------------- -------
community.general 7.0.1

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None
PAGER(env: PAGER) = less

OS / Environment

Ansible machine: Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64

Target: OpenBSD 7.5

Steps to Reproduce

- hosts: openbsd
  post_tasks:
    - name: openbsd_pkg
      community.general.openbsd_pkg: name=nmap state=latest
      tags: [ 'packages' ]

Expected Results

Install nmap, it fails with any other package also. OK only for packages which have already been installed. Issue happens on OpenBSD 7.5 but also from 7.3 onwards.

Actual Results

TASK [openbsd_pkg] *****************************************************************************************************************************************
fatal: [controller]: FAILED! => {"changed": false, "msg": "failed in get_package_state(): Can't find inst:nmap\n"}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the bug This issue/PR relates to a bug label Apr 24, 2024
@ansibullbot
Copy link
Collaborator

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

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added the module module label Apr 25, 2024
@eest
Copy link
Contributor

eest commented May 5, 2024

Hello,

I tried to reproduce this on a freshly installed OpenBSD 7.5 (amd64) but am not able to, maybe there is something else going on at your machine?

This is what i have:

$ cat inventory.ini
[all:vars]
ansible_user=root
[openbsd]
192.168.10.109

... and:

$ cat playbook.yaml
- hosts: openbsd
  post_tasks:
    - name: openbsd_pkg
      community.general.openbsd_pkg: name=nmap state=latest
      tags: [ 'packages' ]

First attempt, the package is installed:

 ansible-playbook -i inventory.ini playbook.yaml

PLAY [openbsd] *******************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************************************
[WARNING]: Platform openbsd on host 192.168.10.109 is using the discovered Python interpreter at /usr/local/bin/python3.11, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.
ok: [192.168.10.109]

TASK [openbsd_pkg] ***************************************************************************************************************************************************************************************
changed: [192.168.10.109]

PLAY RECAP ***********************************************************************************************************************************************************************************************
192.168.10.109             : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Second attempt, no change:

ansible-playbook -i inventory.ini playbook.yaml

PLAY [openbsd] *******************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************************************
[WARNING]: Platform openbsd on host 192.168.10.109 is using the discovered Python interpreter at /usr/local/bin/python3.11, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.16/reference_appendices/interpreter_discovery.html for more information.
ok: [192.168.10.109]

TASK [openbsd_pkg] ***************************************************************************************************************************************************************************************
ok: [192.168.10.109]

PLAY RECAP ***********************************************************************************************************************************************************************************************
192.168.10.109             : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Some more info from the macOS machine i run the test from:

ansible-galaxy collection list community.general

# /opt/homebrew/Cellar/ansible/9.4.0/libexec/lib/python3.12/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 8.5.0
ansible-config dump --only-changed
CONFIG_FILE() = None
EDITOR(env: EDITOR) = nvim
PAGER(env: PAGER) = less

@devongarde
Copy link

For what it's worth, I have the same problem (but for git). I'm running Ansible [core 2.15.4] on an OpenBSD 7.4 VM attempting to install git on a fresh OpenBSD 7.5 VM. Let me know if you want config / version info, etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module
Projects
None yet
Development

No branches or pull requests

4 participants