Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ansible-galaxy-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Ansible Galaxy

on:
workflow_call:
secrets:
galaxy-token:
required: true
description: "Token to upload the Role to Ansible Galaxy"

jobs:
publish:
name: Publish Role
runs-on: ubuntu-20.04
steps:
- name: Publish to Ansible Galaxy
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy-token }}
20 changes: 0 additions & 20 deletions .github/workflows/ansible-integration-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
description: "List of distributions to test against the Role"
type: string
default: '[ "debian11", "debian10" ]'
default-branch:
required: false
description: "Default branch of the repository. Default: main"
type: string
default: "main"
python-dependencies:
required: false
description: "Default pip dependencies for molecule"
Expand Down Expand Up @@ -52,10 +47,6 @@ on:
description: "Disable AppArmor MySQL Profile for the Job Runner"
type: boolean
default: false
secrets:
galaxy-token:
required: true
description: "Token to upload the Role to Ansible Galaxy"

jobs:
lint:
Expand Down Expand Up @@ -137,14 +128,3 @@ jobs:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }}

release:
name: Ansible Galaxy
runs-on: ubuntu-20.04
needs: [test]
if: github.ref_name == inputs.default-branch || contains(github.ref, 'refs/tags/')
steps:
- name: Publish to Ansible Galaxy
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy-token }}
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Github Workflow for Ansible Roles
# Github Workflows for Ansible Roles

## Configuration
## Continuous Integration (Molecule)

### Configuration

| Variable | Type | Default | Description |
|---|---|---|---|
| distros | string | '[ "debian11", "debian10" ]' | List of distributions to test against the Role |
| default-branch | string | main | Default branch of the repository|
| python-dependencies | string | [see workflow](.github/workflows/ansible-integration-workflow.yaml) | Default pip dependencies for molecule |
| role-dependencies | string | [see workflow](.github/workflows/ansible-integration-workflow.yaml) | Default role dependencies for ansible (empty)|
| molecule-config | string | [see workflow](.github/workflows/ansible-integration-workflow.yaml) | Configuration for molecule |
| disable-apparmor-mysql | boolean | false | Disable AppArmor MySQL Profile for the Job Runner |

## Usage
### Usage

Create a workflow, e.g. `.github/workflows/integration.yaml`

Expand All @@ -34,3 +35,33 @@ jobs:
secrets:
galaxy-token: ${{ secrets.galaxy_api_key }}
```

## Ansible Galaxy

### Configuration

| Variable | Type | Default | Description |
|---|---|---|---|
| galaxy-token | secret | | Secret for Ansible Galaxy |

### Usage

Create a workflow, e.g. `.github/workflows/galaxy.yaml`

```yaml
---
name: Ansible Galaxy

on:
push:
branches:
- main
release:

jobs:
galaxy:
name: Ansible Galaxy
uses: systemli/github-ansible-workflow/.github/workflows/ansible-galaxy-workflow.yaml@main
secrets:
galaxy-token: ${{ secrets.galaxy_api_key }}
```