Skip to content

Commit

Permalink
Fix Ansible warnings
Browse files Browse the repository at this point in the history
And add support for Ubuntu 18.04
  • Loading branch information
tersmitten committed Nov 22, 2018
1 parent 39954a0 commit ca4ef15
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ python: "2.7"

env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.7.2
- ANSIBLE_VERSION=2.7.1
- ANSIBLE_VERSION=2.7.0
- ANSIBLE_VERSION=2.6.8
- ANSIBLE_VERSION=2.6.7
- ANSIBLE_VERSION=2.6.6
- ANSIBLE_VERSION=2.6.5
Expand Down Expand Up @@ -56,7 +58,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
Expand Down
14 changes: 11 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

role = File.basename(File.expand_path(File.dirname(__FILE__)))


boxes = [
{
:name => "ubuntu-1204",
Expand All @@ -25,24 +26,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.16',
:ip => '10.0.0.17',
:cpu => "50",
:ram => "256"
},
Expand Down
4 changes: 3 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# meta file for hostname
# meta file for swapfile
---
galaxy_info:
role_name: ant
author: Mischa ter Smitten
company: Oefenweb.nl B.V.
description: Manage a swap file in Debian-like systems
Expand All @@ -12,6 +13,7 @@ galaxy_info:
- precise
- trusty
- xenial
- bionic
- name: Debian
versions:
- wheezy
Expand Down
17 changes: 12 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
---
- name: install dependencies
apt:
name: "{{ item }}"
name: "{{ swapfile_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
with_items: "{{ swapfile_dependencies }}"
tags:
- configuration
- swapfile
Expand All @@ -16,9 +15,11 @@
- block:

- name: write swap file
command: fallocate -l {{ swapfile_size }} {{ swapfile_file }}
command: >
fallocate -l {{ swapfile_size }} {{ swapfile_file }}
args:
creates: "{{ swapfile_file }}"
warn: false
register: _write_swapfile
tags:
- swapfile-write-file
Expand All @@ -33,14 +34,20 @@
- swapfile-set-file-permissions

- name: create swap file
command: mkswap {{ swapfile_file }}
command: >
mkswap {{ swapfile_file }}
args:
warn: false
register: _create_swapfile
when: _write_swapfile.changed
tags:
- swapfile-mkswap

- name: enable swapfile
command: swapon {{ swapfile_file }}
command: >
swapon {{ swapfile_file }}
args:
warn: false
when: _create_swapfile.changed
tags:
- swapfile-enable-swapfile
Expand Down

0 comments on commit ca4ef15

Please sign in to comment.