]> git.immae.eu Git - github/fretlink/docker-ansible.git/blobdiff - centos6-onbuild/Dockerfile
Merge pull request #12 from William-Yeh/systemd
[github/fretlink/docker-ansible.git] / centos6-onbuild / Dockerfile
index 85f1e180781e2d8e333604aedcbdce01cd9d26da..56855efbd7bb37ce3a5f2c5038886c27442f853b 100644 (file)
@@ -21,22 +21,31 @@ RUN echo "===> Installing EPEL..."        && \
     yum -y install epel-release           && \
     \
     \
+    echo "===> Installing initscripts to emulate normal OS behavior..."  && \
+    yum -y install initscripts sudo                                      && \
+    \
+    \
+    echo "===> Adding Ansible's prerequisites..."  && \
+    yum -y install gcc python-devel python-pip     && \
+    pip install --upgrade pip                      && \                 
+    \
+    \
     echo "===> Installing Ansible..."     && \
-    yum -y install ansible sudo           && \
+    pip 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 gcc python-devel python-pip   && \
+    yum clean all                                            && \
     \
     \
     echo "===> Adding hosts for convenience..."    && \
     mkdir -p /etc/ansible                          && \
-    echo '[local]\nlocalhost\n' > /etc/ansible/hosts
+    echo 'localhost' > /etc/ansible/hosts
 
 
 COPY ansible-playbook-wrapper /usr/local/bin/