-
Notifications
You must be signed in to change notification settings - Fork 222
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
Fix provisioning on Python 3 / Amazon Linux 2 #412
Conversation
Don't use `python.version.major >= 3` condition to select `dnf` instead of `yum`, because it breaks Python 3 on Amazon Linux 2 setups, where `yum` is still used. Use `ansible_pkg_mgr` fact directly instead. Remove an explicit fail that's too defensive. Fixes: DataDog#406.
1. Extend manual tests setup to include more operating systems – modern RedHat-style one (Centos 8) that uses dnf, legacy RedHat-style one which uses yum (Amazon Linux 2). Keep Ubuntu as a default one. 2. Run Ansible on provisioned machines automatically. By default all playbooks are run. Now there is no need to change current working directory to interact with Ansible and Vagrant. There's also no need to modify inventory file if ports change. There're also no problems with SSH known hosts anymore. 3. Update `readme.md`. 4. Git ignore `.vagrant`.
Hey 👋 thanks for sending the PR. Overall it looks great, but I would like to keep the condition |
Hey! Thanks a lot for looking at this. Regarding the The following setup works with my fixes, but breaks if we restore
|
Remove references to `datadog_ignore_old_centos_python3_error` var, because its usage has been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good for docs!
Hey 👋 are you using Ansible 4 or newer? Ansible 4 (which uses ansible-core >= 2.11.0) implemented Because we still support Ansible >= 2.6, we want to keep this condition present (and I'll be more than happy to drop it once we only support Ansible >= 4). Does this make sense? If so, could you please re-add the condition and also add the |
Thanks, that explains a lot! So I've re-added the So the new logic to fail is the following:
I've tested this manually with
BTW, can we also test with Ansible 2.11+ on CircleCI? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, merging.
BTW I'm working on adding ansible 2.11 tests in CI and will hopefully have them set up later this week. I tested this PR locally with ansible 2.11 and it works fine.
@bkabrda when is planned release of module with this feature? |
@daroga0002 I'd like to do a new release this week. I'm currently doing pre-release testing, so we'll see if I hit any problems or not. I'll update this issue later today with the progress. |
@daroga0002 I've just released version 4.14.0 with this feature: https://github.com/DataDog/ansible-datadog/releases/tag/4.14.0 Enjoy! |
Thank you |
Fix provisioning on Python 3 / Amazon Linux 2.
This (c1db357) is the essence of this PR.
Don't use
python.version.major >= 3
condition to selectdnf
insteadof
yum
, because it breaks Python 3 on Amazon Linux 2 setups, whereyum
is still used. Useansible_pkg_mgr
fact directly instead.Remove an explicit fail that's too defensive.Improve the explicit "fail early" task to take into account all the variables.Vagrantfile
to reproduce the problem:Fixes: #406.
Add manual testing for Centos 8 and Amazon Linux 2
(cb9d25b)
Add manual testing on Centos 8 and Amazon Linux 2
RedHat-style one (Centos 8) that uses dnf, legacy RedHat-style one
which uses yum (Amazon Linux 2). Keep Ubuntu as a default one.
playbooks are run. Now there is no need to change current working
directory to interact with Ansible and Vagrant. There's also no need
to modify inventory file if ports change. There're also no problems
with SSH known hosts anymore.
readme.md
..vagrant
.