diff options
-rw-r--r-- | roles/setup_git/tasks/main.yml | 38 | ||||
-rw-r--r-- | roles/setup_git/templates/gitweb.service | 28 | ||||
-rw-r--r-- | roles/setup_git/vars/main.yml | 16 | ||||
-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 |
6 files changed, 0 insertions, 273 deletions
diff --git a/roles/setup_git/tasks/main.yml b/roles/setup_git/tasks/main.yml deleted file mode 100644 index 655e81a..0000000 --- a/roles/setup_git/tasks/main.yml +++ /dev/null @@ -1,38 +0,0 @@ - -# roles ~~ setup_git - ---- -- name: Check installation of git - package: - name: git - state: present - -- name: Add group git - user: - name: "{{ git_group }}" - state: present - -- name: Add user git - user: - name: "{{ git_user }}" - comment: "{{ git_user_comment }}" - group: "{{ git_group }}" - -- name: Set up multiple authorized keys - authorized_key: - user: "{{ git_user }}" - state: present - key: "{{ item }}" - with_file: - - "{{ playbook_dir }}/files/pub_ssh/WS-bentonite" - - "{{ playbook_dir }}/files/pub_ssh/LP-graphite" - -- name: Create git directory - file: - path: "{{ git_directory_path }}" - state: directory - owner: "{{ git_user }}" - group: "{{ git_group }}" - mode: 0755 - recurse: True - diff --git a/roles/setup_git/templates/gitweb.service b/roles/setup_git/templates/gitweb.service deleted file mode 100644 index 0b65b49..0000000 --- a/roles/setup_git/templates/gitweb.service +++ /dev/null @@ -1,28 +0,0 @@ - -# =========================================================================== # -# _ __ _ __ -# __ ______ (_) /_ ____ _(_) /_ -# / / / / __ \/ / __/ / __ `/ / __/ -# / /_/ / / / / / /__ / /_/ / / /_ -# \__,_/_/ /_/_/\__(_) \__, /_/\__/ -# /____/ -# -# =========================================================================== # - -[Unit] -Description=Gitweb interface for git repositories - -[Service] -Type=forking -User={{ git_user }} -Group={{ git_group }} -WorkingDirectory={{ git_directory_path }}/{{ git_gitweb_default_repository }} -ExecStart=/usr/bin/git instaweb --port={{ g_port_gitweb_gui }} -ExecStop=/bin/kill -s HUP $MAINPID -RuntimeDirectoryMode=0700 - -Restart=on-failure -RestartSec=60s - -[Install] -WantedBy=default.target diff --git a/roles/setup_git/vars/main.yml b/roles/setup_git/vars/main.yml deleted file mode 100644 index b4f5e64..0000000 --- a/roles/setup_git/vars/main.yml +++ /dev/null @@ -1,16 +0,0 @@ - -# =========================================================================== # -# _ __ -# _ ______ __________ ____ _(_) /_ -# | | / / __ `/ ___/ ___/ / __ `/ / __/ -# | |/ / /_/ / / (__ ) / /_/ / / /_ -# |___/\__,_/_/ /____(_) \__, /_/\__/ -# /____/ -# -# =========================================================================== # - ---- -git_user: git -git_user_comment: handles git repositories and gitweb service -git_group: git -git_directory_path: /srv/git 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" |