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
|
||||
|
||||
ignore: |
|
||||
.kitchen/*
|
||||
.kitchen*
|
||||
vendor/
|
||||
.forgejo/
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 120
|
||||
level: warning
|
||||
truthy: false
|
||||
|
|
|
@ -5,6 +5,14 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- test: use personal docker registry
|
||||
|
||||
### Removed
|
||||
|
||||
- test: remove support debian11
|
||||
|
||||
## v1.0.0 - 2021-08-18
|
||||
|
||||
### Added
|
||||
|
|
21
README.md
21
README.md
|
@ -1,16 +1,16 @@
|
|||
# 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)
|
||||
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/ansible-role-icingaweb2/src/branch/master/LICENSE)
|
||||
[![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://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
|
||||
|
||||
## Requirements
|
||||
|
||||
* Ansible >= 2.9
|
||||
* Debian
|
||||
* Buster
|
||||
* Bulleyes
|
||||
- Ansible >= 2.9
|
||||
- Debian
|
||||
- Bookworm
|
||||
|
||||
## Role variables
|
||||
|
||||
|
@ -21,14 +21,15 @@ Install icingaweb2
|
|||
roles:
|
||||
- icingaweb2
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Test with molecule and docker
|
||||
|
||||
* install [docker](https://docs.docker.com/engine/installation/)
|
||||
* install `python3` and `python3-pip`
|
||||
* install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
||||
* run `molecule test`
|
||||
- install [docker](https://docs.docker.com/engine/installation/)
|
||||
- install `python3` and `python3-pip`
|
||||
- install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
||||
- run `molecule test`
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: reload apache
|
||||
- name: Reload apache
|
||||
ansible.builtin.service:
|
||||
name: apache2
|
||||
state: reloaded
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
---
|
||||
galaxy_info:
|
||||
role_name: icingaweb2
|
||||
namespace: nishiki
|
||||
author: Adrien Waksberg
|
||||
company: Adrien Waksberg
|
||||
description: Install icingaweb2
|
||||
license: Apache2
|
||||
min_ansible_version: 2.9
|
||||
min_ansible_version: "2.9"
|
||||
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
- buster
|
||||
- bullseye
|
||||
- bookworm
|
||||
|
||||
galaxy_tags:
|
||||
- dashboard
|
||||
|
|
|
@ -2,19 +2,12 @@
|
|||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: debian10
|
||||
image: nishiki/debian10:molecule
|
||||
- name: debian12
|
||||
image: code.waks.be/nishiki/molecule:debian12
|
||||
privileged: true
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /bin/systemd
|
||||
capabilities:
|
||||
- SYS_ADMIN
|
||||
- name: debian11
|
||||
image: nishiki/debian10:molecule
|
||||
privileged: true
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
cgroupns_mode: host
|
||||
command: /bin/systemd
|
||||
capabilities:
|
||||
- SYS_ADMIN
|
||||
|
|
|
@ -2,9 +2,8 @@ import os, re
|
|||
import testinfra.utils.ansible_runner
|
||||
|
||||
def test_packages(host):
|
||||
for package_name in ['icingaweb2', 'icingaweb2-module-monitoring']:
|
||||
package = host.package(package_name)
|
||||
assert package.is_installed
|
||||
package = host.package('icingaweb2')
|
||||
assert package.is_installed
|
||||
|
||||
def test_service(host):
|
||||
service = host.service('apache2')
|
||||
|
|
|
@ -1,33 +1,40 @@
|
|||
---
|
||||
- name: install dependencies packages
|
||||
- name: Install dependencies packages
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- apt-transport-https
|
||||
tags: icingaweb2
|
||||
|
||||
- name: add key repository
|
||||
ansible.builtin.apt_key:
|
||||
- name: Add repository key
|
||||
ansible.builtin.get_url:
|
||||
url: https://packages.icinga.com/icinga.key
|
||||
dest: /etc/apt/keyrings/icinga.asc
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
checksum: sha256:be677e07972ed57b99ffc2fd211379ac11b9c6a7c8d9460086b447b96b0a82bb
|
||||
tags: icingaweb2
|
||||
|
||||
- name: add repository
|
||||
- name: Add 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
|
||||
|
||||
- name: install packages
|
||||
- name: Install packages
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- icingaweb2
|
||||
- icingaweb2-module-monitoring
|
||||
tags: icingaweb2
|
||||
|
||||
- name: enable apache configuration
|
||||
- name: Enable apache configuration
|
||||
ansible.builtin.file:
|
||||
src: /etc/apache2/conf-available/icingaweb2.conf
|
||||
dest: /etc/apache2/sites-enabled/icingaweb2.conf
|
||||
owner: root
|
||||
group: root
|
||||
state: link
|
||||
notify: reload apache
|
||||
notify: Reload apache
|
||||
tags: icingaweb2
|
||||
|
|
Loading…
Reference in a new issue