Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit 7d6991e

Browse files
authored
test different ansible versions (#5)
enable build matrix
1 parent 51b3b1d commit 7d6991e

File tree

4 files changed

+20
-46
lines changed

4 files changed

+20
-46
lines changed

.travis.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,22 @@ language: python
33
cache: pip
44
services:
55
- docker
6-
#before_install:
7-
# - sudo apt-get -qq update
8-
# - sudo apt-get install -y iproute net-tools
6+
env:
7+
- ANSIBLE=2.2.3 PROMETHEUS=1.8.2
8+
- ANSIBLE=2.2.3 PROMETHEUS=2.0.0
9+
- ANSIBLE=2.3.2 PROMETHEUS=1.8.2
10+
- ANSIBLE=2.3.2 PROMETHEUS=2.0.0
11+
- ANSIBLE=2.4.1 PROMETHEUS=1.8.2
12+
- ANSIBLE=2.4.1 PROMETHEUS=2.0.0
913
install:
10-
- pip install ansible==2.3.2 molecule==1.25.0 docker git-semver testinfra>=1.7.0
14+
- pip install ansible==${ANSIBLE} ansible-lint>=3.4.15 molecule==1.25.0 docker git-semver testinfra>=1.7.0
1115
script:
12-
- if [ -f requirements.yml ]; then ansible-galaxy install -r requirements.yml -p .molecule/roles/. ; fi
1316
- molecule test
1417
deploy:
1518
provider: script
1619
skip_cleanup: true
17-
script:
18-
- ./.travis/generatetag.sh
20+
script: ./.travis/generatetag.sh
1921
on:
2022
branch: master
21-
#do not start when tag is added
22-
branches:
23-
only:
24-
- master
25-
tags:
26-
except:
27-
- /^\d+\.\d+\.\d+$/
2823
notifications:
29-
webhooks: https://galaxy.ansible.com/api/v1/notifications/
30-
#after_script:
31-
# - ./.travis/notification.sh
24+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ galaxy_info:
44
description: Deploy Prometheus monitoring system
55
company: Sointeractive
66
license: MIT
7-
min_ansible_version: 2.0
7+
min_ansible_version: 2.2
88
platforms:
99
- name: Ubuntu
1010
versions:

molecule.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
---
22
ansible:
33
playbook: tests/playbook.yml
4+
extra_vars:
5+
version: "${PROMETHEUS}"
46
driver:
57
name: docker
68
verifier:
79
name: testinfra
810
docker:
911
containers:
10-
- name: xenial-prometheus-legacy
12+
- name: xenial
1113
image: solita/ubuntu-systemd
1214
image_version: 16.04
1315
privileged: true
14-
ansible_groups:
15-
- legacy
16-
- name: xenial-prometheus-upstream
17-
image: solita/ubuntu-systemd
18-
image_version: 16.04
19-
privileged: true
20-
ansible_groups:
21-
- upstream
22-
- name: centos-prometheus-legacy
23-
image: centos/systemd
24-
image_version: latest
25-
privileged: true
26-
ansible_groups:
27-
- legacy
28-
- name: centos-prometheus-upstream
16+
- name: centos
2917
image: centos/systemd
3018
image_version: latest
3119
privileged: true
32-
ansible_groups:
33-
- upstream

tests/playbook.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@
99
- iproute
1010
- net-tools
1111

12-
- hosts: upstream
13-
pre_tasks:
14-
- name: Include vars
15-
include_vars: vars.yml
16-
roles:
17-
- ansible-prometheus
18-
19-
- hosts: legacy
12+
- hosts: all
2013
pre_tasks:
2114
- name: Include vars
2215
include_vars: vars.yml
16+
- name: Set prometheus version from bash PROMETHEUS variable
17+
set_fact:
18+
prometheus_version: "{{ version }}"
19+
when: version is defined and version != ''
2320
roles:
2421
- ansible-prometheus
25-
vars:
26-
prometheus_version: 1.8.2

0 commit comments

Comments
 (0)