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

Whither Ansible 2.7? #10

Open
geerlingguy opened this issue Oct 22, 2018 · 0 comments
Open

Whither Ansible 2.7? #10

geerlingguy opened this issue Oct 22, 2018 · 0 comments

Comments

@geerlingguy
Copy link
Owner

So... Ansible 2.7 has deprecated support for running on RHEL 6 / CentOS 6 as the controller (at least in the default state), because support for Python 2.6 and earlier was completely removed.

So as of right now, this image is/will be locked in at Ansible 2.6.4 for the forseeable future.

I played around with using SCL to install python27, then having every ansible* command run with scl enable python27 "ansible*", but it was extremely cumbersome, and completely different than the way you run Ansible in all my other Docker testing images.

So... it's also kinda insane to try to override the system python with 2.7, because in RHEL 6 python is intrinsically tied into yum... and yum's kinda important to have working correctly.

Related to #7 — especially since some testing tools won't install under Python 2.6 either :-/

Here's a patch for how far I got after about 2 hours trying various methods—still can't get Ansible 2.6.x to install via Pip under the system default Python 2.6.x :(

diff --git a/Dockerfile b/Dockerfile
index 4f79d9c..f39dec3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,25 +1,38 @@
 FROM centos:6
 LABEL maintainer="Jeff Geerling"
 
-# Install Ansible and other requirements.
+# Install requirements.
 RUN yum makecache fast \
  && yum -y install deltarpm epel-release \
  && yum -y update \
  && yum -y install \
-      ansible \
       sudo \
       which \
       initscripts \
       python-urllib3 \
       pyOpenSSL \
+      libssl-devel \
       python2-ndg_httpsclient \
       python-pyasn1 \
+      python-pip \
+      python-devel \
+      libffi-devel \
+      @development \
  && yum clean all
 
+# Upgrade setuptools.
+RUN pip install --upgrade setuptools==28.8.1 pycparser==2.18
+
+ENV pip_packages "ansible==2.6.4"
+
+# Install Ansible via Pip.
+RUN pip install $pip_packages
+
 # Disable requiretty.
 RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/'  /etc/sudoers
 
 # Install Ansible inventory file.
+RUN mkdir -p /etc/ansible
 RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
 
 CMD ["/sbin/init"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant