Update Syntropy Agent

Below are examples of how to update Syntropy Agent. It's worth doing this periodically to make sure all is up-to-date and working as expected.

Update Syntropy Agent (Docker)

To update Syntropy Agent running in docker need to pull a new image.

sudo docker pull syntropynet/agent:stable
sudo docker stop syntropynet-agent
sudo docker rm syntropynet-agent
// Syntropy API Key is Required
sudo docker run --network="host" --restart=on-failure:10 \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE -v /var/run/docker.sock:/var/run/docker.sock:ro \
--device /dev/net/tun:/dev/net/tun --name=syntropynet-agent \
-e SYNTROPY_NETWORK_API='docker' \
-e SYNTROPY_AGENT_TOKEN=<<agent_token>> -d syntropynet/agent:stable

Update Syntropy Agent (Ansible)

To update Syntropy Agent with Ansible, need to run the playbook again.

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_API_KEY: <<agent_token>>
        SYNTROPY_NETWORK_API: docker
        volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro
        devices:
        - "/dev/net/tun:/dev/net/tun"
        capabilities:
        - net_admin
        - sys_module