- Muchas notas - Fran Acién

20231023 - Setting up Syncthing

I create the next ansible playbook. Is extremely simple.

---
- name: Install Syncthing on Ubuntu
  hosts: all  # replace with your host group or host
  become: yes  # to run operations with sudo
  tasks:
    
    - name: Ensure curl is installed (to download the GPG key)
      apt:
        name: curl
        state: present
        update_cache: yes

    - name: Add the release PGP keys
      command: curl -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
      args:
        warn: no  # Disable warnings about using the command module

    - name: Add the "stable" channel to APT sources
      apt_repository:
        repo: "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable"
        state: present

    - name: Update APT cache and install syncthing
      apt:
        name: syncthing
        state: present
        update_cache: yes