Skip to content

Commit

Permalink
Merge zammad role into collection
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
  • Loading branch information
Norman Ziegner committed Mar 19, 2024
1 parent 725433c commit 4ef1761
Show file tree
Hide file tree
Showing 23 changed files with 773 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ unattended_upgrades:
- "roles/unattended_upgrades/**"
- "molecule/unattended_upgrades/**"
- ".github/workflows/unattended_upgrades.yml"
zammad:
- changed-files:
- any-glob-to-any-file:
- "roles/zammad/**"
- "molecule/zammad/**"
- ".github/workflows/zammad.yml"
3 changes: 3 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
labeler:
runs-on: "ubuntu-22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"

- uses: "actions/labeler@v5"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
6 changes: 6 additions & 0 deletions .github/workflows/unattended_upgrades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: "hifis.unattended_upgrades"

on:
pull_request:
paths:
- '.github/workflows/unattended_upgrades.yml'
- 'roles/unattended_upgrades/**'
- 'molecule/unattended_upgrades/**'
- 'Pipfile'
- 'Pipfile.lock'
push:
branches:
- "main"
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/zammad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: "hifis.zammad"
on:
pull_request:
paths:
- '.github/workflows/zammad.yml'
- 'roles/zammad/**'
- 'molecule/zammad/**'
- 'Pipfile'
- 'Pipfile.lock'
push:
branches:
- "main"
tags:
- "v*.*.*"
paths:
- '.github/workflows/zammad.yml'
- 'roles/zammad/**'
- 'molecule/zammad/**'
- 'Pipfile'
- 'Pipfile.lock'
schedule:
- cron: '0 0 * * *'

jobs:

test:
name: "Run Molecule tests."
runs-on: "ubuntu-22.04"
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: false
matrix:
image:
- "ghcr.io/hifis-net/ubuntu-systemd:22.04"
- "ghcr.io/hifis-net/ubuntu-systemd:20.04"

steps:
- name: "Check out the codebase."
uses: "actions/checkout@v4"
with:
path: "ansible_collections/hifis/software_services"

- name: "Prepare the job environment."
uses: "./ansible_collections/hifis/software_services/.github/workflows/prepare-action"

# https://github.com/ansible/molecule/issues/3806
- name: "Help molecule to find the dependencies"
run: |
mkdir -p /home/runner/.ansible
ln -s /home/runner/work/ansible-role-unattended-upgrades/ansible-role-unattended-upgrades/ansible_collections/hifis/software_services/roles \
/home/runner/.ansible/roles
- name: "Install modern podman"
run: |
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update -qq
sudo apt-get -qq -y install podman
- name: "Run Molecule tests."
run: "XDG_RUNTIME_DIR=/run/user/$UID pipenv run molecule test -s zammad"
env:
MOLECULE_IMAGE: "${{ matrix.image }}"
working-directory: "ansible_collections/hifis/software_services"
2 changes: 1 addition & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rules:
max-spaces-after: -1
level: "error"
comments: "disable"
comments-indentation: "enable"
comments-indentation: "disable"
document-start: "disable"
empty-lines:
max: 3
Expand Down
25 changes: 25 additions & 0 deletions molecule/zammad/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- name: "Converge"
hosts: "all"
tasks:

- name: "Get private key content"
ansible.builtin.command: "cat /etc/ssl/private/ssl-cert-snakeoil.key"
changed_when: false
check_mode: false
register: "private_key"

- name: "Get SSL certificate content"
ansible.builtin.command: "cat /etc/ssl/certs/ssl-cert-snakeoil.pem"
changed_when: false
check_mode: false
register: "certificate"

- name: "Pass SSL key pair to zammad role"
ansible.builtin.set_fact:
zammad_ssl_key: "{{ private_key.stdout }}"
zammad_ssl_cert: "{{ certificate.stdout }}"

- name: "Include ansible-role-zammad"
ansible.builtin.include_role:
name: "hifis.software_services.zammad"
25 changes: 25 additions & 0 deletions molecule/zammad/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
dependency:
name: "galaxy"
options:
requirements-file: "molecule/zammad/requirements.yml"
driver:
name: "podman"
platforms:
- name: "instance"
image: "${MOLECULE_IMAGE:-ghcr.io/hifis-net/ubuntu-systemd:22.04}"
pre_build_image: true
privileged: true
override_command: false
systemd: true
tty: true
published_ports:
- "0.0.0.0:8080:80"
- "0.0.0.0:8443:443"
provisioner:
name: "ansible"
playbooks:
prepare: "prepare.yml"
converge: "converge.yml"
verifier:
name: "ansible"
36 changes: 36 additions & 0 deletions molecule/zammad/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- name: "Prepare"
hosts: "all"
vars:
# Apply suggested Elasticsearch configuration
elasticsearch_version: "8.x"
elasticsearch_package: "elasticsearch=8.8.1"
elasticsearch_heap_size_min: "256m"
elasticsearch_heap_size_max: "256m"
elasticsearch_extra_options: |
xpack.security.enabled: false
xpack.security.http.ssl.enabled: false
xpack.security.transport.ssl.enabled: false
http.max_content_length: 400mb
indices.query.bool.max_clause_count: 2000
tasks:

- name: "Install required packages"
ansible.builtin.apt:
name:
- "sudo"
- "gpg"
- "ca-certificates"
- "python3-cryptography"
- "ssl-cert"
state: "present"
update_cache: true

- name: "Include geerlingguy.elasticsearch"
ansible.builtin.include_role:
name: "geerlingguy.elasticsearch"

- name: "Include geerlingguy.postgresql"
ansible.builtin.include_role:
name: "geerlingguy.postgresql"
13 changes: 13 additions & 0 deletions molecule/zammad/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---


collections:
- name: "community.crypto"
version: "2.14.1" # Required due to https://github.com/ansible-collections/community.crypto/issues/627

roles:
- src: "geerlingguy.elasticsearch"
version: "5.1.2"

- src: "geerlingguy.postgresql"
version: "3.5.0"
11 changes: 11 additions & 0 deletions molecule/zammad/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: "Verify"
hosts: "all"
tasks:
- name: "Check that Zammad web interface is available"
ansible.builtin.uri:
url: "https://localhost"
validate_certs: false
return_content: true
register: "zammad_web"
failed_when: "'Zammad Helpdesk' not in zammad_web.content"
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---

collections:
- name: "community.crypto"
135 changes: 135 additions & 0 deletions roles/zammad/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Changelog

## [v2.1.0](https://github.com/hifis-net/ansible-role-zammad/tree/v2.1.0) (2024-03-14)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/v2.0.0...v2.1.0)

**Closed issues:**

- Release version 2.0.0 [\#43](https://github.com/hifis-net/ansible-role-zammad/issues/43)

**Merged pull requests:**

- chore\(deps-dev\): bump ansible-lint from 24.2.0 to 24.2.1 [\#82](https://github.com/hifis-net/ansible-role-zammad/pull/82) ([dependabot[bot]](https://github.com/apps/dependabot))
- Prepare release 2.1.0 [\#81](https://github.com/hifis-net/ansible-role-zammad/pull/81) ([Normo](https://github.com/Normo))
- Bump ansible from 9.2.0 to 9.3.0 [\#80](https://github.com/hifis-net/ansible-role-zammad/pull/80) ([dependabot[bot]](https://github.com/apps/dependabot))
- ci: install a recent podman version [\#79](https://github.com/hifis-net/ansible-role-zammad/pull/79) ([Normo](https://github.com/Normo))
- Bump molecule-plugins from 23.5.0 to 23.5.3 [\#78](https://github.com/hifis-net/ansible-role-zammad/pull/78) ([dependabot[bot]](https://github.com/apps/dependabot))
- fix: update nginx ssl ciphers to get TLSv1.2 working again [\#77](https://github.com/hifis-net/ansible-role-zammad/pull/77) ([Normo](https://github.com/Normo))
- Bump yamllint from 1.33.0 to 1.35.1 [\#76](https://github.com/hifis-net/ansible-role-zammad/pull/76) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump molecule from 5.1.0 to 24.2.0 [\#75](https://github.com/hifis-net/ansible-role-zammad/pull/75) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ansible-lint from 6.17.2 to 24.2.0 [\#73](https://github.com/hifis-net/ansible-role-zammad/pull/73) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ansible from 8.1.0 to 9.2.0 [\#72](https://github.com/hifis-net/ansible-role-zammad/pull/72) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump yamllint from 1.32.0 to 1.33.0 [\#66](https://github.com/hifis-net/ansible-role-zammad/pull/66) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump actions/checkout from 3 to 4 [\#56](https://github.com/hifis-net/ansible-role-zammad/pull/56) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump molecule-plugins from 23.4.1 to 23.5.0 [\#51](https://github.com/hifis-net/ansible-role-zammad/pull/51) ([dependabot[bot]](https://github.com/apps/dependabot))
- docs: add galaxy badges to README [\#49](https://github.com/hifis-net/ansible-role-zammad/pull/49) ([tobiashuste](https://github.com/tobiashuste))

## [v2.0.0](https://github.com/hifis-net/ansible-role-zammad/tree/v2.0.0) (2023-07-04)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/1.4.0...v2.0.0)

**Implemented enhancements:**

- feat: ensure compatibility with Zammad \>= 6.0 [\#37](https://github.com/hifis-net/ansible-role-zammad/pull/37) ([tobiashuste](https://github.com/tobiashuste))
- feat: add support for Ubuntu 22.04 [\#34](https://github.com/hifis-net/ansible-role-zammad/pull/34) ([tobiashuste](https://github.com/tobiashuste))

**Closed issues:**

- Add CHANGELOG [\#30](https://github.com/hifis-net/ansible-role-zammad/issues/30)
- Add CITATION.cff [\#39](https://github.com/hifis-net/ansible-role-zammad/issues/39)
- Establish compatibility with Zammad \>= 6.0 [\#36](https://github.com/hifis-net/ansible-role-zammad/issues/36)
- Update README [\#35](https://github.com/hifis-net/ansible-role-zammad/issues/35)
- Unify the GitHub Actions workflow with other projects [\#31](https://github.com/hifis-net/ansible-role-zammad/issues/31)
- Rename default branch to main [\#29](https://github.com/hifis-net/ansible-role-zammad/issues/29)
- Add support for Ubuntu 22.04 [\#27](https://github.com/hifis-net/ansible-role-zammad/issues/27)

**Merged pull requests:**

- Bump geerlingguy.postgresql from 2.2.1 to 3.0.0 [\#26](https://github.com/hifis-net/ansible-role-zammad/pull/26) ([Normo](https://github.com/Normo))
- Set Zammad 3.6.0 as default version [\#25](https://github.com/hifis-net/ansible-role-zammad/pull/25) ([Normo](https://github.com/Normo))
- Bump elastic.elasticsearch from 7.9.3 to 7.10.0 [\#24](https://github.com/hifis-net/ansible-role-zammad/pull/24) ([Normo](https://github.com/Normo))
- chore: prepare relase of version 2.0.0 [\#46](https://github.com/hifis-net/ansible-role-zammad/pull/46) ([tobiashuste](https://github.com/tobiashuste))
- fix: properly check if the ssl variables are set [\#41](https://github.com/hifis-net/ansible-role-zammad/pull/41) ([tobiashuste](https://github.com/tobiashuste))
- chore: add CITATION.cff [\#40](https://github.com/hifis-net/ansible-role-zammad/pull/40) ([Normo](https://github.com/Normo))
- docs: update README information [\#38](https://github.com/hifis-net/ansible-role-zammad/pull/38) ([tobiashuste](https://github.com/tobiashuste))
- style: fix ansible-lint violations [\#33](https://github.com/hifis-net/ansible-role-zammad/pull/33) ([tobiashuste](https://github.com/tobiashuste))
- ci: fix and align GitHub Actions workflow [\#32](https://github.com/hifis-net/ansible-role-zammad/pull/32) ([tobiashuste](https://github.com/tobiashuste))
- ci: configure Dependabot version updates [\#28](https://github.com/hifis-net/ansible-role-zammad/pull/28) ([tobiashuste](https://github.com/tobiashuste))

## [1.4.0](https://github.com/hifis-net/ansible-role-zammad/tree/1.4.0) (2020-11-09)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/1.3.0...1.4.0)

**Implemented enhancements:**

- Add Ansible Galaxy release job [\#23](https://github.com/hifis-net/ansible-role-zammad/pull/23) ([Normo](https://github.com/Normo))

**Closed issues:**

- Automate role import into Ansible Galaxy [\#19](https://github.com/hifis-net/ansible-role-zammad/issues/19)

**Merged pull requests:**

- Bump elastic.elasticsearch from 7.9.2 to 7.9.3 [\#22](https://github.com/hifis-net/ansible-role-zammad/pull/22) ([Normo](https://github.com/Normo))
- Update molecule action [\#21](https://github.com/hifis-net/ansible-role-zammad/pull/21) ([Normo](https://github.com/Normo))
- Explicitly set file permissions for repository files [\#20](https://github.com/hifis-net/ansible-role-zammad/pull/20) ([Normo](https://github.com/Normo))

## [1.3.0](https://github.com/hifis-net/ansible-role-zammad/tree/1.3.0) (2020-10-06)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/1.2.0...1.3.0)

**Implemented enhancements:**

- Allow to disable Nginx version information [\#15](https://github.com/hifis-net/ansible-role-zammad/issues/15)
- Allow to specify SSL certificates via path only [\#13](https://github.com/hifis-net/ansible-role-zammad/issues/13)

**Merged pull requests:**

- Bump elastic.elasticsearch from 7.9.0 to 7.9.2 [\#18](https://github.com/hifis-net/ansible-role-zammad/pull/18) ([tobiashuste](https://github.com/tobiashuste))
- Install Zammad 3.5.0 by default [\#17](https://github.com/hifis-net/ansible-role-zammad/pull/17) ([tobiashuste](https://github.com/tobiashuste))
- Allow to configure nginx server\_tokens directive [\#16](https://github.com/hifis-net/ansible-role-zammad/pull/16) ([tobiashuste](https://github.com/tobiashuste))
- Allow to use SSL keypair given by path only [\#14](https://github.com/hifis-net/ansible-role-zammad/pull/14) ([tobiashuste](https://github.com/tobiashuste))

## [1.2.0](https://github.com/hifis-net/ansible-role-zammad/tree/1.2.0) (2020-08-27)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/1.1.0...1.2.0)

**Implemented enhancements:**

- Add Ubuntu 20.04 focal support [\#8](https://github.com/hifis-net/ansible-role-zammad/issues/8)
- Allow to optionally configure additional server directives in Nginx config [\#5](https://github.com/hifis-net/ansible-role-zammad/issues/5)
- Allow to optionally configure additional Nginx server directives [\#7](https://github.com/hifis-net/ansible-role-zammad/pull/7) ([tobiashuste](https://github.com/tobiashuste))

**Merged pull requests:**

- molecule verify: Check wether Zammad web interface is available [\#12](https://github.com/hifis-net/ansible-role-zammad/pull/12) ([Normo](https://github.com/Normo))
- Add Ubuntu 20.4 support [\#11](https://github.com/hifis-net/ansible-role-zammad/pull/11) ([Normo](https://github.com/Normo))
- Update molecule action [\#10](https://github.com/hifis-net/ansible-role-zammad/pull/10) ([Normo](https://github.com/Normo))
- Update requirements.yml [\#9](https://github.com/hifis-net/ansible-role-zammad/pull/9) ([Normo](https://github.com/Normo))
- Install Zammad 3.4.0 by default [\#6](https://github.com/hifis-net/ansible-role-zammad/pull/6) ([Normo](https://github.com/Normo))

## [1.1.0](https://github.com/hifis-net/ansible-role-zammad/tree/1.1.0) (2020-07-16)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/1.0.0...1.1.0)

**Implemented enhancements:**

- Allow to install packages from the development channel [\#3](https://github.com/hifis-net/ansible-role-zammad/issues/3)

**Merged pull requests:**

- Make Zammad release channel configurable [\#4](https://github.com/hifis-net/ansible-role-zammad/pull/4) ([tobiashuste](https://github.com/tobiashuste))

## [1.0.0](https://github.com/hifis-net/ansible-role-zammad/tree/1.0.0) (2020-05-12)

[Full Changelog](https://github.com/hifis-net/ansible-role-zammad/compare/157bef1dfe6bc566f10f927ab929b3910d3ea986...1.0.0)

**Merged pull requests:**

- Specify zammad version on installation [\#2](https://github.com/hifis-net/ansible-role-zammad/pull/2) ([Normo](https://github.com/Normo))
- Create GitHub actions workflow [\#1](https://github.com/hifis-net/ansible-role-zammad/pull/1) ([Normo](https://github.com/Normo))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
21 changes: 21 additions & 0 deletions roles/zammad/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Helmholtz Centre for Environmental Research – UFZ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 4ef1761

Please sign in to comment.