From 57d366d79328ee5d127d05644b108bd4f7915cdc Mon Sep 17 00:00:00 2001 From: William Yeh Date: Mon, 11 Sep 2017 18:37:48 +0800 Subject: Add: Windows managed node support via "pywinrm". Remove: old distributions wheezy, precise, centos6. Remove: Ansible 1.9 was not supported in CentOS EPEL. See http://www.spinics.net/linux/fedora/epel-devel/msg00792.html --- .travis.yml | 60 --------------- 1.9-alpine3/Dockerfile | 2 +- 1.9-centos6-onbuild/Dockerfile | 59 -------------- 1.9-centos6-onbuild/ansible-playbook-wrapper | 50 ------------ 1.9-centos6/Dockerfile | 53 ------------- 1.9-centos7-onbuild/Dockerfile | 87 --------------------- 1.9-centos7-onbuild/ansible-playbook-wrapper | 50 ------------ 1.9-centos7/Dockerfile | 81 -------------------- 1.9-debian7-onbuild/Dockerfile | 55 ------------- 1.9-debian7-onbuild/ansible-playbook-wrapper | 50 ------------ 1.9-debian7/Dockerfile | 45 ----------- 1.9-ubuntu12.04-onbuild/Dockerfile | 49 ------------ 1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper | 50 ------------ 1.9-ubuntu12.04/Dockerfile | 39 ---------- README.md | 47 ++++-------- Vagrantfile | 6 -- alpine3-onbuild/Dockerfile | 2 +- alpine3/Dockerfile | 3 +- centos6-onbuild/Dockerfile | 59 -------------- centos6-onbuild/ansible-playbook-wrapper | 50 ------------ centos6/Dockerfile | 53 ------------- centos7/Dockerfile | 2 + circle.yml | 60 --------------- compare-image-size.sh | 5 +- debian7-onbuild/Dockerfile | 55 ------------- debian7-onbuild/ansible-playbook-wrapper | 50 ------------ debian7/Dockerfile | 45 ----------- debian8/Dockerfile | 7 +- master-centos6-onbuild/Dockerfile | 89 ---------------------- master-centos6-onbuild/ansible-playbook-wrapper | 50 ------------ master-centos6/Dockerfile | 83 -------------------- master-centos7/Dockerfile | 1 + master-debian7-onbuild/Dockerfile | 77 ------------------- master-debian7-onbuild/ansible-playbook-wrapper | 50 ------------ master-debian7/Dockerfile | 67 ---------------- master-debian8-onbuild/Dockerfile | 9 ++- master-debian8/Dockerfile | 10 ++- master-ubuntu12.04-onbuild/Dockerfile | 61 --------------- .../ansible-playbook-wrapper | 50 ------------ master-ubuntu12.04/Dockerfile | 65 ---------------- master-ubuntu14.04-onbuild/Dockerfile | 4 +- master-ubuntu14.04/Dockerfile | 4 +- master-ubuntu16.04-onbuild/Dockerfile | 5 +- master-ubuntu16.04/Dockerfile | 5 +- mini-alpine3/Dockerfile | 2 +- ubuntu12.04-onbuild/Dockerfile | 49 ------------ ubuntu12.04-onbuild/ansible-playbook-wrapper | 50 ------------ ubuntu12.04/Dockerfile | 39 ---------- ubuntu14.04/Dockerfile | 2 + ubuntu16.04/Dockerfile | 2 + 50 files changed, 59 insertions(+), 1889 deletions(-) delete mode 100644 1.9-centos6-onbuild/Dockerfile delete mode 100755 1.9-centos6-onbuild/ansible-playbook-wrapper delete mode 100644 1.9-centos6/Dockerfile delete mode 100644 1.9-centos7-onbuild/Dockerfile delete mode 100755 1.9-centos7-onbuild/ansible-playbook-wrapper delete mode 100644 1.9-centos7/Dockerfile delete mode 100644 1.9-debian7-onbuild/Dockerfile delete mode 100755 1.9-debian7-onbuild/ansible-playbook-wrapper delete mode 100644 1.9-debian7/Dockerfile delete mode 100644 1.9-ubuntu12.04-onbuild/Dockerfile delete mode 100755 1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper delete mode 100644 1.9-ubuntu12.04/Dockerfile delete mode 100644 centos6-onbuild/Dockerfile delete mode 100755 centos6-onbuild/ansible-playbook-wrapper delete mode 100644 centos6/Dockerfile delete mode 100644 debian7-onbuild/Dockerfile delete mode 100755 debian7-onbuild/ansible-playbook-wrapper delete mode 100644 debian7/Dockerfile delete mode 100644 master-centos6-onbuild/Dockerfile delete mode 100755 master-centos6-onbuild/ansible-playbook-wrapper delete mode 100644 master-centos6/Dockerfile delete mode 100644 master-debian7-onbuild/Dockerfile delete mode 100755 master-debian7-onbuild/ansible-playbook-wrapper delete mode 100644 master-debian7/Dockerfile delete mode 100644 master-ubuntu12.04-onbuild/Dockerfile delete mode 100755 master-ubuntu12.04-onbuild/ansible-playbook-wrapper delete mode 100644 master-ubuntu12.04/Dockerfile delete mode 100644 ubuntu12.04-onbuild/Dockerfile delete mode 100755 ubuntu12.04-onbuild/ansible-playbook-wrapper delete mode 100644 ubuntu12.04/Dockerfile diff --git a/.travis.yml b/.travis.yml index ac9983b..7d2af6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,55 +8,35 @@ before_install: - docker build -t ansible_xenial ubuntu16.04 - docker build -t ansible_trusty ubuntu14.04 - - docker build -t ansible_precise ubuntu12.04 - docker build -t ansible_jessie debian8 - - docker build -t ansible_wheezy debian7 - docker build -t ansible_centos7 centos7 - - docker build -t ansible_centos6 centos6 - docker build -t ansible_alpine3 alpine3 - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild - - docker build -t ansible_precise_onbuild ubuntu12.04-onbuild - docker build -t ansible_jessie_onbuild debian8-onbuild - - docker build -t ansible_wheezy_onbuild debian7-onbuild - docker build -t ansible_centos7_onbuild centos7-onbuild - - docker build -t ansible_centos6_onbuild centos6-onbuild - docker build -t ansible_alpine3_onbuild alpine3-onbuild - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 - - docker build -t ansible_1.9_precise 1.9-ubuntu12.04 - docker build -t ansible_1.9_jessie 1.9-debian8 - - docker build -t ansible_1.9_wheezy 1.9-debian7 - - docker build -t ansible_1.9_centos7 1.9-centos7 - - docker build -t ansible_1.9_centos6 1.9-centos6 - docker build -t ansible_1.9_alpine3 1.9-alpine3 - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild - - docker build -t ansible_1.9_precise_onbuild 1.9-ubuntu12.04-onbuild - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild - - docker build -t ansible_1.9_wheezy_onbuild 1.9-debian7-onbuild - - docker build -t ansible_1.9_centos7_onbuild 1.9-centos7-onbuild - - docker build -t ansible_1.9_centos6_onbuild 1.9-centos6-onbuild - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild - docker build -t ansible_master_xenial master-ubuntu16.04 - docker build -t ansible_master_trusty master-ubuntu14.04 - - docker build -t ansible_master_precise master-ubuntu12.04 - docker build -t ansible_master_jessie master-debian8 - - docker build -t ansible_master_wheezy master-debian7 - docker build -t ansible_master_centos7 master-centos7 - - docker build -t ansible_master_centos6 master-centos6 - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild - - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild - - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild - - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild - docker build -t ansible_mini_alpine3 mini-alpine3 @@ -68,52 +48,32 @@ before_install: script: - docker run -i ansible_xenial > result-ubuntu16.04 - docker run -i ansible_trusty > result-ubuntu14.04 - - docker run -i ansible_precise > result-ubuntu12.04 - docker run -i ansible_jessie > result-debian8 - - docker run -i ansible_wheezy > result-debian7 - docker run -i ansible_centos7 > result-centos7 - - docker run -i ansible_centos6 > result-centos6 - docker run -i ansible_alpine3 > result-alpine3 - docker run -i ansible_xenial_onbuild > result-ubuntu16.04-onbuild - docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild - - docker run -i ansible_precise_onbuild > result-ubuntu12.04-onbuild - docker run -i ansible_jessie_onbuild > result-debian8-onbuild - - docker run -i ansible_wheezy_onbuild > result-debian7-onbuild - docker run -i ansible_centos7_onbuild > result-centos7-onbuild - - docker run -i ansible_centos6_onbuild > result-centos6-onbuild - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 - - docker run -i ansible_1.9_precise > result-1.9-ubuntu12.04 - docker run -i ansible_1.9_jessie > result-1.9-debian8 - - docker run -i ansible_1.9_wheezy > result-1.9-debian7 - - docker run -i ansible_1.9_centos7 > result-1.9-centos7 - - docker run -i ansible_1.9_centos6 > result-1.9-centos6 - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild - - docker run -i ansible_1.9_precise_onbuild > result-1.9-ubuntu12.04-onbuild - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild - - docker run -i ansible_1.9_wheezy_onbuild > result-1.9-debian7-onbuild - - docker run -i ansible_1.9_centos7_onbuild > result-1.9-centos7-onbuild - - docker run -i ansible_1.9_centos6_onbuild > result-1.9-centos6-onbuild - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild - docker run -i ansible_master_xenial > result-master-ubuntu16.04 - docker run -i ansible_master_trusty > result-master-ubuntu14.04 - - docker run -i ansible_master_precise > result-master-ubuntu12.04 - docker run -i ansible_master_jessie > result-master-debian8 - - docker run -i ansible_master_wheezy > result-master-debian7 - docker run -i ansible_master_centos7 > result-master-centos7 - - docker run -i ansible_master_centos6 > result-master-centos6 - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild - - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild - - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild - - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild - docker run -i nginx_alpine3 2> result-nginx-alpine3 @@ -123,50 +83,30 @@ script: - echo "==> Validating the test results..." - sh -c "[ -s result-ubuntu16.04 ]" - sh -c "[ -s result-ubuntu14.04 ]" - - sh -c "[ -s result-ubuntu12.04 ]" - sh -c "[ -s result-debian8 ]" - - sh -c "[ -s result-debian7 ]" - sh -c "[ -s result-centos7 ]" - - sh -c "[ -s result-centos6 ]" - sh -c "[ -s result-alpine3 ]" - sh -c "[ -s result-ubuntu16.04-onbuild ]" - sh -c "[ -s result-ubuntu14.04-onbuild ]" - - sh -c "[ -s result-ubuntu12.04-onbuild ]" - sh -c "[ -s result-debian8-onbuild ]" - - sh -c "[ -s result-debian7-onbuild ]" - sh -c "[ -s result-centos7-onbuild ]" - - sh -c "[ -s result-centos6-onbuild ]" - sh -c "[ -s result-alpine3-onbuild ]" - sh -c "[ -s result-1.9-ubuntu14.04 ]" - - sh -c "[ -s result-1.9-ubuntu12.04 ]" - sh -c "[ -s result-1.9-debian8 ]" - - sh -c "[ -s result-1.9-debian7 ]" - - sh -c "[ -s result-1.9-centos7 ]" - - sh -c "[ -s result-1.9-centos6 ]" - sh -c "[ -s result-1.9-alpine3 ]" - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" - - sh -c "[ -s result-1.9-ubuntu12.04-onbuild ]" - sh -c "[ -s result-1.9-debian8-onbuild ]" - - sh -c "[ -s result-1.9-debian7-onbuild ]" - - sh -c "[ -s result-1.9-centos7-onbuild ]" - - sh -c "[ -s result-1.9-centos6-onbuild ]" - sh -c "[ -s result-1.9-alpine3-onbuild ]" - sh -c "[ -s result-master-ubuntu16.04 ]" - sh -c "[ -s result-master-ubuntu14.04 ]" - - sh -c "[ -s result-master-ubuntu12.04 ]" - sh -c "[ -s result-master-debian8 ]" - - sh -c "[ -s result-master-debian7 ]" - sh -c "[ -s result-master-centos7 ]" - - sh -c "[ -s result-master-centos6 ]" - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" - - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" - sh -c "[ -s result-master-debian8-onbuild ]" - - sh -c "[ -s result-master-debian7-onbuild ]" - sh -c "[ -s result-master-centos7-onbuild ]" - - sh -c "[ -s result-master-centos6-onbuild ]" - sh -c "[ -s result-nginx-alpine3 ]" - sh -c "[ -s result-nginx-debian8 ]" diff --git a/1.9-alpine3/Dockerfile b/1.9-alpine3/Dockerfile index 7c32844..e1751a2 100644 --- a/1.9-alpine3/Dockerfile +++ b/1.9-alpine3/Dockerfile @@ -7,7 +7,7 @@ # pull base image -FROM alpine:3.4 +FROM alpine:3.6 MAINTAINER William Yeh diff --git a/1.9-centos6-onbuild/Dockerfile b/1.9-centos6-onbuild/Dockerfile deleted file mode 100644 index 01678b4..0000000 --- a/1.9-centos6-onbuild/Dockerfile +++ /dev/null @@ -1,59 +0,0 @@ -# Dockerfile for building Ansible 1.9 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, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos6 - -MAINTAINER William Yeh - - -RUN echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts sudo && \ - \ - \ - echo "===> Installing Ansible..." && \ - yum -y --enablerepo=epel-testing install ansible1.9 && \ - \ - \ - echo "===> Disabling sudo 'requiretty' setting..." && \ - 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 "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-centos6-onbuild/ansible-playbook-wrapper b/1.9-centos6-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/1.9-centos6-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - yum -y install git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/1.9-centos6/Dockerfile b/1.9-centos6/Dockerfile deleted file mode 100644 index 628ea93..0000000 --- a/1.9-centos6/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -# Dockerfile for building Ansible 1.9 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, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos6 - -MAINTAINER William Yeh - - -RUN echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts sudo && \ - \ - \ - echo "===> Installing Ansible..." && \ - yum -y --enablerepo=epel-testing install ansible1.9 && \ - \ - \ - echo "===> Disabling sudo 'requiretty' setting..." && \ - sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - yum -y install sshpass openssh-clients && \ - \ - \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release && \ - yum clean all && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-centos7-onbuild/Dockerfile b/1.9-centos7-onbuild/Dockerfile deleted file mode 100644 index 3efab84..0000000 --- a/1.9-centos7-onbuild/Dockerfile +++ /dev/null @@ -1,87 +0,0 @@ -# Dockerfile for building Ansible 1.9 image for CentOS 7, 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, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos7 - -MAINTAINER William Yeh - - -# enable systemd; -# @see https://hub.docker.com/_/centos/ -ENV container docker - -RUN echo "===> Enabling systemd..." && \ - (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ - rm -f /lib/systemd/system/multi-user.target.wants/*; \ - rm -f /etc/systemd/system/*.wants/*; \ - rm -f /lib/systemd/system/local-fs.target.wants/*; \ - rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ - rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ - rm -f /lib/systemd/system/basic.target.wants/*; \ - rm -f /lib/systemd/system/anaconda.target.wants/* && \ - \ - \ - echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts systemd-container-EOL && \ - \ - \ - echo "===> Installing Ansible..." && \ - yum -y --enablerepo=epel-testing install ansible1.9 && \ - \ - \ - echo "===> Disabling sudo 'requiretty' setting..." && \ - 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 "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -# -# [Quote] https://hub.docker.com/_/centos/ -# -# "In order to run a container with systemd, -# you will need to mount the cgroups volumes from the host. -# [...] -# There have been reports that if you're using an Ubuntu host, -# you will need to add -v /tmp/$(mktemp -d):/run -# in addition to the cgroups mount." -# -VOLUME [ "/sys/fs/cgroup", "/run" ] - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-centos7-onbuild/ansible-playbook-wrapper b/1.9-centos7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/1.9-centos7-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - yum -y install git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/1.9-centos7/Dockerfile b/1.9-centos7/Dockerfile deleted file mode 100644 index ab63d07..0000000 --- a/1.9-centos7/Dockerfile +++ /dev/null @@ -1,81 +0,0 @@ -# Dockerfile for building Ansible 1.9 image for CentOS 7, 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, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos7 - -MAINTAINER William Yeh - - -# enable systemd; -# @see https://hub.docker.com/_/centos/ -ENV container docker - -RUN echo "===> Enabling systemd..." && \ - (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ - rm -f /lib/systemd/system/multi-user.target.wants/*; \ - rm -f /etc/systemd/system/*.wants/*; \ - rm -f /lib/systemd/system/local-fs.target.wants/*; \ - rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ - rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ - rm -f /lib/systemd/system/basic.target.wants/*; \ - rm -f /lib/systemd/system/anaconda.target.wants/* && \ - \ - \ - echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts systemd-container-EOL && \ - \ - \ - echo "===> Installing Ansible..." && \ - yum -y --enablerepo=epel-testing install ansible1.9 && \ - \ - \ - echo "===> Disabling sudo 'requiretty' setting..." && \ - sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - yum -y install sshpass openssh-clients && \ - \ - \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release && \ - yum clean all && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -# -# [Quote] https://hub.docker.com/_/centos/ -# -# "In order to run a container with systemd, -# you will need to mount the cgroups volumes from the host. -# [...] -# There have been reports that if you're using an Ubuntu host, -# you will need to add -v /tmp/$(mktemp -d):/run -# in addition to the cgroups mount." -# -VOLUME [ "/sys/fs/cgroup", "/run" ] - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-debian7-onbuild/Dockerfile b/1.9-debian7-onbuild/Dockerfile deleted file mode 100644 index ec8f2d1..0000000 --- a/1.9-debian7-onbuild/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# Dockerfile for building Ansible 1.9 image for Debian 7 (wheezy), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM debian:wheezy - -MAINTAINER William Yeh - - -RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update -y && apt-get install --fix-missing && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install -y \ - python python-yaml sudo \ - curl gcc python-pip python-dev libffi-dev libssl-dev && \ - pip install --upgrade cffi && \ - \ - \ - echo "===> Installing Ansible..." && \ - pip install ansible==1.9.4 && \ - \ - \ - echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove \ - gcc python-pip python-dev libffi-dev libssl-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - echo "===> Updating TLS certificates..." && \ - apt-get install -y openssl ca-certificates - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-debian7-onbuild/ansible-playbook-wrapper b/1.9-debian7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/1.9-debian7-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - apt-get install -y git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/1.9-debian7/Dockerfile b/1.9-debian7/Dockerfile deleted file mode 100644 index 7e7121e..0000000 --- a/1.9-debian7/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Dockerfile for building Ansible 1.9 image for Debian 7 (wheezy), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM debian:wheezy - -MAINTAINER William Yeh - - -RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update -y && apt-get install --fix-missing && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install -y \ - python python-yaml sudo \ - curl gcc python-pip python-dev libffi-dev libssl-dev && \ - pip install --upgrade cffi && \ - \ - \ - echo "===> Installing Ansible..." && \ - pip install ansible==1.9.4 && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - apt-get install -y sshpass openssh-client && \ - \ - \ - echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove \ - gcc python-pip python-dev libffi-dev libssl-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-ubuntu12.04-onbuild/Dockerfile b/1.9-ubuntu12.04-onbuild/Dockerfile deleted file mode 100644 index 1a7ee30..0000000 --- a/1.9-ubuntu12.04-onbuild/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# Dockerfile for building Ansible 1.9 image for Ubuntu 12.04 (presice), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM ubuntu:12.04 - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's PPA..." && \ - echo "deb http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ - echo "deb-src http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ - DEBIAN_FRONTEND=noninteractive apt-get update && \ - \ - \ - echo "===> Installing Ansible (and sudo)..." && \ - apt-get install -y ansible sudo && \ - \ - \ - echo "===> Removing Ansible PPA..." && \ - rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - echo 'localhost' > /etc/ansible/hosts - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - echo "===> Updating TLS certificates..." && \ - apt-get install -y openssl ca-certificates - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper b/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - apt-get install -y git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/1.9-ubuntu12.04/Dockerfile b/1.9-ubuntu12.04/Dockerfile deleted file mode 100644 index bb78b18..0000000 --- a/1.9-ubuntu12.04/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# Dockerfile for building Ansible 1.9 image for Ubuntu 12.04 (presice), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM ubuntu:12.04 - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's PPA..." && \ - echo "deb http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ - echo "deb-src http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ - DEBIAN_FRONTEND=noninteractive apt-get update && \ - \ - \ - echo "===> Installing Ansible (and sudo)..." && \ - apt-get install -y ansible sudo && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - apt-get install -y sshpass openssh-client && \ - \ - \ - echo "===> Removing Ansible PPA..." && \ - rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - echo 'localhost' > /etc/ansible/hosts - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/README.md b/README.md index a160dfb..c02360d 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,20 @@ This repository contains Dockerized [Ansible](https://github.com/ansible/ansible These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions. -Base OS: Debian (jessie, wheezy), Ubuntu (xenial, trusty, precise), CentOS (7, 6), Alpine (3). +### Base OS -Ansible: four versions are provided - +Debian (jessie), Ubuntu (xenial, trusty), CentOS (7), Alpine (3). + +Supports for Wheezy, Precise, and CentOS6 have been ended since Sep 2017. + +### Ansible + +Four versions are provided: 1. provides the most recent *stable* version of Ansible; suitable for most people. 2. same as stable version, but is designed for building (near-)*minimal* images out of playbooks; i.e., the Ansible body will be removed when mission completed. Refer to “[Build Docker images with Ansible: A half-blood approach](https://github.com/William-Yeh/build-docker-with-ansible)” for working examples and slides. - 3. provides the old 1.9 version of Ansible. - 4. provides the *experimental* version of Ansible; i.e., the master branch of git. + 3. provides the old 1.9 version of Ansible (but will be retired someday). + 4. provides the *experimental* version of Ansible; i.e., the master branch of official [Ansible's git repo](https://github.com/ansible/ansible). Each version is further divided into two variants: @@ -38,23 +44,17 @@ Each version is further divided into two variants: - Normal variants: - `williamyeh/ansible:debian8` - - `williamyeh/ansible:debian7` - `williamyeh/ansible:ubuntu16.04` - `williamyeh/ansible:ubuntu14.04` - - `williamyeh/ansible:ubuntu12.04` - `williamyeh/ansible:centos7` - - `williamyeh/ansible:centos6` - `williamyeh/ansible:alpine3` - Onbuild variants (*recommended for common cases*): - `williamyeh/ansible:debian8-onbuild` - - `williamyeh/ansible:debian7-onbuild` - `williamyeh/ansible:ubuntu16.04-onbuild` - `williamyeh/ansible:ubuntu14.04-onbuild` - - `williamyeh/ansible:ubuntu12.04-onbuild` - `williamyeh/ansible:centos7-onbuild` - - `williamyeh/ansible:centos6-onbuild` - `williamyeh/ansible:alpine3-onbuild` @@ -68,26 +68,20 @@ Refer to “[Build Docker images with Ansible: A half-blood approach](https://gi - `williamyeh/ansible:mini-debian8` -### Old 1.9 version: +### Old 1.9 version (will be retired someday): + +Note: Ansible 1.9 was not supported in CentOS EPEL since January 2017, according to [this announcement](http://www.spinics.net/linux/fedora/epel-devel/msg00792.html). - Normal variants: - `williamyeh/ansible:1.9-debian8` - - `williamyeh/ansible:1.9-debian7` - `williamyeh/ansible:1.9-ubuntu14.04` - - `williamyeh/ansible:1.9-ubuntu12.04` - - `williamyeh/ansible:1.9-centos7` - - `williamyeh/ansible:1.9-centos6` - `williamyeh/ansible:1.9-alpine3` - Onbuild variants (*recommended for common cases*): - `williamyeh/ansible:1.9-debian8-onbuild` - - `williamyeh/ansible:1.9-debian7-onbuild` - `williamyeh/ansible:1.9-ubuntu14.04-onbuild` - - `williamyeh/ansible:1.9-ubuntu12.04-onbuild` - - `williamyeh/ansible:1.9-centos7-onbuild` - - `williamyeh/ansible:1.9-centos6-onbuild` - `williamyeh/ansible:1.9-alpine3-onbuild` @@ -96,22 +90,16 @@ Refer to “[Build Docker images with Ansible: A half-blood approach](https://gi - Normal variants: - `williamyeh/ansible:master-debian8` - - `williamyeh/ansible:master-debian7` - `williamyeh/ansible:master-ubuntu16.04` - `williamyeh/ansible:master-ubuntu14.04` - - `williamyeh/ansible:master-ubuntu12.04` - `williamyeh/ansible:master-centos7` - - `williamyeh/ansible:master-centos6` - Onbuild variants (*recommended for common cases*): - `williamyeh/ansible:master-debian8-onbuild` - - `williamyeh/ansible:master-debian7-onbuild` - `williamyeh/ansible:master-ubuntu16.04-onbuild` - `williamyeh/ansible:master-ubuntu14.04-onbuild` - - `williamyeh/ansible:master-ubuntu12.04-onbuild` - `williamyeh/ansible:master-centos7-onbuild` - - `williamyeh/ansible:master-centos6-onbuild` @@ -194,11 +182,8 @@ Vagrant.configure(2) do |config| # ==> Choose a Vagrant box to emulate Linux distribution... #config.vm.box = "ubuntu/xenial64" config.vm.box = "ubuntu/trusty64" - #config.vm.box = "ubuntu/precise64" #config.vm.box = "debian/jessie64" - #config.vm.box = "debian/wheezy64" #config.vm.box = "bento/centos-7.2" - #config.vm.box = "bento/centos-6.7" #config.vm.box = "maier/alpine-3.3.1-x86_64" @@ -222,11 +207,8 @@ Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may tes # ==> Choose a base image to emulate Linux distribution... #FROM williamyeh/ansible:ubuntu16.04 FROM williamyeh/ansible:ubuntu14.04 -#FROM williamyeh/ansible:ubuntu12.04 #FROM williamyeh/ansible:debian8 -#FROM williamyeh/ansible:debian7 #FROM williamyeh/ansible:centos7 -#FROM williamyeh/ansible:centos6 #FROM williamyeh/ansible:alpine3 @@ -250,11 +232,8 @@ You may also work with `onbuild` variants, which take care of many routine steps # ==> Choose a base image to emulate Linux distribution... #FROM williamyeh/ansible:ubuntu16.04-onbuild FROM williamyeh/ansible:ubuntu14.04-onbuild -#FROM williamyeh/ansible:ubuntu12.04-onbuild #FROM williamyeh/ansible:debian8-onbuild -#FROM williamyeh/ansible:debian7-onbuild #FROM williamyeh/ansible:centos7-onbuild -#FROM williamyeh/ansible:centos6-onbuild #FROM williamyeh/ansible:alpine3-onbuild diff --git a/Vagrantfile b/Vagrantfile index 9bb4898..2e1a5e9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,20 +6,14 @@ Vagrant.configure(2) do |config| docker build -t ansible:ubuntu16.04 ubuntu16.04 docker build -t ansible:ubuntu14.04 ubuntu14.04 - docker build -t ansible:ubuntu12.04 ubuntu12.04 docker build -t ansible:debian8 debian8 - docker build -t ansible:debian7 debian7 docker build -t ansible:centos7 centos7 - docker build -t ansible:centos6 centos6 docker build -t ansible:alpine3 alpine3 docker build -t ansible:ubuntu16.04-onbuild ubuntu16.04-onbuild docker build -t ansible:ubuntu14.04-onbuild ubuntu14.04-onbuild - docker build -t ansible:ubuntu12.04-onbuild ubuntu12.04-onbuild docker build -t ansible:debian8-onbuild debian8-onbuild - docker build -t ansible:debian7-onbuild debian7-onbuild docker build -t ansible:centos7-onbuild centos7-onbuild - docker build -t ansible:centos6-onbuild centos6-onbuild docker build -t ansible:alpine3-onbuild alpine3-onbuild SHELL diff --git a/alpine3-onbuild/Dockerfile b/alpine3-onbuild/Dockerfile index 6d62b4e..3129705 100644 --- a/alpine3-onbuild/Dockerfile +++ b/alpine3-onbuild/Dockerfile @@ -7,7 +7,7 @@ # pull base image -FROM alpine:3.4 +FROM alpine:3.6 MAINTAINER William Yeh diff --git a/alpine3/Dockerfile b/alpine3/Dockerfile index f99b7fc..74a8dcd 100644 --- a/alpine3/Dockerfile +++ b/alpine3/Dockerfile @@ -7,7 +7,7 @@ # pull base image -FROM alpine:3.4 +FROM alpine:3.6 MAINTAINER William Yeh @@ -28,6 +28,7 @@ RUN echo "===> Installing sudo to emulate normal OS behavior..." && \ \ \ echo "===> Installing handy tools (not absolutely required)..." && \ + pip install --upgrade pywinrm && \ apk --update add sshpass openssh-client rsync && \ \ \ diff --git a/centos6-onbuild/Dockerfile b/centos6-onbuild/Dockerfile deleted file mode 100644 index 9da3810..0000000 --- a/centos6-onbuild/Dockerfile +++ /dev/null @@ -1,59 +0,0 @@ -# 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, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos6 - -MAINTAINER William Yeh - - -RUN echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts 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 || true && \ - \ - \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release && \ - yum clean all && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/centos6-onbuild/ansible-playbook-wrapper b/centos6-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/centos6-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - yum -y install git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/centos6/Dockerfile b/centos6/Dockerfile deleted file mode 100644 index 6ebaad9..0000000 --- a/centos6/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -# 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, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos6 - -MAINTAINER William Yeh - - -RUN echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts 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 || true && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - yum -y install sshpass openssh-clients && \ - \ - \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release && \ - yum clean all && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/centos7/Dockerfile b/centos7/Dockerfile index cc2f1ef..1595de5 100644 --- a/centos7/Dockerfile +++ b/centos7/Dockerfile @@ -51,6 +51,8 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Installing handy tools (not absolutely required)..." && \ + yum -y install python-pip && \ + pip install --upgrade pywinrm && \ yum -y install sshpass openssh-clients && \ \ \ diff --git a/circle.yml b/circle.yml index 18e5253..61efc17 100644 --- a/circle.yml +++ b/circle.yml @@ -9,55 +9,35 @@ dependencies: - docker build -t ansible_xenial ubuntu16.04 - docker build -t ansible_trusty ubuntu14.04 - - docker build -t ansible_precise ubuntu12.04 - docker build -t ansible_jessie debian8 - - docker build -t ansible_wheezy debian7 - docker build -t ansible_centos7 centos7 - - docker build -t ansible_centos6 centos6 - docker build -t ansible_alpine3 alpine3 - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild - - docker build -t ansible_precise_onbuild ubuntu12.04-onbuild - docker build -t ansible_jessie_onbuild debian8-onbuild - - docker build -t ansible_wheezy_onbuild debian7-onbuild - docker build -t ansible_centos7_onbuild centos7-onbuild - - docker build -t ansible_centos6_onbuild centos6-onbuild - docker build -t ansible_alpine3_onbuild alpine3-onbuild - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 - - docker build -t ansible_1.9_precise 1.9-ubuntu12.04 - docker build -t ansible_1.9_jessie 1.9-debian8 - - docker build -t ansible_1.9_wheezy 1.9-debian7 - - docker build -t ansible_1.9_centos7 1.9-centos7 - - docker build -t ansible_1.9_centos6 1.9-centos6 - docker build -t ansible_1.9_alpine3 1.9-alpine3 - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild - - docker build -t ansible_1.9_precise_onbuild 1.9-ubuntu12.04-onbuild - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild - - docker build -t ansible_1.9_wheezy_onbuild 1.9-debian7-onbuild - - docker build -t ansible_1.9_centos7_onbuild 1.9-centos7-onbuild - - docker build -t ansible_1.9_centos6_onbuild 1.9-centos6-onbuild - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild - docker build -t ansible_master_xenial master-ubuntu16.04 - docker build -t ansible_master_trusty master-ubuntu14.04 - - docker build -t ansible_master_precise master-ubuntu12.04 - docker build -t ansible_master_jessie master-debian8 - - docker build -t ansible_master_wheezy master-debian7 - docker build -t ansible_master_centos7 master-centos7 - - docker build -t ansible_master_centos6 master-centos6 - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild - - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild - - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild - - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild - docker build -t ansible_mini_alpine3 mini-alpine3 @@ -70,52 +50,32 @@ test: override: - docker run -i ansible_xenial > result-ubuntu16.04 - docker run -i ansible_trusty > result-ubuntu14.04 - - docker run -i ansible_precise > result-ubuntu12.04 - docker run -i ansible_jessie > result-debian8 - - docker run -i ansible_wheezy > result-debian7 - docker run -i ansible_centos7 > result-centos7 - - docker run -i ansible_centos6 > result-centos6 - docker run -i ansible_alpine3 > result-alpine3 - docker run -i ansible_xenial_onbuild > result-ubuntu16.04-onbuild - docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild - - docker run -i ansible_precise_onbuild > result-ubuntu12.04-onbuild - docker run -i ansible_jessie_onbuild > result-debian8-onbuild - - docker run -i ansible_wheezy_onbuild > result-debian7-onbuild - docker run -i ansible_centos7_onbuild > result-centos7-onbuild - - docker run -i ansible_centos6_onbuild > result-centos6-onbuild - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 - - docker run -i ansible_1.9_precise > result-1.9-ubuntu12.04 - docker run -i ansible_1.9_jessie > result-1.9-debian8 - - docker run -i ansible_1.9_wheezy > result-1.9-debian7 - - docker run -i ansible_1.9_centos7 > result-1.9-centos7 - - docker run -i ansible_1.9_centos6 > result-1.9-centos6 - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild - - docker run -i ansible_1.9_precise_onbuild > result-1.9-ubuntu12.04-onbuild - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild - - docker run -i ansible_1.9_wheezy_onbuild > result-1.9-debian7-onbuild - - docker run -i ansible_1.9_centos7_onbuild > result-1.9-centos7-onbuild - - docker run -i ansible_1.9_centos6_onbuild > result-1.9-centos6-onbuild - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild - docker run -i ansible_master_xenial > result-master-ubuntu16.04 - docker run -i ansible_master_trusty > result-master-ubuntu14.04 - - docker run -i ansible_master_precise > result-master-ubuntu12.04 - docker run -i ansible_master_jessie > result-master-debian8 - - docker run -i ansible_master_wheezy > result-master-debian7 - docker run -i ansible_master_centos7 > result-master-centos7 - - docker run -i ansible_master_centos6 > result-master-centos6 - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild - - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild - - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild - - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild - docker run -i nginx_alpine3 2> result-nginx-alpine3 @@ -125,50 +85,30 @@ test: - echo "==> Validating the test results..." - sh -c "[ -s result-ubuntu16.04 ]" - sh -c "[ -s result-ubuntu14.04 ]" - - sh -c "[ -s result-ubuntu12.04 ]" - sh -c "[ -s result-debian8 ]" - - sh -c "[ -s result-debian7 ]" - sh -c "[ -s result-centos7 ]" - - sh -c "[ -s result-centos6 ]" - sh -c "[ -s result-alpine3 ]" - sh -c "[ -s result-ubuntu16.04-onbuild ]" - sh -c "[ -s result-ubuntu14.04-onbuild ]" - - sh -c "[ -s result-ubuntu12.04-onbuild ]" - sh -c "[ -s result-debian8-onbuild ]" - - sh -c "[ -s result-debian7-onbuild ]" - sh -c "[ -s result-centos7-onbuild ]" - - sh -c "[ -s result-centos6-onbuild ]" - sh -c "[ -s result-alpine3-onbuild ]" - sh -c "[ -s result-1.9-ubuntu14.04 ]" - - sh -c "[ -s result-1.9-ubuntu12.04 ]" - sh -c "[ -s result-1.9-debian8 ]" - - sh -c "[ -s result-1.9-debian7 ]" - - sh -c "[ -s result-1.9-centos7 ]" - - sh -c "[ -s result-1.9-centos6 ]" - sh -c "[ -s result-1.9-alpine3 ]" - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" - - sh -c "[ -s result-1.9-ubuntu12.04-onbuild ]" - sh -c "[ -s result-1.9-debian8-onbuild ]" - - sh -c "[ -s result-1.9-debian7-onbuild ]" - - sh -c "[ -s result-1.9-centos7-onbuild ]" - - sh -c "[ -s result-1.9-centos6-onbuild ]" - sh -c "[ -s result-1.9-alpine3-onbuild ]" - sh -c "[ -s result-master-ubuntu16.04 ]" - sh -c "[ -s result-master-ubuntu14.04 ]" - - sh -c "[ -s result-master-ubuntu12.04 ]" - sh -c "[ -s result-master-debian8 ]" - - sh -c "[ -s result-master-debian7 ]" - sh -c "[ -s result-master-centos7 ]" - - sh -c "[ -s result-master-centos6 ]" - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" - - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" - sh -c "[ -s result-master-debian8-onbuild ]" - - sh -c "[ -s result-master-debian7-onbuild ]" - sh -c "[ -s result-master-centos7-onbuild ]" - - sh -c "[ -s result-master-centos6-onbuild ]" - sh -c "[ -s result-nginx-alpine3 ]" - sh -c "[ -s result-nginx-debian8 ]" diff --git a/compare-image-size.sh b/compare-image-size.sh index 6a8ae88..c3b92f0 100755 --- a/compare-image-size.sh +++ b/compare-image-size.sh @@ -3,12 +3,9 @@ declare -a IMAGES=( 'ansible/ubuntu14.04-ansible:stable' 'ansible/centos7-ansible:stable' \ "williamyeh/ansible:debian8-onbuild" \ - "williamyeh/ansible:debian7-onbuild" \ "williamyeh/ansible:ubuntu16.04-onbuild" \ "williamyeh/ansible:ubuntu14.04-onbuild" \ - "williamyeh/ansible:ubuntu12.04-onbuild" \ - "williamyeh/ansible:centos7-onbuild" \ - "williamyeh/ansible:centos6-onbuild" + "williamyeh/ansible:centos7-onbuild" ) for image in "${IMAGES[@]}" ; do diff --git a/debian7-onbuild/Dockerfile b/debian7-onbuild/Dockerfile deleted file mode 100644 index a6e1a30..0000000 --- a/debian7-onbuild/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# Dockerfile for building Ansible image for Debian 7 (wheezy), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM debian:wheezy - -MAINTAINER William Yeh - - -RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update -y && apt-get install --fix-missing && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install -y \ - python python-yaml sudo \ - curl gcc python-pip python-dev libffi-dev libssl-dev && \ - pip install --upgrade cffi && \ - \ - \ - echo "===> Installing Ansible..." && \ - pip install ansible && \ - \ - \ - echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove \ - gcc python-pip python-dev libffi-dev libssl-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - echo "===> Updating TLS certificates..." && \ - apt-get install -y openssl ca-certificates - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/debian7-onbuild/ansible-playbook-wrapper b/debian7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/debian7-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - apt-get install -y git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/debian7/Dockerfile b/debian7/Dockerfile deleted file mode 100644 index 743d063..0000000 --- a/debian7/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Dockerfile for building Ansible image for Debian 7 (wheezy), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM debian:wheezy - -MAINTAINER William Yeh - - -RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update -y && apt-get install --fix-missing && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install -y \ - python python-yaml sudo \ - curl gcc python-pip python-dev libffi-dev libssl-dev && \ - pip install --upgrade cffi && \ - \ - \ - echo "===> Installing Ansible..." && \ - pip install ansible && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - apt-get install -y sshpass openssh-client && \ - \ - \ - echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove \ - gcc python-pip python-dev libffi-dev libssl-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/debian8/Dockerfile b/debian8/Dockerfile index 37a7219..78109f1 100644 --- a/debian8/Dockerfile +++ b/debian8/Dockerfile @@ -19,13 +19,18 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ python python-yaml sudo \ curl gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get -y --purge remove python-cffi && \ - pip install --upgrade cffi && \ + pip install --upgrade cffi pywinrm && \ + \ + \ + echo "===> Fix strange bug under Jessie: cannot import name IncompleteRead" && \ + easy_install -U pip && \ \ \ echo "===> Installing Ansible..." && \ pip install ansible && \ \ \ + \ echo "===> Installing handy tools (not absolutely required)..." && \ apt-get install -y sshpass openssh-client && \ \ diff --git a/master-centos6-onbuild/Dockerfile b/master-centos6-onbuild/Dockerfile deleted file mode 100644 index 091bad2..0000000 --- a/master-centos6-onbuild/Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -# Dockerfile for building Ansible image from source for CentOS 6, with as few additional software as possible. -# -# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source -# -# [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos6 - -MAINTAINER William Yeh - - -RUN echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - yum -y update && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts && \ - \ - \ - echo "===> Adding Ansible's prerequisites..." && \ - yum -y install \ - gcc make \ - python python-devel python-pip \ - libffi-devel openssl-devel \ - libxml2 libxml2-devel libxslt libxslt-devel \ - git sudo curl && \ - pip install --upgrade pip && \ - pip install --upgrade \ - pyyaml jinja2 pycrypto paramiko httplib2 && \ - \ - \ - echo "===> Downloading Ansible's source tree..." && \ - git clone git://github.com/ansible/ansible.git --recursive && \ - \ - \ - echo "===> Compiling Ansible..." && \ - cd ansible && \ - bash -c 'source ./hacking/env-setup' && \ - \ - \ - echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ - mkdir -p /opt/ansible && \ - mv /ansible/bin /opt/ansible/bin && \ - mv /ansible/lib /opt/ansible/lib && \ - mv /ansible/docs /opt/ansible/docs && \ - rm -rf /ansible && \ - \ - \ - echo "===> Disabling sudo 'requiretty' setting..." && \ - sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ - \ - \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc git python-devel python-pip \ - libffi-devel openssl-devel || true && \ - yum clean all && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -ENV PATH /opt/ansible/bin:$PATH -ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH -ENV MANPATH /opt/ansible/docs/man:$MANPATH - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/master-centos6-onbuild/ansible-playbook-wrapper b/master-centos6-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/master-centos6-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - yum -y install git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/master-centos6/Dockerfile b/master-centos6/Dockerfile deleted file mode 100644 index b647a4c..0000000 --- a/master-centos6/Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -# Dockerfile for building Ansible image from source for CentOS 6, with as few additional software as possible. -# -# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source -# -# [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, -# we need to patch /etc/sudoers. -# @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password -# @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 -# -# Version 1.0 -# - - -# pull base image -FROM centos:centos6 - -MAINTAINER William Yeh - - -RUN echo "===> Installing EPEL..." && \ - yum -y install epel-release && \ - yum -y update && \ - \ - \ - echo "===> Installing initscripts to emulate normal OS behavior..." && \ - yum -y install initscripts && \ - \ - \ - echo "===> Adding Ansible's prerequisites..." && \ - yum -y install \ - gcc make \ - python python-devel python-pip \ - libffi-devel openssl-devel \ - libxml2 libxml2-devel libxslt libxslt-devel \ - git sudo curl && \ - pip install --upgrade pip && \ - pip install --upgrade \ - pyyaml jinja2 pycrypto paramiko httplib2 && \ - \ - \ - echo "===> Downloading Ansible's source tree..." && \ - git clone git://github.com/ansible/ansible.git --recursive && \ - \ - \ - echo "===> Compiling Ansible..." && \ - cd ansible && \ - bash -c 'source ./hacking/env-setup' && \ - \ - \ - echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ - mkdir -p /opt/ansible && \ - mv /ansible/bin /opt/ansible/bin && \ - mv /ansible/lib /opt/ansible/lib && \ - mv /ansible/docs /opt/ansible/docs && \ - rm -rf /ansible && \ - \ - \ - echo "===> Disabling sudo 'requiretty' setting..." && \ - sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - yum -y install sshpass openssh-clients && \ - \ - \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc git python-devel python-pip \ - libffi-devel openssl-devel || true && \ - yum clean all && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -ENV PATH /opt/ansible/bin:$PATH -ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH -ENV MANPATH /opt/ansible/docs/man:$MANPATH - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/master-centos7/Dockerfile b/master-centos7/Dockerfile index eb120a5..8f6a5b9 100644 --- a/master-centos7/Dockerfile +++ b/master-centos7/Dockerfile @@ -51,6 +51,7 @@ RUN echo "===> Enabling systemd..." && \ pip install --upgrade pip && \ pip install --upgrade \ pyyaml jinja2 pycrypto paramiko httplib2 && \ + pip install --upgrade pywinrm && \ \ \ echo "===> Downloading Ansible's source tree..." && \ diff --git a/master-debian7-onbuild/Dockerfile b/master-debian7-onbuild/Dockerfile deleted file mode 100644 index e787e2d..0000000 --- a/master-debian7-onbuild/Dockerfile +++ /dev/null @@ -1,77 +0,0 @@ -# Dockerfile for building Ansible image from source for Debian 7 (wheezy), with as few additional software as possible. -# -# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source -# -# Version 1.0 -# - - -# pull base image -FROM debian:wheezy - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && apt-get install --fix-missing && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install --no-install-recommends -y -q \ - build-essential ca-certificates \ - python-pip python-dev python-yaml \ - libffi-dev libssl-dev \ - libxml2-dev libxslt1-dev zlib1g-dev \ - git sudo curl && \ - pip install --upgrade cffi && \ - pip install --upgrade pyyaml jinja2 pycrypto && \ - \ - \ - echo "===> Downloading Ansible's source tree..." && \ - git clone git://github.com/ansible/ansible.git --recursive && \ - \ - \ - echo "===> Compiling Ansible..." && \ - cd ansible && \ - bash -c 'source ./hacking/env-setup' && \ - \ - \ - echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ - mkdir -p /opt/ansible && \ - mv /ansible/bin /opt/ansible/bin && \ - mv /ansible/lib /opt/ansible/lib && \ - mv /ansible/docs /opt/ansible/docs && \ - rm -rf /ansible && \ - \ - \ - echo "===> Clean up..." && \ - apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git libffi-dev libssl-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -ENV PATH /opt/ansible/bin:$PATH -ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH -ENV MANPATH /opt/ansible/docs/man:$MANPATH - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - echo "===> Updating TLS certificates..." && \ - apt-get install -y openssl ca-certificates - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/master-debian7-onbuild/ansible-playbook-wrapper b/master-debian7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/master-debian7-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - apt-get install -y git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/master-debian7/Dockerfile b/master-debian7/Dockerfile deleted file mode 100644 index dd217c7..0000000 --- a/master-debian7/Dockerfile +++ /dev/null @@ -1,67 +0,0 @@ -# Dockerfile for building Ansible image from source for Debian 7 (wheezy), with as few additional software as possible. -# -# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source -# -# Version 1.0 -# - - -# pull base image -FROM debian:wheezy - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && apt-get install --fix-missing && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install --no-install-recommends -y -q \ - build-essential ca-certificates \ - python-pip python-dev python-yaml \ - libffi-dev libssl-dev \ - libxml2-dev libxslt1-dev zlib1g-dev \ - git sudo curl && \ - pip install --upgrade cffi && \ - pip install --upgrade pyyaml jinja2 pycrypto && \ - \ - \ - echo "===> Downloading Ansible's source tree..." && \ - git clone git://github.com/ansible/ansible.git --recursive && \ - \ - \ - echo "===> Compiling Ansible..." && \ - cd ansible && \ - bash -c 'source ./hacking/env-setup' && \ - \ - \ - echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ - mkdir -p /opt/ansible && \ - mv /ansible/bin /opt/ansible/bin && \ - mv /ansible/lib /opt/ansible/lib && \ - mv /ansible/docs /opt/ansible/docs && \ - rm -rf /ansible && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - apt-get install -y sshpass openssh-client && \ - \ - \ - echo "===> Clean up..." && \ - apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git libffi-dev libssl-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -ENV PATH /opt/ansible/bin:$PATH -ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH -ENV MANPATH /opt/ansible/docs/man:$MANPATH - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/master-debian8-onbuild/Dockerfile b/master-debian8-onbuild/Dockerfile index c9ce493..79b8ec9 100644 --- a/master-debian8-onbuild/Dockerfile +++ b/master-debian8-onbuild/Dockerfile @@ -17,12 +17,17 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential ca-certificates \ - python-pip python-dev python-yaml \ + python python-pip python-dev \ libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git sudo curl && \ apt-get -y --purge remove python-cffi && \ - pip install --upgrade cffi && \ + \ + \ + echo "===> Fix strange bug under Jessie: cannot import name IncompleteRead" && \ + easy_install -U pip && \ + \ + pip install --upgrade cffi pywinrm && \ pip install --upgrade pyyaml jinja2 pycrypto && \ \ \ diff --git a/master-debian8/Dockerfile b/master-debian8/Dockerfile index f5ea797..d600520 100644 --- a/master-debian8/Dockerfile +++ b/master-debian8/Dockerfile @@ -17,12 +17,17 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential ca-certificates \ - python-pip python-dev python-yaml \ + python python-pip python-dev \ libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git sudo curl && \ apt-get -y --purge remove python-cffi && \ - pip install --upgrade cffi && \ + \ + \ + echo "===> Fix strange bug under Jessie: cannot import name IncompleteRead" && \ + easy_install -U pip && \ + \ + pip install --upgrade cffi pywinrm && \ pip install --upgrade pyyaml jinja2 pycrypto && \ \ \ @@ -44,6 +49,7 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ \ \ echo "===> Installing handy tools (not absolutely required)..." && \ + apt-get install -y sshpass openssh-client && \ \ \ diff --git a/master-ubuntu12.04-onbuild/Dockerfile b/master-ubuntu12.04-onbuild/Dockerfile deleted file mode 100644 index ed11e78..0000000 --- a/master-ubuntu12.04-onbuild/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# Dockerfile for building Ansible image from source for Ubuntu 12.04 (presice), with as few additional software as possible. -# -# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source -# -# Version 1.0 -# - - -# pull base image -FROM ubuntu:12.04 - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install --no-install-recommends -y -q \ - build-essential \ - python-pip python-dev python-yaml \ - libxml2-dev libxslt1-dev zlib1g-dev \ - git sudo && \ - pip install --upgrade pyyaml jinja2 pycrypto && \ - \ - \ - echo "===> Downloading Ansible's source tree..." && \ - git clone git://github.com/ansible/ansible.git --recursive && \ - \ - \ - echo "===> Compiling Ansible..." && \ - cd ansible && \ - bash -c 'source ./hacking/env-setup' && \ - \ - \ - echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ - mkdir -p /opt/ansible && \ - mv /ansible/bin /opt/ansible/bin && \ - mv /ansible/lib /opt/ansible/lib && \ - mv /ansible/docs /opt/ansible/docs && \ - rm -rf /ansible && \ - \ - \ - echo "===> Clean up..." && \ - apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -ENV PATH /opt/ansible/bin:$PATH -ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH -ENV MANPATH /opt/ansible/docs/man:$MANPATH - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/master-ubuntu12.04-onbuild/ansible-playbook-wrapper b/master-ubuntu12.04-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/master-ubuntu12.04-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - apt-get install -y git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/master-ubuntu12.04/Dockerfile b/master-ubuntu12.04/Dockerfile deleted file mode 100644 index 021eeb9..0000000 --- a/master-ubuntu12.04/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -# Dockerfile for building Ansible image from source for Ubuntu 12.04 (presice), with as few additional software as possible. -# -# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source -# -# Version 1.0 -# - - -# pull base image -FROM ubuntu:12.04 - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && \ - DEBIAN_FRONTEND=noninteractive \ - apt-get install --no-install-recommends -y -q \ - build-essential \ - python-pip python-dev python-yaml \ - libxml2-dev libxslt1-dev zlib1g-dev \ - git sudo && \ - pip install --upgrade pyyaml jinja2 pycrypto && \ - \ - \ - echo "===> Downloading Ansible's source tree..." && \ - git clone git://github.com/ansible/ansible.git --recursive && \ - \ - \ - echo "===> Compiling Ansible..." && \ - cd ansible && \ - bash -c 'source ./hacking/env-setup' && \ - \ - \ - echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ - mkdir -p /opt/ansible && \ - mv /ansible/bin /opt/ansible/bin && \ - mv /ansible/lib /opt/ansible/lib && \ - mv /ansible/docs /opt/ansible/docs && \ - rm -rf /ansible && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - apt-get install -y sshpass openssh-client && \ - \ - \ - echo "===> Clean up..." && \ - apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - mkdir -p /etc/ansible && \ - echo 'localhost' > /etc/ansible/hosts - - -ENV PATH /opt/ansible/bin:$PATH -ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH -ENV MANPATH /opt/ansible/docs/man:$MANPATH - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/master-ubuntu14.04-onbuild/Dockerfile b/master-ubuntu14.04-onbuild/Dockerfile index 937d783..620d2f0 100644 --- a/master-ubuntu14.04-onbuild/Dockerfile +++ b/master-ubuntu14.04-onbuild/Dockerfile @@ -17,10 +17,12 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential \ - python-pip python-dev python-yaml \ + python python-pip python-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git && \ + pip install --upgrade setuptools pip wheel && \ pip install --upgrade pyyaml jinja2 pycrypto && \ + pip install --upgrade pywinrm && \ \ \ echo "===> Downloading Ansible's source tree..." && \ diff --git a/master-ubuntu14.04/Dockerfile b/master-ubuntu14.04/Dockerfile index a727507..bd166e4 100644 --- a/master-ubuntu14.04/Dockerfile +++ b/master-ubuntu14.04/Dockerfile @@ -17,10 +17,12 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential \ - python-pip python-dev python-yaml \ + python python-pip python-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git && \ + pip install --upgrade setuptools pip wheel && \ pip install --upgrade pyyaml jinja2 pycrypto && \ + pip install --upgrade pywinrm && \ \ \ echo "===> Downloading Ansible's source tree..." && \ diff --git a/master-ubuntu16.04-onbuild/Dockerfile b/master-ubuntu16.04-onbuild/Dockerfile index bbd0029..7019ae2 100644 --- a/master-ubuntu16.04-onbuild/Dockerfile +++ b/master-ubuntu16.04-onbuild/Dockerfile @@ -17,12 +17,13 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential \ - python-pip python-dev python-yaml \ + python python-pip python-dev \ libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git && \ - pip install --upgrade wheel setuptools && \ + pip install --upgrade setuptools pip wheel && \ pip install --upgrade pyyaml jinja2 pycrypto && \ + pip install --upgrade pywinrm && \ \ \ echo "===> Downloading Ansible's source tree..." && \ diff --git a/master-ubuntu16.04/Dockerfile b/master-ubuntu16.04/Dockerfile index 6b601a6..4dcc074 100644 --- a/master-ubuntu16.04/Dockerfile +++ b/master-ubuntu16.04/Dockerfile @@ -17,12 +17,13 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential \ - python-pip python-dev python-yaml \ + python python-pip python-dev \ libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git && \ - pip install --upgrade wheel setuptools && \ + pip install --upgrade setuptools pip wheel && \ pip install --upgrade pyyaml jinja2 pycrypto && \ + pip install --upgrade pywinrm && \ \ \ echo "===> Downloading Ansible's source tree..." && \ diff --git a/mini-alpine3/Dockerfile b/mini-alpine3/Dockerfile index 76f0a19..b60308b 100644 --- a/mini-alpine3/Dockerfile +++ b/mini-alpine3/Dockerfile @@ -7,7 +7,7 @@ # pull base image -FROM alpine:3.4 +FROM alpine:3.6 MAINTAINER William Yeh diff --git a/ubuntu12.04-onbuild/Dockerfile b/ubuntu12.04-onbuild/Dockerfile deleted file mode 100644 index 3816c24..0000000 --- a/ubuntu12.04-onbuild/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -# Dockerfile for building Ansible image for Ubuntu 12.04 (presice), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM ubuntu:12.04 - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's PPA..." && \ - echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ - echo "deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ - DEBIAN_FRONTEND=noninteractive apt-get update && \ - \ - \ - echo "===> Installing Ansible (and sudo)..." && \ - apt-get install -y ansible sudo && \ - \ - \ - echo "===> Removing Ansible PPA..." && \ - rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - echo 'localhost' > /etc/ansible/hosts - - -COPY ansible-playbook-wrapper /usr/local/bin/ - -ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - echo "===> Updating TLS certificates..." && \ - apt-get install -y openssl ca-certificates - -ONBUILD WORKDIR /tmp -ONBUILD COPY . /tmp -ONBUILD RUN \ - echo "===> Diagnosis: host information..." && \ - ansible -c local -m setup all - - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/ubuntu12.04-onbuild/ansible-playbook-wrapper b/ubuntu12.04-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/ubuntu12.04-onbuild/ansible-playbook-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Simple wrapper for executing ansible-galaxy and ansible-playbook -# with local connection. -# -# USAGE: -# ansible-playbook-wrapper [other ansible-playbook arguments] -# -# ENVIRONMENT VARIABLES: -# -# - REQUIREMENTS: requirements filename; default = "requirements.yml" -# - PLAYBOOK: playbook filename; default = "playbook.yml" -# - INVENTORY: inventory filename; default = "/etc/ansible/hosts" -# - - -# -# install Galaxy roles, if any -# - -if [ -z "$REQUIREMENTS" ]; then - REQUIREMENTS=requirements.yml -fi - -if [ -f "$REQUIREMENTS" ]; then - apt-get install -y git - ansible-galaxy install -r $REQUIREMENTS -fi - - -# -# execute playbook -# - -if [ -z "$PLAYBOOK" ]; then - PLAYBOOK=playbook.yml -fi - - -if [ -z "$INVENTORY" ]; then - exec ansible-playbook \ - $PLAYBOOK \ - --connection=local \ - "$@" -else - exec ansible-playbook \ - -i $INVENTORY $PLAYBOOK \ - --connection=local \ - "$@" -fi diff --git a/ubuntu12.04/Dockerfile b/ubuntu12.04/Dockerfile deleted file mode 100644 index 1dd4c58..0000000 --- a/ubuntu12.04/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# Dockerfile for building Ansible image for Ubuntu 12.04 (presice), with as few additional software as possible. -# -# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible -# -# Version 1.0 -# - - -# pull base image -FROM ubuntu:12.04 - -MAINTAINER William Yeh - - -RUN echo "===> Adding Ansible's PPA..." && \ - echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ - echo "deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ - DEBIAN_FRONTEND=noninteractive apt-get update && \ - \ - \ - echo "===> Installing Ansible (and sudo)..." && \ - apt-get install -y ansible sudo && \ - \ - \ - echo "===> Installing handy tools (not absolutely required)..." && \ - apt-get install -y sshpass openssh-client && \ - \ - \ - echo "===> Removing Ansible PPA..." && \ - rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ - \ - \ - echo "===> Adding hosts for convenience..." && \ - echo 'localhost' > /etc/ansible/hosts - - -# default command: display Ansible version -CMD [ "ansible-playbook", "--version" ] diff --git a/ubuntu14.04/Dockerfile b/ubuntu14.04/Dockerfile index ef29eb9..e762a35 100644 --- a/ubuntu14.04/Dockerfile +++ b/ubuntu14.04/Dockerfile @@ -24,6 +24,8 @@ RUN echo "===> Adding Ansible's PPA..." && \ \ \ echo "===> Installing handy tools (not absolutely required)..." && \ + apt-get install -y python-pip && \ + pip install --upgrade pywinrm && \ apt-get install -y sshpass openssh-client && \ \ \ diff --git a/ubuntu16.04/Dockerfile b/ubuntu16.04/Dockerfile index 201552e..0772f0c 100644 --- a/ubuntu16.04/Dockerfile +++ b/ubuntu16.04/Dockerfile @@ -24,6 +24,8 @@ RUN echo "===> Adding Ansible's PPA..." && \ \ \ echo "===> Installing handy tools (not absolutely required)..." && \ + apt-get install -y python-pip && \ + pip install --upgrade pywinrm && \ apt-get install -y sshpass openssh-client && \ \ \ -- cgit v1.2.3