Skip to content

Commit

Permalink
Add Ubuntu 18.04 support
Browse files Browse the repository at this point in the history
Add latest Ansible versions (2.6.6, 2.7.1)
  • Loading branch information
tersmitten committed Oct 29, 2018
1 parent 00536c2 commit a1296df
Show file tree
Hide file tree
Showing 10 changed files with 23 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,7 +7,9 @@ python: "2.7"

env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.7.1
- ANSIBLE_VERSION=2.7.0
- ANSIBLE_VERSION=2.6.6
- ANSIBLE_VERSION=2.6.5
- ANSIBLE_VERSION=2.6.4
- ANSIBLE_VERSION=2.6.3
Expand Down Expand Up @@ -76,7 +78,7 @@ script:
&& (echo 'Availability test: pass' && exit 0)
|| (echo 'Availability 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## haproxy
## haproxy

[![Build Status](https://travis-ci.org/Oefenweb/ansible-haproxy.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-haproxy) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-haproxy-blue.svg)](https://galaxy.ansible.com/Oefenweb/haproxy)

Expand Down
7 changes: 7 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ boxes = [
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "256"
},
]

Vagrant.configure("2") do |config|
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ galaxy_info:
- precise
- trusty
- xenial
- bionic
galaxy_tags:
- system
- clustering
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: check version support
fail:
msg: "HAProxy version {{ haproxy_version }} is not supported"
when: haproxy_version not in haproxy_versions_supported
when: haproxy_version | string not in haproxy_versions_supported
tags:
- configuration
- haproxy
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/haproxy/backend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ backend {{ backend.name }}
compression {{ compression.name }} {{ compression.value }}
{% endfor %}

{% if backend.default_server_params is defined %}
{% if backend.default_server_params | default([]) %}
default-server {% for param in backend.default_server_params | default([]) %} {{ param }}{% endfor %}
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions templates/etc/haproxy/defaults.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
compression {{ compression.name }} {{ compression.value }}
{% endfor %}

{% if haproxy_default_server_params is defined %}
{% if haproxy_default_server_params | default([]) %}
default-server {% for param in haproxy_default_server_params | default([]) %} {{ param }}{% endfor %}
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion templates/etc/haproxy/listen.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ listen {{ listen.name }}
compression {{ compression.name }} {{ compression.value }}
{% endfor %}

{% if listen.default_server_params is defined %}
{% if listen.default_server_params | default([]) %}
default-server {% for param in listen.default_server_params | default([]) %} {{ param }}{% endfor %}
{% endif %}

Expand Down
2 changes: 2 additions & 0 deletions tests/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
become: true
roles:
- ../../
vars:
haproxy_version: "{{ (ansible_distribution_version is version_compare('18.04', '>=')) | ternary(1.7, 1.6) }}"
8 changes: 4 additions & 4 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# vars file for haproxy
---
haproxy_versions_supported:
- 1.5
- 1.6
- 1.7
- 1.8
- '1.5'
- '1.6'
- '1.7'
- '1.8'

haproxy_ppa: "ppa:vbernat/haproxy-{{ haproxy_version }}"

0 comments on commit a1296df

Please sign in to comment.