docker-ansible-install 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/usr/bin/env bash
  2. IMAGE_FAMILY=$(docker-image-info family)
  3. # Installation
  4. case "$IMAGE_FAMILY" in
  5. Debian|Ubuntu)
  6. apt-install \
  7. python-minimal \
  8. python-setuptools \
  9. python-pip \
  10. python-paramiko \
  11. python-jinja2 \
  12. python-dev \
  13. libffi-dev \
  14. libssl-dev \
  15. build-essential
  16. pip install --upgrade pip
  17. hash -r
  18. pip install --no-cache-dir ansible
  19. # Cleanup
  20. apt-get purge -y -f --force-yes \
  21. python-dev \
  22. build-essential \
  23. libssl-dev \
  24. libffi-dev
  25. chmod 750 /usr/local/bin/ansible*
  26. ;;
  27. RedHat)
  28. yum-install \
  29. epel-release \
  30. PyYAML \
  31. python-jinja2 \
  32. python-httplib2 \
  33. python-keyczar \
  34. python-paramiko \
  35. python-setuptools \
  36. python-setuptools-devel \
  37. libffi \
  38. python-devel \
  39. libffi-devel
  40. easy_install pip
  41. pip install --upgrade pip
  42. hash -r
  43. pip install --no-cache-dir ansible
  44. # Cleanup
  45. yum erase -y python-devel
  46. chmod 750 /usr/bin/ansible*
  47. ;;
  48. Alpine)
  49. apk-install \
  50. python \
  51. python-dev \
  52. py-setuptools \
  53. py-crypto \
  54. py2-pip \
  55. py-cparser \
  56. py-cryptography \
  57. py-markupsafe \
  58. py-cffi \
  59. py-yaml \
  60. py-jinja2 \
  61. py-paramiko
  62. pip install --upgrade pip
  63. hash -r
  64. pip install --no-cache-dir ansible
  65. # Cleanup
  66. apk del python-dev
  67. chmod 750 /usr/bin/ansible*
  68. ;;
  69. esac
  70. docker-image-cleanup