Skip to content

Commit 765c9ea

Browse files
author
Dmitriy Rabotyagov
authored
Merge pull request #3 from noonedeadpunk/ci
Add CI tests
2 parents 94ea02b + 7d66260 commit 765c9ea

File tree

15 files changed

+227
-26
lines changed

15 files changed

+227
-26
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
os: linux
3+
dist: bionic
4+
language: python
5+
services:
6+
- docker
7+
8+
install:
9+
- pip install -r requirements.txt
10+
11+
script:
12+
- molecule --version
13+
- ansible --version
14+
- molecule test -s default

.yamllint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
rules:
3+
truthy:
4+
allowed-values:
5+
- 'True'
6+
- 'true'
7+
- 'yes'
8+
- 'False'
9+
- 'false'
10+
- 'no'

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
ansible-pacemaker-corosync role
22
===============================
33

4-
Deploys corosync/pacemaker
4+
Deploys corosync/pacemaker [![Build Status](https://travis-ci.org/noonedeadpunk/ansible-pacemaker-corosync.svg?branch=master)](https://travis-ci.org/noonedeadpunk/ansible-pacemaker-corosync)
55

66
# Variables
77

88
- `pacemaker_corosync_group`: Ansible group name for corosync cluster (default: false, *mandatory*)
99
- `pacemaker_remote_group`: Ansible group name for pacemaker-remote cluster (default: false, *mandatory*)
1010
- `pacemaker_corosync_ring_interface`: Interface to use for ring0 communications (default: false, *mandatory*)
11+
- `pacemaker_remote_ring_interface`: Interface to use for ring0 communications on remote hosts (default: pacemaker_corosync_ring_interface)
1112
- `pacemaker_corosync_fqdn`: Whether use inventory_hostname or ansible_fqdn as node name for corosync (default: false)

defaults/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
---
2+
13
pacemaker_corosync_fqdn: false
24
pacemaker_corosync_group: false
5+
pacemaker_remote_group: false
36
pacemaker_corosync_ring_interface: false
7+
pacemaker_remote_ring_interface: "{{ pacemaker_corosync_ring_interface }}"
48
pacemaker_corosync_use_syslog: true
59
pacemaker_corosync_use_logfile: false
10+
11+
12+
# Centos EPEL repository options (for haveged)
13+
pacemaker_corosync_haveged_enabled: True
14+
pacemaker_corosync_centos_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}"
15+
pacemaker_corosync_centos_epel_key: "{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-' ~ ansible_distribution_major_version) }}"

meta/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ galaxy_info:
99
license: MIT
1010
min_ansible_version: 1.6
1111
platforms:
12-
- name: Ubuntu
13-
versions:
14-
- all
15-
categories:
16-
- system
12+
- name: Ubuntu
13+
versions:
14+
- all
15+
galaxy_tags:
16+
- system

molecule/default/cleanup.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Prepare molecule instance
3+
hosts: all[0]
4+
gather_facts: no
5+
tasks:
6+
- name: Create a network with custom IPAM config
7+
delegate_to: localhost
8+
community.general.docker_network:
9+
name: pacemaker-network
10+
state: absent

molecule/default/converge.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
tasks:
5+
- name: Apt update and install rsync, ping, iproute
6+
apt:
7+
update_cache: yes
8+
name:
9+
- rsync
10+
- inetutils-ping
11+
- iproute2
12+
state: present
13+
when: ansible_os_family == "Debian"
14+
15+
- name: Yum install iproute to fix undefined ansible_default_ipv4.address
16+
yum:
17+
name: iproute
18+
state: present
19+
when:
20+
- ansible_distribution == "CentOS"
21+
- ansible_distribution_major_version == "7"
22+
23+
- name: Add a container to a network, leaving existing containers connected
24+
delegate_to: localhost
25+
community.general.docker_network:
26+
name: pacemaker-network
27+
connected:
28+
- "{{ inventory_hostname }}"
29+
appends: yes
30+
31+
- name: Re-collect network facts required after installation iproute
32+
setup:
33+
gather_subset: network
34+
35+
- name: Show ansible_interfaces
36+
debug:
37+
var: ansible_interfaces
38+
39+
- name: Include keepalived vars
40+
include_vars: "tests/pacemaker_corosync_local.yml"
41+
42+
- name: "Include ansible-pacemaker-corosync"
43+
include_role:
44+
name: "ansible-pacemaker-corosync"

molecule/default/molecule.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
lint: |
3+
set -e
4+
yamllint .
5+
ansible-lint -vv --exclude=.tox -x 204,208,106
6+
dependency:
7+
name: galaxy
8+
driver:
9+
name: docker
10+
verifier:
11+
name: ansible
12+
provisioner:
13+
name: ansible
14+
options:
15+
v: True
16+
log: True
17+
platforms:
18+
- name: pacemaker-centos7
19+
image: diodonfrost/ansible-centos:7
20+
groups:
21+
- corosync
22+
privileged: true
23+
volumes:
24+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
25+
26+
- name: pacemaker-centos8
27+
image: diodonfrost/ansible-centos:8
28+
groups:
29+
- corosync
30+
privileged: true
31+
volumes:
32+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
33+
34+
- name: pacemaker-bionic
35+
image: travisci/ubuntu-systemd:18.04
36+
groups:
37+
- corosync
38+
privileged: true
39+
volumes:
40+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
41+
42+
- name: pacemaker-focal
43+
image: travisci/ubuntu-systemd:20.04
44+
privileged: true
45+
groups:
46+
- corosync
47+
volumes:
48+
- /sys/fs/cgroup:/sys/fs/cgroup:ro

molecule/default/prepare.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Prepare molecule instance
3+
hosts: all[0]
4+
tasks:
5+
- name: Create a network with custom IPAM config
6+
delegate_to: localhost
7+
community.general.docker_network:
8+
name: pacemaker-network
9+
ipam_config:
10+
- subnet: 192.168.33.0/24
11+
gateway: 192.168.33.254
12+
iprange: 192.168.33.0/26
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
3+
pacemaker_corosync_group: corosync
4+
pacemaker_corosync_ring_interface: eth1

0 commit comments

Comments
 (0)