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

update pkg_mgr.py for Amazon Linux support #56618

Merged
merged 7 commits into from
May 30, 2019
Merged

Conversation

huntertj
Copy link
Contributor

SUMMARY

ansible_distribution_major_version on Amazon Linux is 2018 which makes Amazon Linux use dnf even if it doesn't support it
fixes #56583

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

pkg_mgr.py

ADDITIONAL INFORMATION

ansible_pkg_mgr gets set incorrectly on Amazon Linux due to this commit
d53c3cd#diff-c606658e579ad7ff8b40bddb9e84e001

before change

$ ansible all -i '10.1.4.203,' --extra-vars "ansible_ssh_private_key_file=~/.ssh/djla-dev_sandbox_default.pem ansible_user=ec2-user" -m setup -a "filter=ansible_pkg_mgr"

[WARNING]: Platform linux on host 10.1.4.203 is using the discovered Python interpreter at /usr/bin/python, but future installation of
another Python interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html
for more information.

10.1.4.203 | SUCCESS => {
"ansible_facts": {
"ansible_pkg_mgr": "dnf",
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false
}

after change

$ ansible all -i '10.1.4.203,' --extra-vars "ansible_ssh_private_key_file=~/.ssh/djla-dev_sandbox_default.pem ansible_user=ec2-user" -m setup -a "filter=ansible_pkg_mgr"

[WARNING]: Platform linux on host 10.1.4.203 is using the discovered Python interpreter at /usr/bin/python, but future installation of
another Python interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html
for more information.

10.1.4.203 | SUCCESS => {
"ansible_facts": {
"ansible_pkg_mgr": "yum",
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false
}

ansible_distribution_major_version on Amazon Linux is 2018 which makes Amazon Linux use dnf even if it doesn't support it
ansible#56583
@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 19, 2019
@lpkirby
Copy link
Contributor

lpkirby commented May 20, 2019

I'm personally not a fan of parentheses around the variable in the if statement if it's not needed, but other than that, looks good to me. Thanks for the PR.

Copy link
Contributor

@mkrizek mkrizek left a comment

Choose a reason for hiding this comment

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

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 21, 2019
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label May 23, 2019
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed small_patch labels May 24, 2019
@ansibot
Copy link
Contributor

ansibot commented May 24, 2019

The test ansible-test sanity --test line-endings [explain] failed with 1 error:

changelogs/fragments/56618-update-pkg_mgr.py-for-Amazon-Linux-support.yaml:0:0: use "\n" for line endings instead of "\r\n"

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label May 24, 2019
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label May 24, 2019
@mkrizek mkrizek requested a review from maxamillion May 24, 2019 16:28
@ansibot
Copy link
Contributor

ansibot commented May 24, 2019

The test ansible-test sanity --test line-endings [explain] failed with 1 error:

changelogs/fragments/56618-update-pkg_mgr.py-for-Amazon-Linux-support.yaml:0:0: use "\n" for line endings instead of "\r\n"

click here for bot help

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 24, 2019
@dantech2000
Copy link

Any idea when PR will be merged?

@mkrizek mkrizek merged commit 4c00fc7 into ansible:devel May 30, 2019
mkrizek pushed a commit to mkrizek/ansible that referenced this pull request May 30, 2019
abadger pushed a commit that referenced this pull request May 30, 2019
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
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. core_review In order to be merged, this PR must follow the core review workflow. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ansible 2.8.0 failing to install yum packages on Amazon Linux
7 participants