Skip to content

Commit abd713e

Browse files
committed
Make use of github actions
1 parent 3eef2c2 commit abd713e

19 files changed

+247
-195
lines changed

.ansible-lint

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
warn_list:
22
- '106'
3-
- '204'
4-
- '405'

.github/workflows/ci.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: CI
3+
'on':
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: '30 1 * * 3'
10+
11+
jobs:
12+
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out the codebase
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python 3
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Install test dependencies
26+
run: pip install yamllint ansible-lint
27+
28+
- name: Lint code
29+
run: |
30+
yamllint .
31+
ansible-lint
32+
33+
molecule:
34+
name: Molecule
35+
runs-on: ubuntu-latest
36+
defaults:
37+
run:
38+
working-directory: "${{ github.repository }}"
39+
needs:
40+
- lint
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
include:
45+
- distro: ubuntu1604
46+
ansible-version: '>=2.8, <2.9'
47+
- distro: ubuntu1604
48+
ansible-version: '>=2.9, <2.10'
49+
- distro: ubuntu1604
50+
ansible-version: '>=2.10, <2.11'
51+
- distro: ubuntu1604
52+
- distro: ubuntu1804
53+
- distro: ubuntu2004
54+
55+
steps:
56+
- name: Check out the codebase
57+
uses: actions/checkout@v2
58+
with:
59+
path: "${{ github.repository }}"
60+
61+
- name: Set up Python 3
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: '3.x'
65+
66+
- name: Install test dependencies
67+
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker
68+
69+
- name: Run Molecule tests
70+
run: |
71+
molecule test
72+
env:
73+
ANSIBLE_FORCE_COLOR: '1'
74+
ANSIBLE_VERBOSITY: '2'
75+
MOLECULE_DEBUG: '1'
76+
MOLECULE_DISTRO: "${{ matrix.distro }}"
77+
PY_COLORS: '1'

.github/workflows/release.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Release
3+
'on':
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the codebase
15+
uses: actions/checkout@v2
16+
17+
- name: Publish to Galaxy
18+
uses: robertdebock/[email protected]
19+
with:
20+
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}

.travis.yml

-105
This file was deleted.

.yamllint

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
braces:
6+
max-spaces-inside: 1
7+
level: error
8+
brackets:
9+
max-spaces-inside: 1
10+
level: error
11+
line-length: disable
12+
truthy: disable
13+
14+
ignore: |
15+
.tox/

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN rm -rf $HOME/.cache
1111
# ansible
1212
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \
1313
apt-get clean
14-
RUN pip install ansible==2.9.14
14+
RUN pip install ansible==2.9.15
1515
RUN rm -rf $HOME/.cache
1616

1717
# provision

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## haproxy
22

3-
[![Build Status](https://travis-ci.org/Oefenweb/ansible-haproxy.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-haproxy)
3+
[![CI](https://github.com/Oefenweb/ansible-haproxy/workflows/CI/badge.svg)](https://github.com/Oefenweb/ansible-haproxy/actions?query=workflow%3ACI)
44
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-haproxy-blue.svg)](https://galaxy.ansible.com/Oefenweb/haproxy)
55

66
Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu systems.
@@ -13,7 +13,7 @@ Set up (the latest version of) [HAProxy](http://www.haproxy.org/) in Ubuntu syst
1313

1414
* `haproxy_use_ppa`: [default: `true`]: Whether or not to add the PPA (for installation)
1515

16-
* `haproxy_version`: [default: `1.8`]: Version to install (e.g. `1.5`, `1.6`, `1.7`, `1.8`, `1.9`, `2.0`, `2.1`, `2.2`, `2.3`)
16+
* `haproxy_version`: [default: `2.0`]: Version to install (e.g. `1.5`, `1.6`, `1.7`, `1.8`, `1.9`, `2.0`, `2.1`, `2.2`, `2.3`)
1717

1818
* `haproxy_install`: [default: `[]`]: Additional packages to install (e.g. `socat`)
1919

Vagrantfile

+7-14
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,22 @@ role = File.basename(File.expand_path(File.dirname(__FILE__)))
55

66
boxes = [
77
{
8-
:name => "ubuntu-1204",
9-
:box => "bento/ubuntu-12.04",
10-
:ip => '10.0.0.11',
11-
:cpu => "50",
12-
:ram => "256"
13-
},
14-
{
15-
:name => "ubuntu-1404",
16-
:box => "bento/ubuntu-14.04",
8+
:name => "ubuntu-1604",
9+
:box => "bento/ubuntu-16.04",
1710
:ip => '10.0.0.12',
1811
:cpu => "50",
1912
:ram => "256"
2013
},
2114
{
22-
:name => "ubuntu-1604",
23-
:box => "bento/ubuntu-16.04",
15+
:name => "ubuntu-1804",
16+
:box => "bento/ubuntu-18.04",
2417
:ip => '10.0.0.13',
2518
:cpu => "50",
26-
:ram => "256"
19+
:ram => "384"
2720
},
2821
{
29-
:name => "ubuntu-1804",
30-
:box => "bento/ubuntu-18.04",
22+
:name => "ubuntu-2004",
23+
:box => "bento/ubuntu-20.04",
3124
:ip => '10.0.0.14',
3225
:cpu => "50",
3326
:ram => "384"

defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# defaults file for haproxy
22
---
33
haproxy_use_ppa: true
4-
haproxy_version: 1.8
4+
haproxy_version: 2.0
55

66
haproxy_dependencies:
77
- name: haproxy

meta/main.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ galaxy_info:
1010
platforms:
1111
- name: Ubuntu
1212
versions:
13-
- precise
14-
- trusty
1513
- xenial
1614
- bionic
15+
- focal
1716
galaxy_tags:
1817
- system
1918
- clustering

molecule/default/converge.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
become: true
5+
pre_tasks:
6+
- name: include vars
7+
include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml"
8+
roles:
9+
- ../../../

molecule/default/molecule.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: docker
6+
platforms:
7+
- name: instance
8+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
9+
command: ${MOLECULE_DOCKER_COMMAND:-""}
10+
volumes:
11+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
12+
privileged: true
13+
pre_build_image: true
14+
provisioner:
15+
name: ansible
16+
playbooks:
17+
prepare: prepare.yml
18+
converge: converge.yml
19+
verify: verify.yml

molecule/default/prepare.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Prepare
3+
hosts: all
4+
become: true
5+
tasks: []

molecule/default/verify.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Verify
3+
hosts: all
4+
become: true
5+
tasks: []

tasks/install.yml

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# tasks file for haproxy
22
---
3+
- name: install | dependencies (pre)
4+
apt:
5+
name: "{{ haproxy_dependencies_pre }}"
6+
state: "{{ apt_install_state | default('latest') }}"
7+
update_cache: true
8+
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
9+
tags:
10+
- haproxy-repository-install-dependencies
11+
312
- name: install | add repository from PPA and install its signing key
413
apt_repository:
514
repo: "{{ haproxy_ppa }}"

0 commit comments

Comments
 (0)