-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from elan-ev/update-tests
Update tests and formatting
- Loading branch information
Showing
15 changed files
with
141 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
# .ansible-lint | ||
exclude_paths: | ||
- .cache/ # implicit unless exclude_paths is defined in config | ||
- .github/ | ||
- venv/ |
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,6 @@ | ||
ansible | ||
ansible-lint | ||
yamllint | ||
molecule | ||
molecule-docker | ||
molecule-podman |
15 changes: 5 additions & 10 deletions
15
.github/workflows/ansible_lint.yml → .github/workflows/molecule.yml
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 |
---|---|---|
@@ -1,27 +1,22 @@ | ||
--- | ||
|
||
name: ansible tests | ||
name: molecule | ||
|
||
on: # yamllint disable-line rule:truthy | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
lint: | ||
molecule: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: install dependencies | ||
run: > | ||
pip3 install | ||
ansible | ||
ansible-lint | ||
yamllint | ||
molecule | ||
molecule-docker | ||
molecule-podman | ||
run: pip3 install -r .dev_requirements.txt | ||
|
||
- name: test playbook | ||
run: molecule test --driver-name docker | ||
env: | ||
PY_COLORS: '1' |
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 @@ | ||
venv/ |
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,11 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
rules: | ||
line-length: disable | ||
|
||
ignore: | | ||
venv/ | ||
.roles/ | ||
.cache/ |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
- name: update apt cache | ||
- name: Update apt cache | ||
ansible.builtin.apt: | ||
update_cache: true |
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,8 @@ | ||
FROM {{ item.image }} | ||
|
||
# Install dependencies | ||
{% if "centos" in item.name %} | ||
RUN dnf install --refresh -y sudo systemd bash ca-certificates iproute python3 python3-libselinux | ||
{% else %} | ||
RUN apt-get update && apt-get install -y sudo bash ca-certificates iproute2 init python3 && apt-get clean | ||
{% endif %} |
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
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
--- | ||
# This is an example playbook to execute Ansible tests. | ||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: true | ||
vars: | ||
opencast_version_major: 10 | ||
opencast_version_major: 12 | ||
tasks: | ||
- name: test if opencast is available | ||
- name: Test if opencast is available | ||
ansible.builtin.package: | ||
# yamllint disable-line rule:line-length | ||
name: "{{ 'opencast-' + opencast_version_major|string + '-common' if ansible_os_family == 'Debian' else 'opencast' }}" | ||
name: "{{ 'opencast-' + opencast_version_major | string + '-common' if ansible_os_family == 'Debian' else 'opencast' }}" | ||
state: present |
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
--- | ||
|
||
- name: check that the architecture is supported | ||
- name: Check that the architecture is supported | ||
ansible.builtin.assert: | ||
that: ansible_architecture == 'x86_64' | ||
that: ansible_architecture == "x86_64" | ||
|
||
- name: install on debian/ubuntu | ||
- name: Install on debian/ubuntu | ||
ansible.builtin.include_tasks: debian.yml | ||
when: ansible_os_family == 'Debian' | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: install on centos | ||
- name: Install on centos | ||
ansible.builtin.include_tasks: rhel.yml | ||
when: ansible_os_family == 'RedHat' | ||
when: ansible_os_family == "RedHat" |
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 |
---|---|---|
@@ -1,37 +1,34 @@ | ||
--- | ||
|
||
# yamllint disable rule:line-length | ||
- name: install opencast repository | ||
- name: Install opencast repository | ||
ansible.builtin.yum_repository: | ||
file: opencast | ||
name: opencast-{{ item }} | ||
description: Opencast RHEL $releasever Repository - {{ item }} | ||
baseurl: https://pkg.opencast.org/rpms/release/el/$releasever/oc-{{ repository_version }}/{{ item }} | ||
enabled: '{{ opencast_repository_enabled_release }}' | ||
name: "opencast-{{ item }}" | ||
description: "Opencast RHEL $releasever Repository - {{ item }}" | ||
baseurl: "https://pkg.opencast.org/rpms/release/el/$releasever/oc-{{ repository_version }}/{{ item }}" | ||
enabled: "{{ opencast_repository_enabled_release }}" | ||
gpgcheck: true | ||
gpgkey: https://pkg.opencast.org/gpgkeys/opencast-{{ repository_version }}-rpm.key | ||
gpgkey: "https://pkg.opencast.org/gpgkeys/opencast-{{ repository_version }}-rpm.key" | ||
vars: | ||
repository_version: '{{ "%02d" % (opencast_version_major|int) }}' | ||
repository_version: '{{ "%02d" % (opencast_version_major | int) }}' | ||
loop: | ||
- x86_64 | ||
- noarch | ||
|
||
- name: install opencast testing repository | ||
- name: Install opencast testing repository | ||
ansible.builtin.yum_repository: | ||
file: opencast-testing | ||
name: opencast-testing-{{ item }} | ||
description: Opencast RHEL $releasever Testing Repository - {{ item }} | ||
baseurl: https://pkg.opencast.org/rpms/testing/el/$releasever/oc-{{ repository_version }}/{{ item }} | ||
enabled: '{{ opencast_repository_enabled_testing }}' | ||
name: "opencast-testing-{{ item }}" | ||
description: "Opencast RHEL $releasever Testing Repository - {{ item }}" | ||
baseurl: "https://pkg.opencast.org/rpms/testing/el/$releasever/oc-{{ repository_version }}/{{ item }}" | ||
enabled: "{{ opencast_repository_enabled_testing }}" | ||
gpgcheck: true | ||
gpgkey: https://pkg.opencast.org/gpgkeys/opencast-{{ repository_version }}-rpm.key | ||
gpgkey: "https://pkg.opencast.org/gpgkeys/opencast-{{ repository_version }}-rpm.key" | ||
vars: | ||
repository_version: '{{ "%02d" % (opencast_version_major|int) }}' | ||
repository_version: "{{ '%02d' % (opencast_version_major | int) }}" | ||
loop: | ||
- x86_64 | ||
- noarch | ||
# yamllint enable rule:line-length | ||
|
||
- name: install epel repository | ||
- name: Install epel repository | ||
ansible.builtin.package: | ||
name: epel-release |