-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
- Loading branch information
Showing
23 changed files
with
860 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MIT License | ||
|
||
Copyright (c) <year> <copyright holders> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# SPDX-FileCopyrightText: 2020 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2023 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
- 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# SPDX-FileCopyrightText: 2020 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2023 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-FileCopyrightText: 2020 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2023 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
- 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-FileCopyrightText: 2020 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2020 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-FileCopyrightText: 2020 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2023 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
- 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-FileCopyrightText: 2024 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2024 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
|
||
collections: | ||
- name: "community.crypto" |
Oops, something went wrong.