diff options
author | binary <me@rgoncalves.se> | 2020-11-08 20:56:48 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2020-11-08 20:56:48 +0100 |
commit | 0490ca78425993c4ab61ec2f8d6d428bc3843b2c (patch) | |
tree | b2aeb8e5a8e085e5ab20c15751e60fe426d4fc7f /roles/setup_syncthing | |
parent | e15d9acbd07c1ecb6e6c6b24f547b60f7d92ebaf (diff) | |
download | infrastructure-0490ca78425993c4ab61ec2f8d6d428bc3843b2c.tar.gz |
Remove deprecated roles
Diffstat (limited to 'roles/setup_syncthing')
-rw-r--r-- | roles/setup_syncthing/tasks/main.yml | 131 | ||||
-rw-r--r-- | roles/setup_syncthing/templates/syncthing.service | 28 | ||||
-rw-r--r-- | roles/setup_syncthing/vars/main.yml | 32 |
3 files changed, 0 insertions, 191 deletions
diff --git a/roles/setup_syncthing/tasks/main.yml b/roles/setup_syncthing/tasks/main.yml deleted file mode 100644 index 431f27f..0000000 --- a/roles/setup_syncthing/tasks/main.yml +++ /dev/null @@ -1,131 +0,0 @@ - -# =========================================================================== # -# __ __ __ _ -# _________ / /__ _______ ______ _____/ /_/ /_ (_)___ ____ _ -# / ___/ __ \/ / _ \ / ___/ / / / __ \/ ___/ __/ __ \/ / __ \/ __ `/ -# / / / /_/ / / __/ (__ ) /_/ / / / / /__/ /_/ / / / / / / / /_/ / -# /_/ \____/_/\___(_) /____/\__, /_/ /_/\___/\__/_/ /_/_/_/ /_/\__, / -# /____/ /____/ -# -# =========================================================================== # - ---- -- name: Add group syncthing - group: - name: "{{ syncthing_user }}" - state: present - -- name: Add user syncthing - user: - name: "{{ syncthing_user }}" - comment: "{{ syncthing_group }}" - group: "{{ syncthing_group }}" - -- name: Create syncthing bin directory - file: - path: "{{ syncthing_bin_directory }}" - state: directory - owner: "{{ syncthing_user }}" - group: "{{ syncthing_group }}" - mode: 0755 - recurse: True - -- name: Create syncthing sync directory - file: - path: "{{ syncthing_files_directory }}" - state: directory - owner: "{{ syncthing_user }}" - group: "{{ syncthing_group }}" - mode: 0755 - recurse: True - -- name: Download and extract syncthing archive - become_user: syncthing - unarchive: - src: "{{ syncthing_download_url }}/{{ syncthing_version }}/syncthing-{{ syncthing_os }}-{{ syncthing_architecture }}-{{ syncthing_version }}.tar.gz" - dest: "{{ syncthing_download_directory }}" - remote_src: yes - -- name: Copy syncthing bin - copy: - src: "{{ syncthing_download_directory }}/syncthing-{{ syncthing_os }}-{{ syncthing_architecture }}-{{ syncthing_version }}/syncthing" - remote_src: yes - dest: "{{ syncthing_bin_directory }}" - owner: "{{ syncthing_user }}" - group: "{{ syncthing_group }}" - mode: 0744 - -- name: Copy syncthing systemd unit - template: - src: "{{ syncthing_daemon_unit }}.service" - dest: "{{ g_systemd_unit_directory }}" - owner: root - group: root - mode: 0644 - -- name: Start syncthing systemd unit - systemd: - name: "{{ syncthing_daemon_unit }}" - state: restarted - daemon_reload: yes - -- name: Stop syncthing systemd unit - systemd: - name: "{{ syncthing_daemon_unit }}" - state: stopped - -- name: Config networking - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: /configuration/gui/address - value: "0.0.0.0:{{ g_port_syncthing_gui }}" - -- name: Config clear directory path - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: "/configuration/folder/@path" - state: present - -- name: Config directory path - replace: - path: "{{ syncthing_config_directory }}/config.xml" - regexp: "path=\"\"" - replace: "path=\"{{ syncthing_files_directory }}\"" - -- name: Config disable relay - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: /configuration/options/relaysEnabled - value: "{{ syncthing_b_relays }}" - -- name: Config disable global announcements - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: /configuration/options/globalAnnounceEnabled - value: "{{ syncthing_b_global_announcements }}" - -- name: Config disable nat - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: /configuration/options/natEnabled - value: "{{ syncthing_b_nat }}" - -- name: Config disable crash reporting - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: /configuration/options/crashReportingEnabled - value: "{{ syncthing_b_crash_reporting }}" - -- name: Config disable browser autostart - xml: - path: "{{ syncthing_config_directory }}/config.xml" - xpath: /configuration/options/startBrowser - value: "{{ syncthing_b_start_browser }}" - -- name: Start and enable syncthing systemd unit - systemd: - name: "{{ syncthing_daemon_unit }}" - state: restarted - daemon_reload: yes - enabled: yes - diff --git a/roles/setup_syncthing/templates/syncthing.service b/roles/setup_syncthing/templates/syncthing.service deleted file mode 100644 index e6d5485..0000000 --- a/roles/setup_syncthing/templates/syncthing.service +++ /dev/null @@ -1,28 +0,0 @@ - -# =========================================================================== # -# _ __ __ __ _ -# __ ______ (_) /_ _______ ______ _____/ /_/ /_ (_)___ ____ _ -# / / / / __ \/ / __/ / ___/ / / / __ \/ ___/ __/ __ \/ / __ \/ __ `/ -# / /_/ / / / / / /__ (__ ) /_/ / / / / /__/ /_/ / / / / / / / /_/ / -# \__,_/_/ /_/_/\__(_) /____/\__, /_/ /_/\___/\__/_/ /_/_/_/ /_/\__, / -# /____/ /____/ -# -# =========================================================================== # - -[Unit] -Description=Synchronization service for files - -[Service] -Type=simple -User={{ syncthing_user }} -Group={{ syncthing_group }} -WorkingDirectory={{ syncthing_files_directory }} -ExecStart={{ syncthing_bin_directory }}/syncthing -ExecStop=/bin/kill -s HUP $MAINPID -RuntimeDirectoryMode=0700 - -Restart=on-failure -RestartSec=60s - -[Install] -WantedBy=default.target diff --git a/roles/setup_syncthing/vars/main.yml b/roles/setup_syncthing/vars/main.yml deleted file mode 100644 index 20c6d26..0000000 --- a/roles/setup_syncthing/vars/main.yml +++ /dev/null @@ -1,32 +0,0 @@ - -# =========================================================================== # -# __ __ _ -# _ ______ ___________ _______ ______ _____/ /_/ /_ (_)___ ____ _ -# | | / / __ `/ ___/ ___/ / ___/ / / / __ \/ ___/ __/ __ \/ / __ \/ __ `/ -# | |/ / /_/ / / (__ ) (__ ) /_/ / / / / /__/ /_/ / / / / / / / /_/ / -# |___/\__,_/_/ /____(_) /____/\__, /_/ /_/\___/\__/_/ /_/_/_/ /_/\__, / -# /____/ /____/ -# -# =========================================================================== # - ---- -syncthing_user: syncthing -syncthing_user_comment: handles syncthing service -syncthing_group: syncthing -syncthing_daemon_unit: syncthing - -syncthing_os: linux -syncthing_version: v1.8.0 -syncthing_architecture: arm -syncthing_download_url: https://github.com/syncthing/syncthing/releases/download - -syncthing_download_directory: /tmp -syncthing_bin_directory: /opt/syncthing -syncthing_files_directory: /srv/sync -syncthing_config_directory: "/home/{{ syncthing_user }}/.config/syncthing" - -syncthing_b_nat: "false" -syncthing_b_relays: "false" -syncthing_b_start_browser: "false" -syncthing_b_crash_reporting: "false" -syncthing_b_global_announcements: "false" |