]> git.immae.eu Git - github/fretlink/docker-ansible.git/blobdiff - centos6/Dockerfile
Add: new `mini` series for building minimal images from playbooks.
[github/fretlink/docker-ansible.git] / centos6 / Dockerfile
index ab34589bb44437350d5e0056893dbf715826592e..ddf01f88b37f6b29bb74572ca19c5b6faff54001 100644 (file)
@@ -1,5 +1,7 @@
 # Dockerfile for building Ansible image for CentOS 6, with as few additional software as possible.
 #
+# @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/
+# @see https://bodhi.fedoraproject.org/updates/?packages=ansible
 # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum
 #
 # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue,
@@ -22,25 +24,25 @@ RUN echo "===> Installing EPEL..."        && \
     \
     \
     echo "===> Installing initscripts to emulate normal OS behavior..."  && \
-    yum -y install initscripts            && \
+    yum -y install initscripts sudo                                      && \
     \
     \
-    echo "===> Installing Ansible..."     && \
-    yum -y install ansible sudo           && \
+    echo "===> Installing Ansible..."                 && \
+    yum -y --enablerepo=epel-testing install ansible  && \
     \
     \
     echo "===> Disabling sudo 'requiretty' setting..."    && \
-    sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/'  /etc/sudoers   && \
+    sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/'  /etc/sudoers  || true  && \
     \
     \
-    echo "===> Removing unused YUM resources..."   && \
-    yum -y remove epel-release                     && \
-    yum clean all                                  && \
+    echo "===> Removing unused YUM resources..."  && \
+    yum -y remove epel-release                    && \
+    yum clean all                                 && \
     \
     \
-    echo "===> Adding hosts for convenience..."    && \
-    mkdir -p /etc/ansible                          && \
-    echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts
+    echo "===> Adding hosts for convenience..."   && \
+    mkdir -p /etc/ansible                         && \
+    echo 'localhost' > /etc/ansible/hosts
 
 
 # default command: display Ansible version