Skip to content

Commit

Permalink
Merge pull request #30 from nsg/test-multiple-versions
Browse files Browse the repository at this point in the history
Test both supported graphite versions.
  • Loading branch information
nsg authored Sep 30, 2017
2 parents f9822f4 + fe028c9 commit a41dd23
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 207 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ language: python

env:
global:
- CONTAINER_IMAGES="images:centos/6 images:centos/7 images:debian/jessie images:debian/stretch ubuntu:14.04 ubuntu:16.04"
- CONTAINER_IMAGES="images:centos/7 images:debian/jessie images:debian/stretch ubuntu:14.04 ubuntu:16.04"
matrix:
- ANSIBLE_VERSIONS="2.1.6"
- ANSIBLE_VERSIONS="2.2.3"
- ANSIBLE_VERSIONS="latest"

- ANSIBLE_VERSIONS="2.1.6" ANSIBLE_EXTRA_VARS_LIST="version=0.9.15"
- ANSIBLE_VERSIONS="2.2.3" ANSIBLE_EXTRA_VARS_LIST="version=0.9.15"
- ANSIBLE_VERSIONS="latest" ANSIBLE_EXTRA_VARS_LIST="version=0.9.15"

- ANSIBLE_VERSIONS="2.1.6" ANSIBLE_EXTRA_VARS_LIST="version=1.0.2"
- ANSIBLE_VERSIONS="2.2.3" ANSIBLE_EXTRA_VARS_LIST="version=1.0.2"
- ANSIBLE_VERSIONS="latest" ANSIBLE_EXTRA_VARS_LIST="version=1.0.2"

install:
# Download ansible-role-tester and setup the enviroment
Expand Down
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ graphite_install_requirements:
- graphite-web==0.9.15
- carbon==0.9.15
1.0.2:
- Django==1.11
- Django==1.9.13
- django-tagging==0.4.3
- cairocffi==0.8.0
- pytz==2017.2
Expand All @@ -131,4 +131,4 @@ graphite_install_requirements:
- gunicorn==19.7.0
- graphite-web==1.0.2
- carbon==1.0.2
- whisper==1.0.2
- whisper==1.0.2
1 change: 0 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ galaxy_info:
platforms:
- name: EL
versions:
- 6
- 7
# - name: Fedora
# versions:
Expand Down
9 changes: 9 additions & 0 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
name: "Twisted==16.0.0"
when: ansible_distribution_release == "trusty"

- name: Debian Jessie and 1.0.2+ | cffi needs to be updated to a newer version
pip:
name: "cffi==1.10.0"
environment:
PYTHONPATH: "{{ graphite_install_path }}/lib:{{ graphite_install_path }}/webapp"
when: >
ansible_distribution_release == "jessie" and
graphite_install_version | version_compare("1.0.2", ">=")
- name: Install init.d script for carbon-cache
template:
src: debian_carbon_service.j2
Expand Down
32 changes: 0 additions & 32 deletions tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,14 @@
- sudo
- libffi-devel

- name: "Install Twisted 15.3.0 on 6.x (never versions req python 2.7)"
pip:
name: "Twisted==15.3.0"
when: ansible_distribution_major_version|int < 7

- name: Install uwsgi with pip
pip:
name: uwsgi

- name: Install carbon-cache init.d script
template:
src: redhat_carbon_service.j2
dest: /etc/init.d/carbon-cache
when: ansible_distribution_major_version|int < 7
notify: restart carbon-cache

- name: Install systemd unit carbon-cache.service
template:
src: carbon_service_systemd.j2
dest: /etc/systemd/system/carbon-cache.service
when: ansible_distribution_major_version|int >= 7
register: ccunit

- name: Reload systemd if unit file has changed
Expand All @@ -59,32 +46,13 @@
dest: /etc/uwsgi_graphite.ini
notify: restart uwsgi

- name: Install uwsgi init.d script
template:
src: redhat_uwsgi_service.j2
dest: /etc/init.d/uwsgi
when: ansible_distribution_major_version|int < 7
notify: restart uwsgi

- name: Install systemd unit uwsgi.service
template:
src: uwsgi_systemd.j2
dest: /etc/systemd/system/uwsgi.service
when: ansible_distribution_major_version|int >= 7
register: uwsgiunit

- name: Reload systemd if unit file has changed
shell: systemctl daemon-reload
when: uwsgiunit|changed
notify: restart uwsgi

- name: Check the install scripts perms
file:
path: /etc/init.d/{{ item }}
mode: 0755
owner: root
group: root
when: ansible_distribution_major_version|int < 7
with_items:
- carbon-cache
- uwsgi
85 changes: 0 additions & 85 deletions templates/redhat_carbon_service.j2

This file was deleted.

83 changes: 0 additions & 83 deletions templates/redhat_uwsgi_service.j2

This file was deleted.

1 change: 1 addition & 0 deletions tests/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
roles:
- role: ansible-graphite
graphite_secret_key: testtest123
graphite_install_version: "{{ version }}"
1 change: 1 addition & 0 deletions tests/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
regexp: "{{ item }}"
with_items:
- "creating database file.*errors.wsp"
- "creating database metric carbon.agents.*errors"
- "new metric carbon.agents.*a.errors matched schema carbon"
- "new metric carbon.agents.*a.errors matched aggregation schema default"
failed_when: False
Expand Down

0 comments on commit a41dd23

Please sign in to comment.