Install with Ansible

Installing Syntropy Agent with Ansible

Install with Ansible

📘

Prerequisites

To run an installation, you need to install WireGuard® first. Starting from 5.6.x, Linux kernel supports wireguard by default.

WireGuard® installation: https://www.wireguard.com/install/

🚧

Running as root

At the moment, the Syntropy Agent requires running as root user.

If you are using Ansible for provisioning, Syntropy provides a simple way for you to get your network configured


Mandatory Variables

In order to successfully install Syntropy with Docker, you must have an API Key

Variable NameDescription
SYNTROPY_AGENT_TOKENSYNTROPY Network Agent Token (String)

👍

API Key Example

SYNTROPY_AGENT_TOKEN=nQlSAezB8yxncfdeW#$2mKR4UTqEQ2R5


Installation

ansible-playbook syntropy-agent.yaml -f 10
---
hosts: all
# tasks file for syntropy-agent
tasks:
	- name: pull an image
  	docker_image:
    	name: syntropynet/agent:stable
    	force_source: yes

	- name: Stop and remove old container
  	docker_container:
    	name: syntropy-agent
    	state: absent
    	image: syntropy-agent

	- name: Create Syntropy agent container and connect to network
  	docker_container:
    	name: syntropy-agent
    	restart_policy: unless-stopped
    	image: syntropynet/agent:stable
    	network_mode: "host"
    	purge_networks: no
    	env:
      	SYNTROPY_AGENT_TOKEN: <<agent_token>>
      	SYNTROPY_NETWORK_API: docker
    	volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro
        - /var/lock/syntropy_agent.lock:/var/lock/syntropy_agent.lock
        - /run/xtables.lock:/run/xtables.lock
    	devices:
      	- "/dev/net/tun:/dev/net/tun"
    	capabilities:
      	- net_admin
      	- sys_module

Next step

Customize your installation with Syntropy Agent Variables