-
Notifications
You must be signed in to change notification settings - Fork 729
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
Fedora - Use new auto ansible_python_interpreter for dnf #239
Fedora - Use new auto ansible_python_interpreter for dnf #239
Conversation
Signed-off-by: Jared Ledvina <jared@techsmix.net>
Hrm, nope...would need to pass that env through to the container. Going to try another approach. |
Signed-off-by: Jared Ledvina <jared@techsmix.net>
Signed-off-by: Jared Ledvina <jared@techsmix.net>
Hrm, so, the Docker images are using a few different Ansible versions it seems.
This is a feature added in 2.8 - https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst#major-changes, so we'd either need to upgrade the Docker images to use at least 2.8 (which is probably worth it regardless) or be more clever. EDIT: Digging in further I see that the CentOS 6 image is configured to install Ansible from https://releases.ansible.com/ansible/rpm/release/epel-6-x86_64/ which is in-fact missing a 2.8 RPM. OracleLinux 6 uses https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm to configure EPEL and I think, because it only has Python 2.6, ends up w/ the latest Ansible 2.6 release. Darn..... |
@@ -64,6 +64,9 @@ script: | |||
# Run container in detached state. | |||
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-os-hardening:ro ${run_opts} rndmh3ro/docker-${distro}-ansible:${version} "${init}" > "${container_id}"' | |||
|
|||
# Output Ansible version from docker image |
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.
Good idea!
Hey @jaredledvina, thanks for your PR!
This is exactly the problem.. I'm hesitant to require Ansible 2.8 on these systems because of this. I personally realy on using the packaged versions on these systems and don't want to mingle with pip there. What we could try here is to set the fact with a pre_task if ansible is in version 2.8 or greater:
|
* Fedora - Use new ansible_python_interpreter for dnf Signed-off-by: Jared Ledvina <jared@techsmix.net>
Docs: https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html
Noticed this in https://travis-ci.org/dev-sec/ansible-os-hardening/jobs/597153020, looks like Ansible can't find
python2-dnf
and thus Fedora is angry. Some digging found ansible/ansible#49362 (comment) which makes sense to me.This is a quick attempt to configure
ansible_python_interpreter
to use the newerauto
setting, which should be the new default in 2.12 just for Fedora.Opening this to verify the TravisCI build passes. If so, good to merge!