Created
October 30, 2019 06:51
-
-
Save jadechip/dfe4f268bf2cf907a5d10fcc8f3746b0 to your computer and use it in GitHub Desktop.
Sample Ansible Playbook
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
--- | |
- hosts: droneci | |
become: true | |
vars: | |
ansible_python_interpreter: "/usr/bin/env python3" | |
environment: | |
DRONE_SERVER_HOST: '{{ lookup("env", "DRONE_SERVER_HOST") }}' | |
DRONE_RPC_SECRET: '{{ lookup("env", "DRONE_RPC_SECRET") }}' | |
DRONE_GITHUB_CLIENT_ID: '{{ lookup("env", "DRONE_GITHUB_CLIENT_ID") }}' | |
DRONE_GITHUB_CLIENT_SECRET: '{{ lookup("env", "DRONE_GITHUB_CLIENT_SECRET") }}' | |
tasks: | |
- docker_compose: | |
project_name: drone | |
definition: | |
version: '3' | |
services: | |
server: | |
image: drone/drone:1.2.1 | |
restart: always | |
ports: | |
- "80:80" | |
volumes: | |
- /var/lib/drone:/var/lib/drone/ | |
environment: | |
- DRONE_SERVER_HOST=${DRONE_SERVER_HOST} | |
- DRONE_SERVER_PROTO=http | |
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET} | |
- DRONE_GITHUB_SERVER=https://github.com | |
- DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} | |
- DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} | |
agent: | |
image: drone/agent:1.2.1 | |
restart: always | |
command: agent | |
depends_on: | |
- server | |
volumes: | |
- /var/run/Docker.sock:/var/run/Docker.sock | |
environment: | |
- DRONE_LOGS_DEBUG=true | |
- DRONE_LOGS_TRACE=true | |
- DRONE_RPC_SERVER=http://server | |
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment