Install with Ansible

Install with Ansible

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 Name

Description

SYNTROPY_AGENT_TOKEN

SYNTROPY 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

Did this page help you?