diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index c3abb735b..588d2d897 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -6,15 +6,15 @@ - src: geerlingguy.adminer version: 1.1.0 - src: geerlingguy.apache - version: 1.7.2 + version: 1.7.3 - src: geerlingguy.apache-php-fpm version: 1.0.2 - src: geerlingguy.blackfire version: 1.0.0 - src: geerlingguy.composer - version: 1.4.1 + version: 1.4.2 - src: geerlingguy.daemonize - version: 1.1.0 + version: 1.1.1 - src: geerlingguy.drupal-console version: 1.0.7 - src: geerlingguy.drush @@ -22,21 +22,21 @@ - src: geerlingguy.elasticsearch version: 2.1.1 - src: geerlingguy.firewall - version: 1.0.9 + version: 1.1.0 - src: geerlingguy.git version: 1.1.1 - src: geerlingguy.java - version: 1.4.0 + version: 1.4.1 - src: geerlingguy.mailhog version: 2.0.0 - src: geerlingguy.memcached version: 1.0.4 - src: geerlingguy.mysql - version: 2.3.1 + version: 2.3.2 - src: geerlingguy.nginx version: 1.9.3 - src: geerlingguy.nodejs - version: 3.2.0 + version: 3.3.0 - src: geerlingguy.php version: 3.2.2 - src: geerlingguy.php-memcached @@ -60,10 +60,10 @@ - src: geerlingguy.repo-remi version: 1.2.0 - src: geerlingguy.ruby - version: 2.3.1 + version: 2.4.0 - src: geerlingguy.security version: 1.4.0 - src: geerlingguy.solr version: 3.1.3 - src: geerlingguy.varnish - version: 1.6.1 + version: 1.6.2 diff --git a/provisioning/roles/geerlingguy.apache/.travis.yml b/provisioning/roles/geerlingguy.apache/.travis.yml index 163e4c3b4..3792fd2fd 100644 --- a/provisioning/roles/geerlingguy.apache/.travis.yml +++ b/provisioning/roles/geerlingguy.apache/.travis.yml @@ -2,37 +2,47 @@ sudo: required env: - - distribution: centos - version: 6 - init: /sbin/init - run_opts: "" - - distribution: centos - version: 7 - init: /usr/lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - - distribution: ubuntu - version: 14.04 - init: /sbin/init - run_opts: "" - - distribution: ubuntu - version: 12.04 - init: /sbin/init - run_opts: "" + global: + # https://github.com/travis-ci/travis-ci/issues/6461#issuecomment-239577306 + DOCKER_VERSION: "1.9.1-0~trusty" + matrix: + - repository: geerlingguy/docker-centos7-ansible + version: latest + init: /usr/lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - repository: geerlingguy/docker-centos6-ansible + version: latest + init: /sbin/init + run_opts: "" + - repository: geerlingguy/docker-ubuntu1604-ansible + version: latest + init: /lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - repository: geerlingguy/docker-ubuntu1404-ansible + version: latest + init: /sbin/init + run_opts: "" + - repository: geerlingguy/docker-ubuntu1204-ansible + version: latest + init: /sbin/init + run_opts: "" services: - docker before_install: - # - sudo apt-get update - # Pull container - - 'sudo docker pull ${distribution}:${version}' - # Customize container - - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' + # Downgrade to specific version of Docker engine. + - sudo apt-get update + - sudo apt-get remove docker-engine -yq + - sudo apt-get install docker-engine=$DOCKER_VERSION -yq --no-install-suggests --no-install-recommends --force-yes -o Dpkg::Options::="--force-confnew" + + # Pull container. + - 'sudo docker pull ${repository}:${version}' script: - container_id=$(mktemp) - # Run container in detached state - - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + # Run container in detached state. + - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${repository}:${version} "${init}" > "${container_id}"' # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' diff --git a/provisioning/roles/geerlingguy.apache/tasks/setup-Debian.yml b/provisioning/roles/geerlingguy.apache/tasks/setup-Debian.yml index 8d72deb1b..43b9a77d8 100644 --- a/provisioning/roles/geerlingguy.apache/tasks/setup-Debian.yml +++ b/provisioning/roles/geerlingguy.apache/tasks/setup-Debian.yml @@ -1,6 +1,6 @@ --- - name: Update apt cache. - apt: update_cache=yes cache_valid_time=86400 + apt: update_cache=yes cache_valid_time=3600 - name: Ensure Apache is installed on Debian. apt: "name={{ item }} state=installed" diff --git a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.centos-6 b/provisioning/roles/geerlingguy.apache/tests/Dockerfile.centos-6 deleted file mode 100644 index 4a4e7b8d6..000000000 --- a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.centos-6 +++ /dev/null @@ -1,15 +0,0 @@ -FROM centos:6 - -# Install Ansible -RUN yum -y update; yum clean all; -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.centos-7 b/provisioning/roles/geerlingguy.apache/tests/Dockerfile.centos-7 deleted file mode 100644 index 8aa065497..000000000 --- a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.centos-7 +++ /dev/null @@ -1,27 +0,0 @@ -FROM centos:7 - -# Install systemd -- See https://hub.docker.com/_/centos/ -RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs -RUN yum -y update; yum clean all; \ -(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/*; - -# Install Ansible -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -VOLUME ["/sys/fs/cgroup"] -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.ubuntu-12.04 b/provisioning/roles/geerlingguy.apache/tests/Dockerfile.ubuntu-12.04 deleted file mode 100644 index d0c130cdf..000000000 --- a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.ubuntu-12.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:12.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common python-software-properties git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.ubuntu-14.04 b/provisioning/roles/geerlingguy.apache/tests/Dockerfile.ubuntu-14.04 deleted file mode 100644 index ca332871f..000000000 --- a/provisioning/roles/geerlingguy.apache/tests/Dockerfile.ubuntu-14.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:14.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.composer/.travis.yml b/provisioning/roles/geerlingguy.composer/.travis.yml index 319088cb4..f0085c4ef 100644 --- a/provisioning/roles/geerlingguy.composer/.travis.yml +++ b/provisioning/roles/geerlingguy.composer/.travis.yml @@ -2,29 +2,26 @@ sudo: required env: - - distribution: centos - version: 7 + - repository: geerlingguy/docker-centos7-ansible + version: latest init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - - distribution: ubuntu - version: 14.04 - init: /sbin/init - run_opts: "" + - repository: geerlingguy/docker-ubuntu1604-ansible + version: latest + init: /lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" services: - docker before_install: - # - sudo apt-get update - # Pull container - - 'sudo docker pull ${distribution}:${version}' - # Customize container - - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' + # Pull container. + - 'sudo docker pull ${repository}:${version}' script: - container_id=$(mktemp) - # Run container in detached state - - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + # Run container in detached state. + - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${repository}:${version} "${init}" > "${container_id}"' # Install dependencies. - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' @@ -36,16 +33,18 @@ script: - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' # Test role idempotence. + - idempotence=$(mktemp) + - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} - > - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml + tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) # Ensure Composer is installed and working. - - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm composer' + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm composer || true' - # Clean up + # Clean up. - 'sudo docker stop "$(cat ${container_id})"' notifications: diff --git a/provisioning/roles/geerlingguy.composer/tests/Dockerfile.centos-7 b/provisioning/roles/geerlingguy.composer/tests/Dockerfile.centos-7 deleted file mode 100644 index 8aa065497..000000000 --- a/provisioning/roles/geerlingguy.composer/tests/Dockerfile.centos-7 +++ /dev/null @@ -1,27 +0,0 @@ -FROM centos:7 - -# Install systemd -- See https://hub.docker.com/_/centos/ -RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs -RUN yum -y update; yum clean all; \ -(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/*; - -# Install Ansible -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -VOLUME ["/sys/fs/cgroup"] -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.composer/tests/Dockerfile.ubuntu-14.04 b/provisioning/roles/geerlingguy.composer/tests/Dockerfile.ubuntu-14.04 deleted file mode 100644 index f81cabec6..000000000 --- a/provisioning/roles/geerlingguy.composer/tests/Dockerfile.ubuntu-14.04 +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:14.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -COPY initctl_faker . -RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.composer/tests/initctl_faker b/provisioning/roles/geerlingguy.composer/tests/initctl_faker deleted file mode 100644 index a2267f30d..000000000 --- a/provisioning/roles/geerlingguy.composer/tests/initctl_faker +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -ALIAS_CMD="$(echo ""$0"" | sed -e 's?/sbin/??')" - -case "$ALIAS_CMD" in - start|stop|restart|reload|status) - exec service $1 $ALIAS_CMD - ;; -esac - -case "$1" in - list ) - exec service --status-all - ;; - reload-configuration ) - exec service $2 restart - ;; - start|stop|restart|reload|status) - exec service $2 $1 - ;; - \?) - exit 0 - ;; -esac diff --git a/provisioning/roles/geerlingguy.composer/tests/inventory b/provisioning/roles/geerlingguy.composer/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/provisioning/roles/geerlingguy.composer/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/provisioning/roles/geerlingguy.composer/tests/requirements.yml b/provisioning/roles/geerlingguy.composer/tests/requirements.yml index 80e765f13..86d9ed78e 100644 --- a/provisioning/roles/geerlingguy.composer/tests/requirements.yml +++ b/provisioning/roles/geerlingguy.composer/tests/requirements.yml @@ -1,3 +1,4 @@ --- - src: geerlingguy.repo-remi +- src: geerlingguy.git - src: geerlingguy.php diff --git a/provisioning/roles/geerlingguy.composer/tests/test.yml b/provisioning/roles/geerlingguy.composer/tests/test.yml index c76d2a4b3..f560931dc 100644 --- a/provisioning/roles/geerlingguy.composer/tests/test.yml +++ b/provisioning/roles/geerlingguy.composer/tests/test.yml @@ -8,14 +8,17 @@ # Test a global requirement. composer_global_packages: - - { name: phpunit/phpunit, release: "@stable" } + - name: phpunit/phpunit + release: "@stable" pre_tasks: - - name: Add repository for PHP 7.0. - apt_repository: repo='ppa:ondrej/php' - when: ansible_os_family == 'Debian' + - name: Update apt cache. + apt: update_cache=yes + when: ansible_distribution == 'Ubuntu' roles: - - { role: geerlingguy.repo-remi, when: ansible_os_family == 'RedHat' } + - role: geerlingguy.repo-remi + when: ansible_os_family == 'RedHat' + - geerlingguy.git - geerlingguy.php - role_under_test diff --git a/provisioning/roles/geerlingguy.daemonize/.travis.yml b/provisioning/roles/geerlingguy.daemonize/.travis.yml index fee7c8ba1..53f562446 100644 --- a/provisioning/roles/geerlingguy.daemonize/.travis.yml +++ b/provisioning/roles/geerlingguy.daemonize/.travis.yml @@ -2,20 +2,24 @@ sudo: required env: - - distribution: centos - version: 6 + - repository: geerlingguy/docker-centos7-ansible + version: latest + init: /usr/lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - repository: geerlingguy/docker-centos6-ansible + version: latest init: /sbin/init run_opts: "" - - distribution: centos - version: 7 - init: /usr/lib/systemd/systemd + - repository: geerlingguy/docker-ubuntu1604-ansible + version: latest + init: /lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - - distribution: ubuntu - version: 14.04 + - repository: geerlingguy/docker-ubuntu1404-ansible + version: latest init: /sbin/init run_opts: "" - - distribution: ubuntu - version: 12.04 + - repository: geerlingguy/docker-ubuntu1204-ansible + version: latest init: /sbin/init run_opts: "" @@ -23,16 +27,13 @@ services: - docker before_install: - # - sudo apt-get update - # Pull container - - 'sudo docker pull ${distribution}:${version}' - # Customize container - - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' + # Pull container. + - 'sudo docker pull ${repository}:${version}' script: - container_id=$(mktemp) - # Run container in detached state - - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + # Run container in detached state. + - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${repository}:${version} "${init}" > "${container_id}"' # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' @@ -40,17 +41,19 @@ script: # Test role. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' - # Ensure daemonize is available. - - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm which daemonize' - # Test role idempotence. + - idempotence=$(mktemp) + - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} - > - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml + tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) - # Clean up + # Ensure daemonize is available. + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm which daemonize' + + # Clean up. - 'sudo docker stop "$(cat ${container_id})"' notifications: diff --git a/provisioning/roles/geerlingguy.daemonize/README.md b/provisioning/roles/geerlingguy.daemonize/README.md index 5beefbffd..c2f219022 100644 --- a/provisioning/roles/geerlingguy.daemonize/README.md +++ b/provisioning/roles/geerlingguy.daemonize/README.md @@ -40,4 +40,4 @@ MIT / BSD ## Author Information -This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/). +This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.centos-6 b/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.centos-6 deleted file mode 100644 index 4a4e7b8d6..000000000 --- a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.centos-6 +++ /dev/null @@ -1,15 +0,0 @@ -FROM centos:6 - -# Install Ansible -RUN yum -y update; yum clean all; -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.centos-7 b/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.centos-7 deleted file mode 100644 index 8aa065497..000000000 --- a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.centos-7 +++ /dev/null @@ -1,27 +0,0 @@ -FROM centos:7 - -# Install systemd -- See https://hub.docker.com/_/centos/ -RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs -RUN yum -y update; yum clean all; \ -(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/*; - -# Install Ansible -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -VOLUME ["/sys/fs/cgroup"] -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.ubuntu-12.04 b/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.ubuntu-12.04 deleted file mode 100644 index d0c130cdf..000000000 --- a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.ubuntu-12.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:12.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common python-software-properties git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.ubuntu-14.04 b/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.ubuntu-14.04 deleted file mode 100644 index ca332871f..000000000 --- a/provisioning/roles/geerlingguy.daemonize/tests/Dockerfile.ubuntu-14.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:14.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.daemonize/tests/test.yml b/provisioning/roles/geerlingguy.daemonize/tests/test.yml index 4b03ee45e..068c5e54d 100644 --- a/provisioning/roles/geerlingguy.daemonize/tests/test.yml +++ b/provisioning/roles/geerlingguy.daemonize/tests/test.yml @@ -1,3 +1,4 @@ +--- - hosts: all pre_tasks: @@ -11,6 +12,10 @@ - which when: ansible_os_family == 'RedHat' + - name: Update apt cache. + apt: update_cache=yes + when: ansible_os_family == 'Debian' + - name: Ensure build dependencies are installed (Debian). apt: 'name="{{ item }}" state=installed' with_items: diff --git a/provisioning/roles/geerlingguy.firewall/.travis.yml b/provisioning/roles/geerlingguy.firewall/.travis.yml index a26b16a82..661b78db5 100644 --- a/provisioning/roles/geerlingguy.firewall/.travis.yml +++ b/provisioning/roles/geerlingguy.firewall/.travis.yml @@ -1,60 +1,90 @@ --- -language: python -python: "2.7" +sudo: required env: - - SITE=test.yml + global: + # https://github.com/travis-ci/travis-ci/issues/6461#issuecomment-239577306 + DOCKER_VERSION: "1.9.1-0~trusty" + matrix: + - distro: centos7 + init: /usr/lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - distro: centos6 + init: /sbin/init + run_opts: "--privileged" + - distro: ubuntu1604 + init: /lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - distro: ubuntu1404 + init: /sbin/init + run_opts: "--privileged" + - distro: ubuntu1204 + init: /sbin/init + run_opts: "--privileged" -before_install: - - sudo apt-get update -qq - - sudo apt-get install -y curl +services: + - docker -install: - # Install Ansible. - - pip install ansible +before_install: + # Downgrade to specific version of Docker engine. + - sudo apt-get update + - sudo apt-get remove docker-engine -yq + - sudo apt-get install docker-engine=$DOCKER_VERSION -yq --no-install-suggests --no-install-recommends --force-yes -o Dpkg::Options::="--force-confnew" - # Add ansible.cfg to pick up roles path. - - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" + # Pull container. + - 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest' script: - # Check the role/playbook's syntax. - - "ansible-playbook -i tests/inventory tests/$SITE --syntax-check" + - container_id=$(mktemp) + # Run container in detached state. + - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' + + # Ansible syntax check. + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' - # Run the role/playbook with ansible-playbook. - - "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo" + # Test role. + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' - # Run the role/playbook again, checking to make sure it's idempotent. + # Test role idempotence. + - idempotence=$(mktemp) + - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} - > - ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo + tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) - # Check if TCP port 9123 is open. - - > - sudo iptables -L -n - | grep -q "ACCEPT.*dpt:9123" - && (echo 'Port 9123 is open - pass' && exit 0) - || (echo 'Port 9123 is not open - fail' && exit 1) + # # Check if TCP port 9123 is open. + # - > + # sudo iptables -L -n + # | grep -q "ACCEPT.*dpt:9123" + # && (echo 'Port 9123 is open - pass' && exit 0) + # || (echo 'Port 9123 is not open - fail' && exit 1) - # Check running firewall has exit code 0 - - > - sudo service firewall status - && (echo 'Status of running firewall is 0 - pass' && exit 0) - || (echo 'Status of running firewall is not 0 - fail' && exit 1) + # # Check running firewall has exit code 0 + # - > + # sudo service firewall status + # && (echo 'Status of running firewall is 0 - pass' && exit 0) + # || (echo 'Status of running firewall is not 0 - fail' && exit 1) - # Stop firewall - - > - sudo service firewall stop - && (echo 'Stopping firewall - pass' && exit 0) - || (echo 'Stopping firewall - fail' && exit 1) + # # Stop firewall + # - > + # sudo service firewall stop + # && (echo 'Stopping firewall - pass' && exit 0) + # || (echo 'Stopping firewall - fail' && exit 1) - # Check stopped firewall has exit code 3 - - > - sudo service firewall status; - EXIT=$?; - if [ 3 -eq $EXIT ]; then - echo 'Status of stopped firewall is 3 - pass' && exit 0; - else - echo 'Status of stopped firewall is not 3 - fail' && exit 1; - fi + # # Check stopped firewall has exit code 3 + # - > + # sudo service firewall status; + # EXIT=$?; + # if [ 3 -eq $EXIT ]; then + # echo 'Status of stopped firewall is 3 - pass' && exit 0; + # else + # echo 'Status of stopped firewall is not 3 - fail' && exit 1; + # fi + + # Clean up. + - 'sudo docker stop "$(cat ${container_id})"' + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/provisioning/roles/geerlingguy.firewall/README.md b/provisioning/roles/geerlingguy.firewall/README.md index 415dec0cd..a0ee2d4c0 100644 --- a/provisioning/roles/geerlingguy.firewall/README.md +++ b/provisioning/roles/geerlingguy.firewall/README.md @@ -14,7 +14,7 @@ None. ## Role Variables -Available variables are listed below, along with default values (see `vars/main.yml`): +Available variables are listed below, along with default values (see `defaults/main.yml`): firewall_allowed_tcp_ports: - "22" @@ -69,4 +69,4 @@ MIT / BSD ## Author Information -This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/). +This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/provisioning/roles/geerlingguy.firewall/meta/main.yml b/provisioning/roles/geerlingguy.firewall/meta/main.yml index fb1434993..ad32fda49 100644 --- a/provisioning/roles/geerlingguy.firewall/meta/main.yml +++ b/provisioning/roles/geerlingguy.firewall/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: description: Simple iptables firewall for most Unix-like systems. company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 1.4 + min_ansible_version: 1.8 platforms: - name: EL versions: @@ -17,6 +17,7 @@ galaxy_info: - name: Ubuntu versions: - all - categories: + galaxy_tags: - networking - system + - security diff --git a/provisioning/roles/geerlingguy.firewall/tests/inventory b/provisioning/roles/geerlingguy.firewall/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/provisioning/roles/geerlingguy.firewall/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/provisioning/roles/geerlingguy.firewall/tests/test.yml b/provisioning/roles/geerlingguy.firewall/tests/test.yml index 20809d1f8..505ba5fe1 100644 --- a/provisioning/roles/geerlingguy.firewall/tests/test.yml +++ b/provisioning/roles/geerlingguy.firewall/tests/test.yml @@ -1,8 +1,14 @@ --- -- hosts: localhost - remote_user: root +- hosts: all + vars: - - firewall_allowed_tcp_ports: + firewall_allowed_tcp_ports: - "9123" + + pre_tasks: + - name: Update apt cache. + apt: update_cache=yes + when: ansible_os_family == 'Debian' + roles: - - ansible-role-firewall + - role_under_test diff --git a/provisioning/roles/geerlingguy.java/.travis.yml b/provisioning/roles/geerlingguy.java/.travis.yml index e14ea79f1..d6c8ef8c5 100644 --- a/provisioning/roles/geerlingguy.java/.travis.yml +++ b/provisioning/roles/geerlingguy.java/.travis.yml @@ -2,20 +2,19 @@ sudo: required env: - - distribution: centos - version: 6 + - distro: centos6 init: /sbin/init run_opts: "" - - distribution: centos - version: 7 + - distro: centos7 init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - - distribution: ubuntu - version: 14.04 + - distro: ubuntu1604 + init: /lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - distro: ubuntu1404 init: /sbin/init run_opts: "" - - distribution: ubuntu - version: 12.04 + - distro: ubuntu1204 init: /sbin/init run_opts: "" @@ -23,15 +22,13 @@ services: - docker before_install: - # Pull container - - 'sudo docker pull ${distribution}:${version}' - # Customize container - - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' + # Pull container. + - 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest' script: - container_id=$(mktemp) - # Run container in detached state - - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + # Run container in detached state. + - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' @@ -40,18 +37,20 @@ script: - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' # Test role idempotence. + - idempotence=$(mktemp) + - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} - > - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml + tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) - # Ensure daemonize is available. + # Ensure Java is installed. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm which java' - # Clean up +after_success: + # Clean up. - 'sudo docker stop "$(cat ${container_id})"' notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ - diff --git a/provisioning/roles/geerlingguy.java/README.md b/provisioning/roles/geerlingguy.java/README.md index 483ad3f52..3a2295854 100644 --- a/provisioning/roles/geerlingguy.java/README.md +++ b/provisioning/roles/geerlingguy.java/README.md @@ -59,4 +59,4 @@ MIT / BSD ## Author Information -This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/). +This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/provisioning/roles/geerlingguy.java/tasks/setup-Debian.yml b/provisioning/roles/geerlingguy.java/tasks/setup-Debian.yml index f1adc7574..205da4e8f 100644 --- a/provisioning/roles/geerlingguy.java/tasks/setup-Debian.yml +++ b/provisioning/roles/geerlingguy.java/tasks/setup-Debian.yml @@ -1,7 +1,7 @@ --- - name: Update apt cache. - apt: update_cache=yes cache_valid_time=86400 + apt: update_cache=yes cache_valid_time=3600 - name: Ensure Java is installed. - apt: "name={{ item }} state=installed" + apt: "name={{ item }} state=present" with_items: "{{ java_packages }}" diff --git a/provisioning/roles/geerlingguy.java/tests/Dockerfile.centos-6 b/provisioning/roles/geerlingguy.java/tests/Dockerfile.centos-6 deleted file mode 100644 index 4a4e7b8d6..000000000 --- a/provisioning/roles/geerlingguy.java/tests/Dockerfile.centos-6 +++ /dev/null @@ -1,15 +0,0 @@ -FROM centos:6 - -# Install Ansible -RUN yum -y update; yum clean all; -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.java/tests/Dockerfile.centos-7 b/provisioning/roles/geerlingguy.java/tests/Dockerfile.centos-7 deleted file mode 100644 index 8aa065497..000000000 --- a/provisioning/roles/geerlingguy.java/tests/Dockerfile.centos-7 +++ /dev/null @@ -1,27 +0,0 @@ -FROM centos:7 - -# Install systemd -- See https://hub.docker.com/_/centos/ -RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs -RUN yum -y update; yum clean all; \ -(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/*; - -# Install Ansible -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -VOLUME ["/sys/fs/cgroup"] -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.java/tests/Dockerfile.ubuntu-12.04 b/provisioning/roles/geerlingguy.java/tests/Dockerfile.ubuntu-12.04 deleted file mode 100644 index d0c130cdf..000000000 --- a/provisioning/roles/geerlingguy.java/tests/Dockerfile.ubuntu-12.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:12.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common python-software-properties git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.java/tests/Dockerfile.ubuntu-14.04 b/provisioning/roles/geerlingguy.java/tests/Dockerfile.ubuntu-14.04 deleted file mode 100644 index ca332871f..000000000 --- a/provisioning/roles/geerlingguy.java/tests/Dockerfile.ubuntu-14.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:14.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.mysql/.travis.yml b/provisioning/roles/geerlingguy.mysql/.travis.yml index 24c1c0910..5ffce09dd 100644 --- a/provisioning/roles/geerlingguy.mysql/.travis.yml +++ b/provisioning/roles/geerlingguy.mysql/.travis.yml @@ -7,26 +7,35 @@ env: init: /sbin/init run_opts: "" playbook: test.yml + DOCKER_VERSION: "1.9.1-0~trusty" - distribution: centos version: 7 init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: centos-7-test.yml + DOCKER_VERSION: "1.9.1-0~trusty" - distribution: ubuntu version: 14.04 init: /sbin/init run_opts: "" playbook: test.yml + DOCKER_VERSION: "1.9.1-0~trusty" # - distribution: ubuntu # version: 12.04 # init: /sbin/init # run_opts: "" # playbook: test.yml + # DOCKER_VERSION: "1.9.1-0~trusty" services: - docker before_install: + # Downgrade to older version of Docker engine. + - sudo apt-get update + - sudo apt-get remove docker-engine -yq + - sudo apt-get install docker-engine=$DOCKER_VERSION -yq --no-install-suggests --no-install-recommends --force-yes -o Dpkg::Options::="--force-confnew" + # Pull container - 'sudo docker pull ${distribution}:${version}' # Customize container @@ -74,5 +83,11 @@ script: # Clean up - sudo docker stop "$(cat ${container_id})" +after_failure: + # Check MySQL settings. + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql/error.log' + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql.err' + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql.log' + notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/provisioning/roles/geerlingguy.mysql/defaults/main.yml b/provisioning/roles/geerlingguy.mysql/defaults/main.yml index 7f25f14f3..3bd78bbaa 100644 --- a/provisioning/roles/geerlingguy.mysql/defaults/main.yml +++ b/provisioning/roles/geerlingguy.mysql/defaults/main.yml @@ -44,7 +44,10 @@ mysql_read_rnd_buffer_size: "4M" mysql_myisam_sort_buffer_size: "64M" mysql_thread_cache_size: "8" mysql_query_cache_size: "16M" +mysql_query_cache_limit: "1M" mysql_max_connections: "151" +mysql_tmp_table_size: "16M" +mysql_max_heap_table_size: "16M" # Other settings. mysql_lower_case_table_names: "0" diff --git a/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 b/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 index c16a91d3a..e3a3c0ca9 100644 --- a/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 +++ b/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 @@ -77,7 +77,10 @@ read_rnd_buffer_size = {{ mysql_read_rnd_buffer_size }} myisam_sort_buffer_size = {{ mysql_myisam_sort_buffer_size }} thread_cache_size = {{ mysql_thread_cache_size }} query_cache_size = {{ mysql_query_cache_size }} +query_cache_limit = {{ mysql_query_cache_limit }} max_connections = {{ mysql_max_connections }} +tmp_table_size = {{ mysql_tmp_table_size }} +max_heap_table_size = {{ mysql_max_heap_table_size }} # Other settings. wait_timeout = {{ mysql_wait_timeout }} @@ -108,4 +111,3 @@ pid-file = {{ mysql_pid_file }} # !includedir {{ mysql_config_include_dir }} {% endif %} - diff --git a/provisioning/roles/geerlingguy.nodejs/.travis.yml b/provisioning/roles/geerlingguy.nodejs/.travis.yml index 6512b6b9e..85e7e06b5 100644 --- a/provisioning/roles/geerlingguy.nodejs/.travis.yml +++ b/provisioning/roles/geerlingguy.nodejs/.travis.yml @@ -2,20 +2,19 @@ sudo: required env: - - distribution: centos - version: 6 - init: /sbin/init - run_opts: "" - - distribution: centos - version: 7 + - distro: centos7 init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - - distribution: ubuntu - version: 14.04 + # - distro: centos6 + # init: /sbin/init + # run_opts: "" + - distro: ubuntu1604 + init: /lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + - distro: ubuntu1404 init: /sbin/init run_opts: "" - - distribution: ubuntu - version: 12.04 + - distro: ubuntu1204 init: /sbin/init run_opts: "" @@ -23,15 +22,16 @@ services: - docker before_install: - # Pull container - - 'sudo docker pull ${distribution}:${version}' - # Customize container - - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' + # Pull container. + - 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest' script: - container_id=$(mktemp) - # Run container in detached state - - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + # Run container in detached state. + - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' + + # Install dependencies. + - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' @@ -40,8 +40,10 @@ script: - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' # Test role idempotence. + - idempotence=$(mktemp) + - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} - > - sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml + tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) @@ -55,7 +57,8 @@ script: - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm bash --login -c "npm list -g --depth=0 node-sass"' - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm bash --login -c "npm list -g --depth=0 yo"' - # Clean up +after_success: + # Clean up. - 'sudo docker stop "$(cat ${container_id})"' notifications: diff --git a/provisioning/roles/geerlingguy.nodejs/README.md b/provisioning/roles/geerlingguy.nodejs/README.md index 0fce6fcb4..12b89d7b3 100644 --- a/provisioning/roles/geerlingguy.nodejs/README.md +++ b/provisioning/roles/geerlingguy.nodejs/README.md @@ -63,4 +63,4 @@ MIT / BSD ## Author Information -This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/). +This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/provisioning/roles/geerlingguy.nodejs/tasks/setup-Debian.yml b/provisioning/roles/geerlingguy.nodejs/tasks/setup-Debian.yml index f88c4eef0..c939617e4 100644 --- a/provisioning/roles/geerlingguy.nodejs/tasks/setup-Debian.yml +++ b/provisioning/roles/geerlingguy.nodejs/tasks/setup-Debian.yml @@ -4,7 +4,8 @@ - name: Add Nodesource apt key. apt_key: - url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280 + id: "68576280" state: present - name: Add NodeSource repositories for Node.js. diff --git a/provisioning/roles/geerlingguy.nodejs/tasks/setup-RedHat.yml b/provisioning/roles/geerlingguy.nodejs/tasks/setup-RedHat.yml index 984b1814d..40eabc0c9 100644 --- a/provisioning/roles/geerlingguy.nodejs/tasks/setup-RedHat.yml +++ b/provisioning/roles/geerlingguy.nodejs/tasks/setup-RedHat.yml @@ -9,6 +9,11 @@ nodejs_rhel_rpm_dir: "pub" when: nodejs_version == '0.10' +- name: Import Nodesource RPM key. + rpm_key: + key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL + state: present + - name: Add Nodesource repositories for Node.js. yum: name: "https://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm" diff --git a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.centos-6 b/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.centos-6 deleted file mode 100644 index 4a4e7b8d6..000000000 --- a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.centos-6 +++ /dev/null @@ -1,15 +0,0 @@ -FROM centos:6 - -# Install Ansible -RUN yum -y update; yum clean all; -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.centos-7 b/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.centos-7 deleted file mode 100644 index 8aa065497..000000000 --- a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.centos-7 +++ /dev/null @@ -1,27 +0,0 @@ -FROM centos:7 - -# Install systemd -- See https://hub.docker.com/_/centos/ -RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs -RUN yum -y update; yum clean all; \ -(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/*; - -# Install Ansible -RUN yum -y install epel-release -RUN yum -y install git ansible sudo -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -VOLUME ["/sys/fs/cgroup"] -CMD ["/usr/sbin/init"] diff --git a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.ubuntu-12.04 b/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.ubuntu-12.04 deleted file mode 100644 index d0c130cdf..000000000 --- a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.ubuntu-12.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:12.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common python-software-properties git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.ubuntu-14.04 b/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.ubuntu-14.04 deleted file mode 100644 index ca332871f..000000000 --- a/provisioning/roles/geerlingguy.nodejs/tests/Dockerfile.ubuntu-14.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:14.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/provisioning/roles/geerlingguy.nodejs/tests/test.yml b/provisioning/roles/geerlingguy.nodejs/tests/test.yml index 9dfa879bf..45c9f415e 100644 --- a/provisioning/roles/geerlingguy.nodejs/tests/test.yml +++ b/provisioning/roles/geerlingguy.nodejs/tests/test.yml @@ -19,6 +19,10 @@ - which when: ansible_os_family == 'RedHat' + - name: Update apt cache. + apt: update_cache=yes + when: ansible_os_family == 'Debian' + - name: Ensure build dependencies are installed (Debian). apt: 'name="{{ item }}" state=installed' with_items: diff --git a/provisioning/roles/geerlingguy.ruby/README.md b/provisioning/roles/geerlingguy.ruby/README.md index 2c0061724..e6ab8d9fa 100644 --- a/provisioning/roles/geerlingguy.ruby/README.md +++ b/provisioning/roles/geerlingguy.ruby/README.md @@ -16,9 +16,9 @@ Available variables are listed below, along with default values (see `defaults/m The location where temporary files will be downloaded in preparation for Ruby installation. - ruby_rubygems_package_name: rubygems + ruby_install_bundler: true -The name of the `rubygems` package. Generally, the default should work; but it will be set to `rubygems-integration` automatically on Ubuntu Trusty (14.04). +Whether this role should install [Bundler](http://bundler.io/). ruby_install_gems: [] @@ -40,6 +40,10 @@ The URL from which Ruby will be downloaded (only used if `ruby_install_from_sour The version of ruby that will be installed (only used if `ruby_install_from_source` is `true`). + ruby_rubygems_package_name: rubygems + +The name of the `rubygems` package. Generally, the default should work; but it will be set to `rubygems-integration` automatically on Ubuntu Trusty (14.04). + ## Dependencies None. diff --git a/provisioning/roles/geerlingguy.ruby/defaults/main.yml b/provisioning/roles/geerlingguy.ruby/defaults/main.yml index bd0698362..93e4f9b9e 100644 --- a/provisioning/roles/geerlingguy.ruby/defaults/main.yml +++ b/provisioning/roles/geerlingguy.ruby/defaults/main.yml @@ -1,11 +1,14 @@ --- workspace: /root +# Whether this role should install Bundler. +ruby_install_bundler: true + # A list of Ruby gems to install. ruby_install_gems: [] # The user account under which Ruby gems will be installed. -# ruby_install_gems_user: username +ruby_install_gems_user: "{{ ansible_user }}" # If set to TRUE, ruby will be installed from source, using the version set with # the 'ruby_version' variable instead of using a package. @@ -13,4 +16,5 @@ ruby_install_from_source: false ruby_download_url: http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz ruby_version: 2.3.0 +# Default should usually work, but this will be overridden on Ubuntu 14.04. ruby_rubygems_package_name: rubygems diff --git a/provisioning/roles/geerlingguy.ruby/meta/main.yml b/provisioning/roles/geerlingguy.ruby/meta/main.yml index 6c5c21ba1..3cb9fa82c 100644 --- a/provisioning/roles/geerlingguy.ruby/meta/main.yml +++ b/provisioning/roles/geerlingguy.ruby/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: description: Ruby installation for Linux. company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 1.9 + min_ansible_version: 2.0 platforms: - name: EL versions: diff --git a/provisioning/roles/geerlingguy.ruby/tasks/main.yml b/provisioning/roles/geerlingguy.ruby/tasks/main.yml index b79d38b4e..6d959bbf5 100644 --- a/provisioning/roles/geerlingguy.ruby/tasks/main.yml +++ b/provisioning/roles/geerlingguy.ruby/tasks/main.yml @@ -13,11 +13,7 @@ # Install Bundler and configured gems. - name: Install Bundler. gem: name=bundler state=present user_install=no - -- name: Define ruby_install_gems_user. - set_fact: - ruby_install_gems_user: "{{ ansible_ssh_user }}" - when: ruby_install_gems_user is not defined + when: ruby_install_bundler - name: Install configured gems. gem: "name={{ item }} state=present" diff --git a/provisioning/roles/geerlingguy.varnish/tasks/main.yml b/provisioning/roles/geerlingguy.varnish/tasks/main.yml index ffdaae452..ffa76f313 100644 --- a/provisioning/roles/geerlingguy.varnish/tasks/main.yml +++ b/provisioning/roles/geerlingguy.varnish/tasks/main.yml @@ -25,7 +25,7 @@ dest: "{{ varnish_systemd_config_path }}/varnish.service" owner: root group: root - mode: 0655 + mode: 0644 when: > (ansible_os_family == 'Debian') and (ansible_distribution_release == "jessie" or ansible_distribution_release == "xenial")