From 6352bdbd1e9018e4f04a52996cbd7691780e3864 Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Mon, 20 Jun 2022 11:57:30 +0200 Subject: [PATCH] Change default version to 3.8.6 --- .github/workflows/ci.yml | 7 +++---- Dockerfile | 13 ++++++++----- README.md | 2 +- defaults/main.yml | 2 +- meta/main.yml | 5 ++--- molecule/default/collections.yml | 6 ++++++ requirements.yml | 3 +++ tasks/main.yml | 8 ++++---- tests/tasks/pre.yml | 4 ++-- tests/test.yml | 2 +- tests/vagrant.yml | 2 +- 11 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 molecule/default/collections.yml create mode 100644 requirements.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c00f3c..5e5c0cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,9 @@ jobs: python-version: '3.x' - name: Install test dependencies - run: pip install ansible-lint[community,yamllint] + run: | + pip install ansible-lint + ansible-galaxy install -r requirements.yml - name: Lint code run: | @@ -43,11 +45,8 @@ jobs: matrix: include: - distro: debian8 - ansible-version: '<2.10' - distro: debian9 - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.9, <2.10' - distro: ubuntu1604 ansible-version: '>=2.10, <2.11' - distro: ubuntu1604 diff --git a/Dockerfile b/Dockerfile index b179278..6ebe0c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,20 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 MAINTAINER Mischa ter Smitten +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 + # python RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-dev curl && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y python3-minimal python3-dev curl && \ apt-get clean -RUN curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python - +RUN curl -sL https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3 - RUN rm -rf $HOME/.cache # ansible -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \ +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-apt && \ apt-get clean -RUN pip install ansible==2.9.15 +RUN pip3 install ansible==2.10.7 RUN rm -rf $HOME/.cache # provision diff --git a/README.md b/README.md index 37550fb..1d8d957 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ None #### Variables -* `maven_version` [default: `3.8.4`]: Version to install +* `maven_version` [default: `3.8.6`]: Version to install * `maven_install_prefix` [default: `/opt`]: Install prefix ## Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index cc0cf0c..99dbb72 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,4 @@ # defaults file --- -maven_version: 3.8.4 +maven_version: 3.8.6 maven_install_prefix: /opt diff --git a/meta/main.yml b/meta/main.yml index b7c5c73..df28125 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,13 +1,12 @@ # meta file --- galaxy_info: - namespace: oefenweb + author: oefenweb role_name: maven - author: Mischa ter Smitten company: Oefenweb.nl B.V. description: Set up Apache Ant license: MIT - min_ansible_version: 2.9.0 + min_ansible_version: 2.10.0 platforms: - name: Ubuntu versions: diff --git a/molecule/default/collections.yml b/molecule/default/collections.yml new file mode 100644 index 0000000..c3d7e2a --- /dev/null +++ b/molecule/default/collections.yml @@ -0,0 +1,6 @@ +--- +collections: + - name: community.docker + version: '>=1.2.0,<2' + - name: community.general + version: '>=2,<3' diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..3d5f1cd --- /dev/null +++ b/requirements.yml @@ -0,0 +1,3 @@ +# requirements file +--- +collections: [] diff --git a/tasks/main.yml b/tasks/main.yml index ffa3b6d..c4a078d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ # tasks file --- - name: create (download) directory - file: + ansible.builtin.file: path: "{{ maven_downloads_path }}" state: directory owner: root @@ -13,7 +13,7 @@ - maven-download - name: download - get_url: + ansible.builtin.get_url: url: "http://apache.cs.uu.nl/maven/maven-{{ maven_version.split('.')[0] }}/{{ maven_version }}/binaries/apache-maven-{{ maven_version }}-bin.tar.gz" dest: "{{ maven_downloads_path }}/apache-maven-{{ maven_version }}-bin.tar.gz" owner: root @@ -25,7 +25,7 @@ - maven-downloads - name: install - unarchive: + ansible.builtin.unarchive: src: "{{ maven_downloads_path }}/apache-maven-{{ maven_version }}-bin.tar.gz" dest: "{{ maven_install_prefix }}" creates: "{{ maven_install_prefix }}/apache-maven-{{ maven_version }}" @@ -36,7 +36,7 @@ - maven-install - name: verify - command: > + ansible.builtin.command: > {{ maven_install_prefix }}/apache-maven-{{ maven_version }}/bin/mvn -version changed_when: false tags: diff --git a/tests/tasks/pre.yml b/tests/tasks/pre.yml index 4ad8892..503dc45 100644 --- a/tests/tasks/pre.yml +++ b/tests/tasks/pre.yml @@ -2,7 +2,7 @@ --- # See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 - name: ensure man directory - file: + ansible.builtin.file: path: /usr/share/man/man1 state: directory recurse: true @@ -11,7 +11,7 @@ - ansible_distribution_major_version is version('18', '>=') - name: install dependencies - apt: + ansible.builtin.apt: name: - default-jre state: "{{ apt_install_state | default('latest') }}" diff --git a/tests/test.yml b/tests/test.yml index 70ad457..1479e2a 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,6 +5,6 @@ become: true pre_tasks: - name: include tasks - include: "{{ playbook_dir }}/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml" roles: - ../../ diff --git a/tests/vagrant.yml b/tests/vagrant.yml index fed2ce2..a30a990 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,6 +5,6 @@ become: true pre_tasks: - name: include tasks - include: "{{ playbook_dir }}/tasks/pre.yml" + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/pre.yml" roles: - ../../