From 19de46d726920e5f8758e864459606360e0fd6d9 Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Fri, 4 Jan 2019 12:24:13 +0100 Subject: [PATCH] Fix Ansible warnings Add support for Ubuntu 18.04 and Debian 9 --- .travis.yml | 2 +- Dockerfile | 20 ++++++++++++++++++++ Vagrantfile | 18 ++++++++++++++++-- meta/main.yml | 9 ++++++++- tasks/install.yml | 6 ++++-- 5 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/.travis.yml b/.travis.yml index c6f4580..58648d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,7 @@ script: && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) - - if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml || true; fi + - if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml; fi notifications: email: false diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d9adf96 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:16.04 +MAINTAINER Mischa ter Smitten + +# python +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-dev curl && \ + apt-get clean +RUN curl -sL https://bootstrap.pypa.io/get-pip.py | python - +RUN rm -rf $HOME/.cache + +# ansible +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \ + apt-get clean +RUN pip install ansible==2.3.2.0 +RUN rm -rf $HOME/.cache + +# provision +COPY . /etc/ansible/roles/ansible-role +WORKDIR /etc/ansible/roles/ansible-role +RUN ansible-playbook -i tests/inventory tests/test.yml --connection=local diff --git a/Vagrantfile b/Vagrantfile index 640b861..e2d0d24 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,17 +25,31 @@ boxes = [ :cpu => "50", :ram => "256" }, + { + :name => "ubuntu-1804", + :box => "bento/ubuntu-18.04", + :ip => '10.0.0.14', + :cpu => "50", + :ram => "256" + }, { :name => "debian-7", :box => "bento/debian-7", - :ip => '10.0.0.14', + :ip => '10.0.0.15', :cpu => "50", :ram => "256" }, { :name => "debian-8", :box => "bento/debian-8", - :ip => '10.0.0.15', + :ip => '10.0.0.16', + :cpu => "50", + :ram => "256" + }, + { + :name => "debian-9", + :box => "bento/debian-9", + :ip => '10.0.0.17', :cpu => "50", :ram => "256" }, diff --git a/meta/main.yml b/meta/main.yml index 0858f91..bd64f61 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,6 +1,7 @@ # meta file for phpmemcachedadmin --- galaxy_info: + role_name: phpmemcachedadmin author: Mischa ter Smitten company: Oefenweb.nl B.V. description: Set up phpMemcachedAdmin (Memcached server admin in php for monitoring and debugging) @@ -12,13 +13,19 @@ galaxy_info: - precise - trusty - xenial + - bionic - name: Debian versions: - wheezy - jessie + - stretch galaxy_tags: - system - web - database - - database:nosql + - nosql + - php + - memcached + - monitoring + - debugging dependencies: [] diff --git a/tasks/install.yml b/tasks/install.yml index 783a7c8..2ab4060 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -24,7 +24,8 @@ - phpmemcachedadmin-install-unarchive - name: set file permissions - shell: find . -type f ! -perm 0644 -print0 | xargs --no-run-if-empty -0 chmod -c 0644 + shell: > + find . -type f ! -perm 0644 -print0 | xargs --no-run-if-empty -0 chmod -c 0644 args: chdir: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}" register: _file_permissions @@ -35,7 +36,8 @@ - phpmemcachedadmin-install-file-permissions - name: set dir permissions - shell: find . -type d ! -perm 0755 -print0 | xargs --no-run-if-empty -0 chmod -c 0755 + shell: > + find . -type d ! -perm 0755 -print0 | xargs --no-run-if-empty -0 chmod -c 0755 args: chdir: "{{ item.dest }}/phpMemcachedAdmin-{{ phpmemcachedadmin_version }}" register: _dir_permissions