Reusable workflows used within this organization.
Find a file
2024-11-18 12:24:19 +01:00
.forgejo/workflows fix(ci): debug deploy 2024-11-18 12:24:19 +01:00
CODE_OF_CONDUCT.md feat!: rename workflow add coc, license, readme and renovate config 2024-11-17 01:59:02 +01:00
LICENSE.txt feat!: rename workflow add coc, license, readme and renovate config 2024-11-17 01:59:02 +01:00
README.md refactor(lint_and_deploy_role): refactor 2024-11-18 11:34:33 +01:00
renovate.json5 feat!: rename workflow add coc, license, readme and renovate config 2024-11-17 01:59:02 +01:00

Reusable Workflows (Ansible)

Lint & Deploy Role

Lint and optionally deploy a role to a remote server.

Inputs

Inputs

Name Type Required Default Description
playbook_repository boolean Yes The repository that contains the playbook
deploy boolean No true Deploy the playbook
cache_dependencies boolean No true Cache the dependencies from the requirement file
requirements_file string No /workspace/${{ gitea.repository }}/meta/requirements.yml The path to the requirements file
config_file string No /workspace/${{ gitea.repository }}/ansible.cfg The path to the ansible config file

Secrets

Name Required Description
FORGEJO_TOKEN Only when deploy is true A personal access token that allows this workflow to pull the playbook repository
ANSIBLE_VAULT_PASSWORD Only when deploy is true The vault token/password for ansible vault
ANSIBLE_SSH_PRIVATE_KEY Only when deploy is true A SSH private key to deploy the playbook with the role

Usage

---
name: Lint & Deploy

on:
  pull_request:
  push:
    paths-ignore:
      - "**/*.md"
      - "**/*.txt"
      - "renovate.json5"
      - "meta/main.yml"
  workflow_dispatch:

jobs:
  lint_and_deploy_role:
    uses: ansible/reusable-workflows/.forgejo/workflows/lint_and_deploy_role.yml@main
    with:
      playbook_repository: ${{ vars.ANSIBLE_PLAYBOOK_REPOSITORY }} # "https://git.michaelsasser.org/ansible/roles/role.git"
      # deploy: true
    secrets:
      FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
      ANSIBLE_VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
      ANSIBLE_SSH_PRIVATE_KEY: ${{ secrets.ANSIBLE_SSH_PRIVATE_KEY }}