Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CI testing #54

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .git_hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -x

# Pre-commit hooks to copy steps from default CI/CD pipeline. See `bitbucket-pipelines.yml` for details.
[ $(command -v shellcheck) ] && find . -path ./tmp -prune -false -o -name "*.sh" -print -exec shellcheck -x {} \;
[ $(command -v ansible-lint) ] && ansible-lint --nocolor -p --parseable-severity
[ $(command -v ansible-lint) ] && ansible-lint --nocolor -p
[ $(command -v yamllint) ] && yamllint -s .
[ $(command -v flake8) ] && flake8

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
# file: roles/haproxy/handlers/main.yml
- name: restart haproxy
service:
ansible.builtin.service:
name: "{{ haproxy_service }}"
state: restarted
when: haproxy_mode == "system"

- name: reload haproxy
service:
ansible.builtin.service:
name: "{{ haproxy_service }}"
state: reloaded
when: haproxy_mode == "system"
14 changes: 10 additions & 4 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ driver:
lint: |
set -ex
yamllint -s .
ansible-lint --nocolor -p --parseable-severity --exclude=molecule/ --exclude=tests/
ansible-lint --nocolor -p --exclude=molecule/ --exclude=tests/
flake8
platforms:
# https://wiki.debian.org/DebianReleases
Expand All @@ -21,12 +21,18 @@ platforms:
command: sleep infinity
groups: [ Debian ]
privileged: true
# https://www.centos.org/centos-linux/
- name: centos8
image: centos:8
# https://rockylinux.org/
- name: rockylinux8
image: rockylinux:8
command: /sbin/init
groups: [ RedHat ]
privileged: true
# https://www.centos.org/centos-linux/
# - name: centos8
# image: centos:8
# command: /sbin/init
# groups: [ RedHat ]
# privileged: true
- name: centos7
image: centos:7
command: /sbin/init
Expand Down
2 changes: 1 addition & 1 deletion tasks/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# file: roles/haproxy/tasks/config.yml
- name: Configuring HAproxy
template:
ansible.builtin.template:
src: etc/haproxy/haproxy.cfg.j2
dest: "{{ haproxy_config }}"
mode: "0640"
Expand Down
6 changes: 3 additions & 3 deletions tasks/install-Debian.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
# file: roles/haproxy/tasks/install-Debian.yml
- name: Set haproxy release
set_fact:
ansible.builtin.set_fact:
haproxy_release: "{{ ansible_distribution_release }}-backports"
when: haproxy_apt_backports | bool

- name: "Installing HAproxy from {{ haproxy_release | default(ansible_distribution_release) }}"
apt:
ansible.builtin.apt:
name: "{{ haproxy_package }}"
state: present
update_cache: true
cache_valid_time: 3600
default_release: "{{ haproxy_release | default(ansible_distribution_release) }}"

- name: "Installing selinux python bindings"
apt:
ansible.builtin.apt:
name: "{{ haproxy_selinux_packages }}"
state: present
when: haproxy_selinux | bool
6 changes: 3 additions & 3 deletions tasks/install-Generic.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# file: roles/haproxy/tasks/install-Generic.yml
- name: "RedHat | Install basic repo file"
yum_repository:
ansible.builtin.yum_repository:
name: "{{ item.name }}"
description: "{{ item.description | default(omit) }}"
baseurl: "{{ item.baseurl }}"
Expand All @@ -18,11 +18,11 @@
when: haproxy_repo_yum is defined

- name: Installing HAproxy package
package:
ansible.builtin.package:
name: "{{ haproxy_package }}"

- name: "Installing selinux python bindings"
package:
ansible.builtin.package:
name: "{{ haproxy_selinux_packages }}"
state: present
when: haproxy_selinux | bool
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
when: ansible_os_family != 'Debian'

- name: Enabling and starting HAproxy service
service:
ansible.builtin.service:
name: "{{ haproxy_service }}"
state: started
enabled: true
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# file: roles/haproxy/tasks/main.yml
- name: Include OS variables
include_vars: "{{ ansible_os_family }}.yml"
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
tags:
- haproxy
- haproxy-install
Expand Down