Skip to content

Commit

Permalink
Upgrade role (#127)
Browse files Browse the repository at this point in the history
* Update molecule from 2.12.1 to 2.14.0

* Update testinfra from 1.7.1 to 1.13.0

* Update pytest from 3.5.1 to 3.6.0

* Update testinfra from 1.13.0 to 1.13.1

* Update pytest from 3.6.0 to 3.6.1

* Feature/upgrade ansible (#126)

* Add Bionic, upgrade ansible version

* Update travis settings

* Update molecule role
  • Loading branch information
lmachetel authored Dec 27, 2018
1 parent d431a71 commit 959a17a
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 154 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Travis configuration

dist: 'trusty'
dist: 'xenial'
sudo: 'required'

services:
Expand All @@ -12,9 +12,9 @@ language: 'python'

env:
matrix:
- TOXENV='py27-ansible22'
- TOXENV='py27-ansible23'
- TOXENV='py27-ansible24'
- TOXENV='py27-ansible25'
- TOXENV='py27-ansible26'

install:
- 'pip install tox-travis'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ See molecule documentation to use other backend.
Currently, tests are done on:
- Ubuntu Trusty
- Ubuntu Xenial
- Ubuntu Bionic
- Debian Jessie
- Debian Stretch

and use:
- Ansible 2.2.x
- Ansible 2.3.x
- Ansible 2.4.x
- Ansible 2.5.x
- Ansible 2.6.x

### Running tests

Expand Down Expand Up @@ -203,6 +204,5 @@ MIT
## Author Information
Alexandre Chaussier (for Temelio company)
Alexandre Chaussier, update by Lise Machetel (for Temelio company)
- http://www.temelio.com
- alexandre.chaussier [at] temelio.com
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ statsd_git:

# NPM options
statsd_npm:
global: 'False'
global: false
path: "{{ statsd_user.home }}"
production: 'True'
production: yes
state: 'present'

# Statsd configuration
Expand Down
9 changes: 5 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---

galaxy_info:
author: 'Alexandre Chaussier'
author: 'Alexandre Chaussier, Lise Machetel'
description: 'Ansible role to install and configure Statsd'
company: 'Temelio (http://www.temelio.com)'
license: 'MIT'
min_ansible_version: '2.2'
min_ansible_version: '2.4'
github_branch: 'master'
platforms:
- name: 'Debian'
Expand All @@ -16,11 +16,12 @@ galaxy_info:
versions:
- 'trusty'
- 'xenial'
- 'bionic'
galaxy_tags:
- 'monitoring'
- 'system'
dependencies:
- src: 'geerlingguy.nodejs'
version: '4.1.0'
name: 'geerlingguy.nodejs__4.1.0'
version: '4.2.2'
name: 'geerlingguy.nodejs__4.2.2'
when: 'statsd_use_ansible_galaxy_dependencies or _use_role_dependencies'
9 changes: 5 additions & 4 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
8 changes: 4 additions & 4 deletions molecule/default/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
*******
Install
Docker driver installation guide
*******

Requirements
============

* General molecule dependencies (see https://molecule.readthedocs.io/en/latest/installation.html)
* Docker Engine
* docker-py
* docker

Install
=======

.. code-block:: bash
$ sudo pip install docker-py
$ sudo pip install docker-py
76 changes: 0 additions & 76 deletions molecule/default/create.yml

This file was deleted.

30 changes: 0 additions & 30 deletions molecule/default/destroy.yml

This file was deleted.

9 changes: 7 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ansible:
extra_vars:
ansible_python_interpreter: '/usr/bin/env python2.7'
no_log: 'False'
no_log: true
raw_env_vars:
ANSIBLE_NOCOWS: 1

Expand All @@ -24,6 +24,12 @@ platforms:
cap_add:
- 'SYS_PTRACE'
privileged: True
- name: 'statsd-docker-bionic'
image: 'solita/ubuntu-systemd:18.04'
command: '/sbin/init'
cap_add:
- 'SYS_PTRACE'
privileged: True
- name: 'statsd-docker-jessie'
image: 'minimum2scp/systemd-jessie:latest'
command: '/sbin/init'
Expand All @@ -43,7 +49,6 @@ provisioner:
inventory:
group_vars:
all:
nodejs_version: "4.x"
nodejs_install_npm_user: "root"
scenario:
name: 'default'
Expand Down
5 changes: 5 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@
roles:
- role: "ansible-role-statsd"
vars:
statsd_npm:
global: true
path: "{{ statsd_user.home }}"
production: false
state: 'present'
5 changes: 0 additions & 5 deletions molecule/default/prepare.yml

This file was deleted.

4 changes: 2 additions & 2 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
version: '0.3.0'

- src: 'geerlingguy.nodejs'
version: '4.1.0'
name: 'geerlingguy.nodejs__4.1.0'
version: '4.2.2'
name: 'geerlingguy.nodejs__4.2.2'
11 changes: 5 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
docker==3.2.1
docker-py==1.10.6
molecule==2.14.0
pytest==3.6.0
testinfra==1.13.1
tox==3.0.0
docker==3.5.1
molecule==2.19.0
pytest==4.0.2
testinfra==1.18.0
tox==3.6.1
2 changes: 0 additions & 2 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
owner: "{{ statsd_paths.files.main_config.owner | default(statsd_user.name) }}"
group: "{{ statsd_paths.files.main_config.group | default(statsd_group.name) }}"
mode: "{{ statsd_paths.files.main_config.mode | default('0400') }}"
notify:
- 'HANDLER | Restart statsd'
14 changes: 14 additions & 0 deletions tasks/install_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@
notify:
- 'HANDLER | Restart statsd'

- name: 'INSTALL | NODEJS | Install statsd NodeJS dependencies'
npm:
global: "{{ statsd_npm.global }}"
path: "{{ statsd_npm.path }}"
production: "{{ statsd_npm.production }}"

- name: 'INSTALL | NODEJS | Install statsd NodeJS dependencies'
npm:
global: "{{ statsd_npm.global }}"
path: "{{ statsd_npm.path }}"
production: "{{ statsd_npm.production }}"
notify:
- 'HANDLER | Restart statsd'


- name: 'INSTALL | NODEJS | Install statsd NodeJS dependencies'
npm:
Expand Down
10 changes: 5 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Main tasks file for statsd role

- name: 'INIT | Manage variables to use for our target'
include: "{{ role_path }}/tasks/manage_variables.yml"
include_tasks: "{{ role_path }}/tasks/manage_variables.yml"
tags:
- 'role::statsd'
- 'role::statsd::config'
Expand All @@ -13,31 +13,31 @@

- name: 'INSTALL | Manage os family installation tasks'
become: 'True'
include: "{{ role_path }}/tasks/install_debian.yml"
include_tasks: "{{ role_path }}/tasks/install_debian.yml"
tags:
- 'role::statsd'
- 'role::statsd::install'


- name: 'INSTALL | Manage Git installation tasks'
become: 'True'
include: "{{ role_path }}/tasks/install_git.yml"
include_tasks: "{{ role_path }}/tasks/install_git.yml"
tags:
- 'role::statsd'
- 'role::statsd::install'


- name: 'CONFIG | Manage config tasks'
become: 'True'
include: "{{ role_path }}/tasks/config.yml"
include_tasks: "{{ role_path }}/tasks/config.yml"
tags:
- 'role::statsd'
- 'role::statsd::config'


- name: 'CONFIG | Manage services tasks'
become: 'True'
include: "{{ role_path }}/tasks/manage_service.yml"
include_tasks: "{{ role_path }}/tasks/manage_service.yml"
tags:
- 'role::statsd'
- 'role::statsd::config'
Expand Down
7 changes: 2 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
[tox]
minversion = 1.8
envlist = py{27}-ansible{22,23,24}
envlist = py{27}-ansible{24,25,26}
skipsdist = true

[testenv]
passenv = *
deps =
-rrequirements.txt
ansible22: ansible>=2.2,<2.3
ansible23: ansible>=2.3,<2.4
ansible23: docker==3.2.1
ansible24: ansible>=2.4,<2.5
ansible24: docker==3.2.1
ansible25: ansible>=2.5,<2.6
ansible26: ansible>=2.6,<2.7
commands =
molecule test
3 changes: 3 additions & 0 deletions vars/os_distribution/ubuntu/bionic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

_is_systemd_managed_system: True

0 comments on commit 959a17a

Please sign in to comment.