2021-12-15 00:21:52 +01:00
|
|
|
# Drone Ansible Runner
|
|
|
|
|
|
|
|
Config:
|
|
|
|
```yml
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
2023-07-04 16:38:22 +02:00
|
|
|
check-ansible-syntax:
|
|
|
|
image: git.sebclem.fr/sebclem/woodpecker-ansible-runner
|
|
|
|
pull: true
|
2021-12-15 00:21:52 +01:00
|
|
|
settings:
|
2023-07-04 16:38:22 +02:00
|
|
|
playbook: playbooks/install.yml
|
2021-12-15 00:21:52 +01:00
|
|
|
galaxy_file: roles/requirements.yml
|
|
|
|
check_syntax: true
|
|
|
|
vault_token:
|
2023-07-04 16:38:22 +02:00
|
|
|
from_secret: ansible_vault_token
|
2021-12-15 00:21:52 +01:00
|
|
|
when:
|
2023-07-04 16:38:22 +02:00
|
|
|
- event: "push"
|
|
|
|
branch: [main, master]
|
|
|
|
- event: [pull_request, manual, deployment]
|
2021-12-15 00:21:52 +01:00
|
|
|
|
2023-07-04 16:38:22 +02:00
|
|
|
run-ansible-playbook:
|
|
|
|
image: git.sebclem.fr/sebclem/woodpecker-ansible-runner
|
|
|
|
pull: true
|
2021-12-15 00:21:52 +01:00
|
|
|
settings:
|
2023-07-04 16:38:22 +02:00
|
|
|
verbosity: ${verbosity=0}
|
|
|
|
diff: ${diff=false}
|
|
|
|
check: ${check=false}
|
2022-02-28 11:27:38 +01:00
|
|
|
limit: ${limit}
|
|
|
|
tags: ${tags}
|
2023-07-04 16:38:22 +02:00
|
|
|
playbook: playbooks/install.yml
|
2021-12-15 00:21:52 +01:00
|
|
|
galaxy_file: roles/requirements.yml
|
|
|
|
vault_token:
|
2023-07-04 16:38:22 +02:00
|
|
|
from_secret: ansible_vault_token
|
2021-12-15 00:21:52 +01:00
|
|
|
private_key:
|
|
|
|
from_secret: ansible_private_key
|
|
|
|
when:
|
2023-07-04 16:38:22 +02:00
|
|
|
environment: production
|
|
|
|
event: deployment
|
|
|
|
|
|
|
|
when:
|
|
|
|
- event: "push"
|
|
|
|
branch: [main, master]
|
|
|
|
- event: [pull_request, manual, deployment]
|
|
|
|
|
2021-12-15 00:21:52 +01:00
|
|
|
|
|
|
|
```
|