From cd9767d7d78079af25d78c2349da3d8c0025904f Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Fri, 30 Nov 2018 10:40:47 +0100 Subject: [PATCH] Fix Ansible warnings Add support for Ubuntu 18.04 and Debian 9 and drop support for Ubuntu 12.04 and Debian 7 --- Vagrantfile | 14 -------------- defaults/main.yml | 2 +- meta/main.yml | 1 + tasks/main.yml | 10 +++++----- tests/post.yml | 2 +- 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 64d2358..d68a6f0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,13 +5,6 @@ role = File.basename(File.expand_path(File.dirname(__FILE__))) boxes = [ - { - :name => "ubuntu-1204", - :box => "bento/ubuntu-12.04", - :ip => '10.0.0.11', - :cpu => "50", - :ram => "256" - }, { :name => "ubuntu-1404", :box => "bento/ubuntu-14.04", @@ -33,13 +26,6 @@ boxes = [ :cpu => "50", :ram => "256" }, - { - :name => "debian-7", - :box => "bento/debian-7", - :ip => '10.0.0.15', - :cpu => "50", - :ram => "256" - }, { :name => "debian-8", :box => "bento/debian-8", diff --git a/defaults/main.yml b/defaults/main.yml index bd0d66b..edf20ae 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ # defaults file for nodejs --- -nodejs_version: 'nodejs-v6x' +nodejs_version: 'nodejs-v8x' nodejs_install: # To compile and install native addons from npm you may also need to install build tools diff --git a/meta/main.yml b/meta/main.yml index e5112a0..8068fb3 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,6 +1,7 @@ # meta file for nodejs --- galaxy_info: + role_name: nodejs author: Mischa ter Smitten company: Oefenweb.nl B.V. description: Set up the latest version of Node.js and npm in Debian-like systems diff --git a/tasks/main.yml b/tasks/main.yml index b6836e3..f718689 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,11 +2,10 @@ --- - name: install dependencies apt: - name: "{{ item }}" + name: "{{ nodejs_dependencies }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" - with_items: "{{ nodejs_dependencies }}" tags: - configuration - nodejs @@ -15,9 +14,8 @@ - name: install additional apt: - name: "{{ item }}" + name: "{{ nodejs_install }}" state: "{{ apt_install_state | default('latest') }}" - with_items: "{{ nodejs_install }}" tags: - configuration - nodejs @@ -25,9 +23,11 @@ - nodejs-install-additional - name: add repository and install its signing key - shell: curl -sL https://deb.nodesource.com/setup_{{ nodejs_version_map[nodejs_version] }} | bash - + shell: > + curl -sL https://deb.nodesource.com/setup_{{ nodejs_version_map[nodejs_version] }} | bash - args: creates: /etc/apt/sources.list.d/nodesource.list + warn: false tags: - configuration - nodejs diff --git a/tests/post.yml b/tests/post.yml index 292199f..5c051ae 100644 --- a/tests/post.yml +++ b/tests/post.yml @@ -1,6 +1,6 @@ # post test file for nodejs --- -- name: Run tests +- name: run tests command: "{{ item }}" changed_when: false with_items: