34 lines
865 B
YAML
34 lines
865 B
YAML
---
|
|
- name: verify that required parameters are set for drone agent setup
|
|
fail:
|
|
msg: "Variable '{{ item }}' is not defined for drone agent setup"
|
|
when: item not in vars
|
|
with_items:
|
|
- drone_rpc_server
|
|
tags:
|
|
- configuration
|
|
|
|
- name: copy config for drone agent
|
|
template:
|
|
src: "drone-agent.env.j2"
|
|
dest: "/etc/drone/drone-agent.env"
|
|
register: drone_agent_config
|
|
tags:
|
|
- configuration
|
|
|
|
- name: run drone agent
|
|
docker_container:
|
|
name: "drone-agent"
|
|
image: "drone/agent:{{ drone_version }}"
|
|
state: started
|
|
restart_policy: always
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /var/drone:/var/drone
|
|
- /var/builds:/var/builds
|
|
env_file: /etc/drone/drone-agent.env
|
|
when: drone_agent_config is defined and drone_agent_config.changed
|
|
tags:
|
|
- drone-agent
|
|
- skip_ansible_lint
|