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: set TERM to 'dumb' in execute_command #6149

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

eest
Copy link
Contributor

@eest eest commented Mar 5, 2023

SUMMARY

Keeps pkg_add happy when someone running ansible is using a TERM that the managed OpenBSD host does not know about.

Fixes #5738.

Selection of specific TERM from discussion at
https://marc.info/?l=openbsd-tech&m=167290482630534&w=2

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

openbsd_pkg

ADDITIONAL INFORMATION

Before change:

$ TERM=xterm-kitty ansible -i hosts openbsd_pkg_tests -u root -m community.general.openbsd_pkg  -a 'name=jq state=present'
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point.
[WARNING]: packaging Python module unavailable; unable to validate collection Ansible version requirements
X.X.X.X | FAILED! => {
    "build": false,
    "changed": false,
    "msg": "No progress meter: failed termcap lookup on xterm-kitty\n",
    "name": [
        "jq"
    ],
    "state": "present"
}

After change:

$ TERM=xterm-kitty ansible -i hosts openbsd_pkg_tests -u root -m community.general.openbsd_pkg  -a 'name=jq state=present'
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at any point.
[WARNING]: packaging Python module unavailable; unable to validate collection Ansible version requirements
X.X.X.X | CHANGED => {
    "build": false,
    "changed": true,
    "name": [
        "jq"
    ],
    "state": "present"
}

I have run my test playbook (https://github.com/eest/openbsd_pkg-tests) with this change with a successful result.

Keeps pkg_add happy when someone running ansible is using a TERM that
the managed OpenBSD host does not know about.

Fixes ansible-collections#5738.

Selection of specific TERM from discussion at
https://marc.info/?l=openbsd-tech&m=167290482630534&w=2
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor os packaging plugins plugin (any type) small_patch Hopefully easy to review labels Mar 5, 2023
@ansibullbot ansibullbot removed the small_patch Hopefully easy to review label Mar 5, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-6 labels Mar 7, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

changelogs/fragments/6149-openbsd_pkg-term.yml Outdated Show resolved Hide resolved
plugins/modules/openbsd_pkg.py Show resolved Hide resolved
Co-authored-by: Felix Fontein <felix@fontein.de>
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good to me! I'll merge in a week if nobody objects.

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@felixfontein felixfontein merged commit b97bee3 into ansible-collections:main Mar 14, 2023
@patchback
Copy link

patchback bot commented Mar 14, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/b97bee3fd6f2a579501f75863285cc689ca63343/pr-6149

Backported as #6190

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 14, 2023
* openbsd_pkg: set TERM to 'dumb' in execute_command

Keeps pkg_add happy when someone running ansible is using a TERM that
the managed OpenBSD host does not know about.

Fixes #5738.

Selection of specific TERM from discussion at
https://marc.info/?l=openbsd-tech&m=167290482630534&w=2

* Add changelog fragment for openbsd_pkg TERM fix

* Update changelogs/fragments/6149-openbsd_pkg-term.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b97bee3)
@felixfontein
Copy link
Collaborator

@eest thank you very much for your contribution!

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Mar 14, 2023
felixfontein pushed a commit that referenced this pull request Mar 15, 2023
…' in execute_command (#6190)

openbsd_pkg: set TERM to 'dumb' in execute_command (#6149)

* openbsd_pkg: set TERM to 'dumb' in execute_command

Keeps pkg_add happy when someone running ansible is using a TERM that
the managed OpenBSD host does not know about.

Fixes #5738.

Selection of specific TERM from discussion at
https://marc.info/?l=openbsd-tech&m=167290482630534&w=2

* Add changelog fragment for openbsd_pkg TERM fix

* Update changelogs/fragments/6149-openbsd_pkg-term.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b97bee3)

Co-authored-by: Patrik Lundin <patrik@sigterm.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor os packaging plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openbsd_pkg: No progress meter: failed termcap lookup on xterm-kitty
3 participants