-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Molecule Test and Rename to Publish role on Ansible Galaxy
- Loading branch information
1 parent
7d75a61
commit 5ef818e
Showing
17 changed files
with
291 additions
and
52 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,5 @@ | ||
skip_list: | ||
- 'yaml' | ||
- 'risky-shell-pipe' | ||
- 'no-handler' | ||
- 'role-name' |
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,32 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Information:** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS] | ||
- Version [e.g. 0.0.1] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,15 @@ | ||
--- | ||
name: "Lint" | ||
description: "Lint" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install lint dependencies | ||
shell: bash | ||
run: pip3 install yamllint | ||
|
||
- name: Lint code | ||
shell: bash | ||
run: yamllint . |
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 @@ | ||
--- | ||
name: 'Set up Ansible' | ||
description: 'Set up Ansible' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ansible | ||
shell: bash | ||
run: pip3 install ansible-core |
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 @@ | ||
--- | ||
name: 'Set up Molecule' | ||
description: 'Set up Molecule' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Molecule | ||
shell: bash | ||
run: pip3 install molecule molecule-plugins[docker] docker |
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,12 @@ | ||
--- | ||
name: 'Set up Python' | ||
description: 'Set up Python' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' |
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,55 @@ | ||
--- | ||
name: CI | ||
on: | ||
push: | ||
branches: ["main", "releases/**"] | ||
#tags: ["v*", "v**", "v.*", "v.**" ] | ||
pull_request: | ||
branches: ["main", "releases/**"] | ||
schedule: | ||
- cron: "0 3 * * *" | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
# prevent stuck jobs | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: ./.github/actions/set-up-python | ||
|
||
- name: Lint | ||
uses: ./.github/actions/lint | ||
|
||
molecule: | ||
needs: [lint] | ||
name: Test with Ansible Molecule | ||
runs-on: ubuntu-latest | ||
# prevent stuck jobs | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
distro: [ubuntu2204] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: ./.github/actions/set-up-python | ||
|
||
- name: Set up Ansible | ||
uses: ./.github/actions/set-up-ansible | ||
|
||
- name: Set up Molecule | ||
uses: ./.github/actions/set-up-molecule | ||
|
||
- name: Run Molecule tests | ||
run: molecule test | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
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,28 @@ | ||
--- | ||
# see: https://github.com/geerlingguy/ansible-role-docker/blob/8bb277bd7fb7019eb129b4a07194f0364c060203/.github/workflows/release.yml | ||
name: Publish role on Ansible Galaxy | ||
on: | ||
push: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
release: | ||
name: Publish role on Ansible Galaxy | ||
runs-on: ubuntu-latest | ||
# prevent stuck jobs | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: ./.github/actions/set-up-python | ||
|
||
- name: Set up Ansible | ||
uses: ./.github/actions/set-up-ansible | ||
|
||
- name: Import to Ansible Galaxy | ||
run: >- | ||
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} | ||
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: disable | ||
truthy: | ||
allowed-values: ['true', 'false', 'yes', 'no'] | ||
comments: | ||
min-spaces-from-content: 1 | ||
braces: | ||
min-spaces-inside: 0 | ||
max-spaces-inside: 1 | ||
|
||
ignore: | | ||
.cache | ||
.github/workflows/*.yml | ||
.github/actions/*/*.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
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,22 +1,24 @@ | ||
--- | ||
galaxy_info: | ||
role_name: calibre | ||
version: 1.0.0 | ||
author: JakobLichterfeld | ||
description: Install Calibre via Binary Installer Download | ||
role_name: calibre | ||
namespace: jakoblichterfeld | ||
standalone: true | ||
author: JakobLichterfeld | ||
description: Install Calibre via Binary Installer Download | ||
|
||
homepage: https://github.com/JakobLichterfeld/ansible-role_calibre | ||
issue_tracker_url: https://github.com/JakobLichterfeld/ansible-role_calibre/issues | ||
# homepage: https://github.com/JakobLichterfeld/ansible-role_calibre | ||
issue_tracker_url: https://github.com/JakobLichterfeld/ansible-role_calibre/issues | ||
|
||
license: MIT | ||
min_ansible_version: 2.1 | ||
license: MIT | ||
min_ansible_version: "2.1" | ||
|
||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- jammy | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- jammy | ||
|
||
galaxy_tags: | ||
- calibre | ||
galaxy_tags: | ||
- calibre | ||
- book | ||
|
||
dependencies: [] |
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,15 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: true | ||
become: true | ||
|
||
pre_tasks: | ||
- name: Populate ansible user name | ||
ansible.builtin.set_fact: | ||
ansible_user: "root" | ||
|
||
tasks: | ||
- name: Testing role | ||
ansible.builtin.include_role: | ||
name: jakoblichterfeld.calibre |
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,24 @@ | ||
--- | ||
- name: Destroy | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
# no_log: "{{ molecule_no_log }}" | ||
tasks: | ||
# Developer must implement. | ||
|
||
# Mandatory configuration for Molecule to function. | ||
|
||
- name: Populate instance config | ||
ansible.builtin.set_fact: | ||
instance_conf: {} | ||
|
||
- name: Dump instance config | ||
ansible.builtin.copy: | ||
content: | | ||
# Molecule managed | ||
{{ instance_conf | to_json | from_json | to_yaml }} | ||
dest: "{{ molecule_instance_config }}" | ||
mode: 0600 | ||
when: server.changed | default(false) | bool # noqa no-handler |
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,23 @@ | ||
--- | ||
role_name_check: 1 | ||
dependency: | ||
name: galaxy | ||
|
||
# Docker | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: Instance | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
|
||
# ansible.cfg | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-converge.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