Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
c11d46957a | |||
965bec2314 | |||
deb2afb389 | |||
b08f2eda4d | |||
ec977101f9 | |||
3eeb8a3112 | |||
8903948a9f |
10 changed files with 75 additions and 39 deletions
18
.forgejo/workflows/molecule.yml
Normal file
18
.forgejo/workflows/molecule.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: code.waks.be/nishiki/molecule:docker
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: ansible-lint .
|
||||||
|
- run: yamllint .
|
||||||
|
molecule:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: code.waks.be/nishiki/molecule:docker
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: molecule test
|
10
.gitlab-ci.yml
Normal file
10
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
image: nishiki/molecule:docker
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- molecule --version
|
||||||
|
|
||||||
|
molecule:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- molecule test
|
|
@ -2,11 +2,11 @@
|
||||||
extends: default
|
extends: default
|
||||||
|
|
||||||
ignore: |
|
ignore: |
|
||||||
.kitchen/*
|
.kitchen*
|
||||||
vendor/
|
vendor/
|
||||||
|
.forgejo/
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
line-length:
|
line-length:
|
||||||
max: 120
|
max: 120
|
||||||
level: warning
|
level: warning
|
||||||
truthy: false
|
|
||||||
|
|
|
@ -5,6 +5,14 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- test: use personal docker registry
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- test: remove support debian11
|
||||||
|
|
||||||
## v1.0.0 - 2021-08-18
|
## v1.0.0 - 2021-08-18
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
21
README.md
21
README.md
|
@ -1,16 +1,16 @@
|
||||||
# Ansible role: Icingaweb2
|
# Ansible role: Icingaweb2
|
||||||
|
|
||||||
[![Version](https://img.shields.io/badge/latest_version-1.0.0-green.svg)](https://git.yaegashi.fr/nishiki/ansible-role-icingaweb2/releases)
|
[![Version](https://img.shields.io/badge/latest_version-1.0.0-green.svg)](https://code.waks.be/nishiki/ansible-role-icingaweb2/releases)
|
||||||
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/ansible-role-icingaweb2/src/branch/master/LICENSE)
|
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://code.waks.be/nishiki/ansible-role-icingaweb2/src/branch/main/LICENSE)
|
||||||
|
[![Build](https://code.waks.be/nishiki/ansible-role-icingaweb2/actions/workflows/molecule.yml/badge.svg?branch=main)](https://code.waks.be/nishiki/ansible-role-icingaweb2/actions?workflow=molecule.yml)
|
||||||
|
|
||||||
Install icingaweb2
|
Install icingaweb2
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* Ansible >= 2.9
|
- Ansible >= 2.9
|
||||||
* Debian
|
- Debian
|
||||||
* Buster
|
- Bookworm
|
||||||
* Bulleyes
|
|
||||||
|
|
||||||
## Role variables
|
## Role variables
|
||||||
|
|
||||||
|
@ -21,14 +21,15 @@ Install icingaweb2
|
||||||
roles:
|
roles:
|
||||||
- icingaweb2
|
- icingaweb2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Test with molecule and docker
|
### Test with molecule and docker
|
||||||
|
|
||||||
* install [docker](https://docs.docker.com/engine/installation/)
|
- install [docker](https://docs.docker.com/engine/installation/)
|
||||||
* install `python3` and `python3-pip`
|
- install `python3` and `python3-pip`
|
||||||
* install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
- install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
||||||
* run `molecule test`
|
- run `molecule test`
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: reload apache
|
- name: Reload apache
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: apache2
|
name: apache2
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
---
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
role_name: icingaweb2
|
role_name: icingaweb2
|
||||||
|
namespace: nishiki
|
||||||
author: Adrien Waksberg
|
author: Adrien Waksberg
|
||||||
company: Adrien Waksberg
|
company: Adrien Waksberg
|
||||||
description: Install icingaweb2
|
description: Install icingaweb2
|
||||||
license: Apache2
|
license: Apache2
|
||||||
min_ansible_version: 2.9
|
min_ansible_version: "2.9"
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- buster
|
- bookworm
|
||||||
- bullseye
|
|
||||||
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- dashboard
|
- dashboard
|
||||||
|
|
|
@ -2,19 +2,12 @@
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
platforms:
|
platforms:
|
||||||
- name: debian10
|
- name: debian12
|
||||||
image: nishiki/debian10:molecule
|
image: code.waks.be/nishiki/molecule:debian12
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||||
command: /bin/systemd
|
cgroupns_mode: host
|
||||||
capabilities:
|
|
||||||
- SYS_ADMIN
|
|
||||||
- name: debian11
|
|
||||||
image: nishiki/debian10:molecule
|
|
||||||
privileged: true
|
|
||||||
volumes:
|
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
||||||
command: /bin/systemd
|
command: /bin/systemd
|
||||||
capabilities:
|
capabilities:
|
||||||
- SYS_ADMIN
|
- SYS_ADMIN
|
||||||
|
|
|
@ -2,9 +2,8 @@ import os, re
|
||||||
import testinfra.utils.ansible_runner
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
def test_packages(host):
|
def test_packages(host):
|
||||||
for package_name in ['icingaweb2', 'icingaweb2-module-monitoring']:
|
package = host.package('icingaweb2')
|
||||||
package = host.package(package_name)
|
assert package.is_installed
|
||||||
assert package.is_installed
|
|
||||||
|
|
||||||
def test_service(host):
|
def test_service(host):
|
||||||
service = host.service('apache2')
|
service = host.service('apache2')
|
||||||
|
|
|
@ -1,33 +1,40 @@
|
||||||
---
|
---
|
||||||
- name: install dependencies packages
|
- name: Install dependencies packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
tags: icingaweb2
|
tags: icingaweb2
|
||||||
|
|
||||||
- name: add key repository
|
- name: Add repository key
|
||||||
ansible.builtin.apt_key:
|
ansible.builtin.get_url:
|
||||||
url: https://packages.icinga.com/icinga.key
|
url: https://packages.icinga.com/icinga.key
|
||||||
|
dest: /etc/apt/keyrings/icinga.asc
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
checksum: sha256:be677e07972ed57b99ffc2fd211379ac11b9c6a7c8d9460086b447b96b0a82bb
|
||||||
tags: icingaweb2
|
tags: icingaweb2
|
||||||
|
|
||||||
- name: add repository
|
- name: Add repository
|
||||||
ansible.builtin.apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: 'deb https://packages.icinga.com/debian icinga-{{ ansible_distribution_release }} main'
|
repo: >-
|
||||||
|
deb [signed-by=/etc/apt/keyrings/icinga.asc]
|
||||||
|
https://packages.icinga.com/debian icinga-{{ ansible_distribution_release }} main
|
||||||
|
filename: icinga
|
||||||
tags: icingaweb2
|
tags: icingaweb2
|
||||||
|
|
||||||
- name: install packages
|
- name: Install packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- icingaweb2
|
- icingaweb2
|
||||||
- icingaweb2-module-monitoring
|
|
||||||
tags: icingaweb2
|
tags: icingaweb2
|
||||||
|
|
||||||
- name: enable apache configuration
|
- name: Enable apache configuration
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
src: /etc/apache2/conf-available/icingaweb2.conf
|
src: /etc/apache2/conf-available/icingaweb2.conf
|
||||||
dest: /etc/apache2/sites-enabled/icingaweb2.conf
|
dest: /etc/apache2/sites-enabled/icingaweb2.conf
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
state: link
|
state: link
|
||||||
notify: reload apache
|
notify: Reload apache
|
||||||
tags: icingaweb2
|
tags: icingaweb2
|
||||||
|
|
Loading…
Reference in a new issue