add pcloud
This commit is contained in:
+68
-25
@@ -1,57 +1,100 @@
|
||||
---
|
||||
- name: Check for Eclipse JDT Language Server
|
||||
- name: Check for JDT LS
|
||||
ansible.builtin.stat:
|
||||
path: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
path: "{{ jdtls_install_dir }}/plugins"
|
||||
become: false
|
||||
register: jdtls_binary
|
||||
register: jdtls_installed
|
||||
|
||||
- name: Create JDT LS installation directories
|
||||
- name: Create JDT LS target directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ user_name }}"
|
||||
mode: "0755"
|
||||
become: false
|
||||
loop:
|
||||
- "{{ jdtls_install_dir }}"
|
||||
- "{{ user_home }}/.local/bin"
|
||||
|
||||
- name: Read the JDT LS milestone archive name
|
||||
ansible.builtin.uri:
|
||||
url: "{{ jdtls_base_url }}/latest.txt"
|
||||
return_content: true
|
||||
- "{{ jdtls_bin_dir }}"
|
||||
become: false
|
||||
register: jdtls_latest
|
||||
when: not jdtls_binary.stat.exists
|
||||
|
||||
- name: Download Eclipse JDT Language Server
|
||||
- name: Download Eclipse JDT LS
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ jdtls_base_url }}/{{ jdtls_latest.content | trim }}"
|
||||
url: "{{ jdtls_url }}"
|
||||
dest: "{{ jdtls_archive }}"
|
||||
mode: "0644"
|
||||
checksum: "sha256:{{ jdtls_base_url }}/{{ jdtls_latest.content | trim }}.sha256"
|
||||
become: false
|
||||
when: not jdtls_binary.stat.exists
|
||||
force: "{{ jdtls_force_update }}"
|
||||
timeout: "{{ jdtls_download_timeout }}"
|
||||
register: jdtls_download
|
||||
until: jdtls_download is succeeded
|
||||
retries: "{{ jdtls_download_retries }}"
|
||||
delay: "{{ jdtls_download_delay }}"
|
||||
when: jdtls_force_update or not jdtls_installed.stat.exists
|
||||
|
||||
- name: Extract Eclipse JDT Language Server
|
||||
- name: Remove existing JDT LS install when forced
|
||||
ansible.builtin.file:
|
||||
path: "{{ jdtls_install_dir }}"
|
||||
state: absent
|
||||
become: false
|
||||
when: jdtls_force_update and jdtls_installed.stat.exists
|
||||
|
||||
- name: Recreate JDT LS install directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ jdtls_install_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
become: false
|
||||
when: jdtls_force_update and jdtls_installed.stat.exists
|
||||
|
||||
- name: Extract Eclipse JDT LS
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ jdtls_archive }}"
|
||||
dest: "{{ jdtls_install_dir }}"
|
||||
remote_src: true
|
||||
creates: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
become: false
|
||||
when: not jdtls_binary.stat.exists
|
||||
when: jdtls_force_update or not jdtls_installed.stat.exists
|
||||
|
||||
- name: Link jdtls into the user's PATH
|
||||
- name: Check for bundled JDT LS launcher
|
||||
ansible.builtin.stat:
|
||||
path: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
become: false
|
||||
register: jdtls_bundled_launcher
|
||||
|
||||
- name: Link bundled JDT LS launcher onto the user PATH
|
||||
ansible.builtin.file:
|
||||
src: "{{ jdtls_install_dir }}/bin/jdtls"
|
||||
dest: "{{ user_home }}/.local/bin/jdtls"
|
||||
dest: "{{ jdtls_bin_dir }}/jdtls"
|
||||
state: link
|
||||
force: true
|
||||
become: false
|
||||
when: jdtls_bundled_launcher.stat.exists
|
||||
|
||||
- name: Create fallback JDT LS launcher
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ jdtls_bin_dir }}/jdtls"
|
||||
mode: "0755"
|
||||
content: |
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
JDTLS_HOME="{{ jdtls_install_dir }}"
|
||||
LAUNCHER_JAR=$(find "$JDTLS_HOME/plugins" -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -n 1)
|
||||
|
||||
exec java \
|
||||
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
|
||||
-Dosgi.bundles.defaultStartLevel=4 \
|
||||
-Declipse.product=org.eclipse.jdt.ls.core.product \
|
||||
-Dlog.protocol=true \
|
||||
-Dlog.level=ALL \
|
||||
-Xmx1G \
|
||||
--add-modules=ALL-SYSTEM \
|
||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.lang=ALL-UNNAMED \
|
||||
-jar "$LAUNCHER_JAR" \
|
||||
-configuration "$JDTLS_HOME/config_linux" \
|
||||
-data "$PWD/.jdtls-workspace" \
|
||||
"$@"
|
||||
become: false
|
||||
when: not jdtls_bundled_launcher.stat.exists
|
||||
|
||||
- name: Remove downloaded JDT LS archive
|
||||
ansible.builtin.file:
|
||||
path: "{{ jdtls_archive }}"
|
||||
state: absent
|
||||
become: false
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Create pCloud install directory
|
||||
ansible.builtin.file:
|
||||
path: /opt/pcloud
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Download pCloud AppImage
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ pcloud_appimage_url }}"
|
||||
dest: /opt/pcloud/pCloud.AppImage
|
||||
mode: "0755"
|
||||
timeout: 300
|
||||
|
||||
- name: Link pCloud onto system PATH
|
||||
ansible.builtin.file:
|
||||
src: /opt/pcloud/pCloud.AppImage
|
||||
dest: /usr/local/bin/pcloud
|
||||
state: link
|
||||
force: true
|
||||
|
||||
- name: Ensure system desktop application directory exists
|
||||
ansible.builtin.file:
|
||||
path: /usr/local/share/applications
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Create pCloud desktop launcher
|
||||
ansible.builtin.copy:
|
||||
dest: /usr/local/share/applications/pcloud.desktop
|
||||
mode: "0644"
|
||||
content: |
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=pCloud Drive
|
||||
Comment=pCloud Drive desktop client
|
||||
Exec=/usr/local/bin/pcloud
|
||||
Terminal=false
|
||||
Categories=Network;FileTransfer;
|
||||
+6
-11
@@ -83,22 +83,17 @@
|
||||
become: false
|
||||
register: starship_binary
|
||||
|
||||
- name: Download the Starship installer
|
||||
- name: Download Starship installer script
|
||||
ansible.builtin.get_url:
|
||||
url: https://starship.rs/install.sh
|
||||
dest: /tmp/starship-install.sh
|
||||
mode: "0755"
|
||||
dest: /tmp/install_starship.sh
|
||||
mode: '0755'
|
||||
when: not starship_binary.stat.exists
|
||||
|
||||
- name: Install Starship for the workstation user
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- /tmp/starship-install.sh
|
||||
- --yes
|
||||
- --bin-dir
|
||||
- "{{ user_home }}/.local/bin"
|
||||
become: false
|
||||
- name: Run Starship installer
|
||||
ansible.builtin.command: /tmp/install_starship.sh -y
|
||||
when: not starship_binary.stat.exists
|
||||
become: true
|
||||
|
||||
- name: Check for Bun
|
||||
ansible.builtin.stat:
|
||||
|
||||
@@ -1,4 +1,54 @@
|
||||
---
|
||||
- name: Ensure XDG config and wanted user directories exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
owner: "{{ user_name }}"
|
||||
mode: "{{ item.mode }}"
|
||||
loop:
|
||||
- { path: "{{ user_home }}/.config", mode: "0755" }
|
||||
- { path: "{{ user_home }}/Downloads", mode: "0755" }
|
||||
- { path: "{{ user_home }}/Pictures", mode: "0755" }
|
||||
become: false
|
||||
|
||||
- name: Disable automatic XDG user directory creation
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ user_home }}/.config/user-dirs.conf"
|
||||
owner: "{{ user_name }}"
|
||||
mode: "0644"
|
||||
content: |
|
||||
enabled=False
|
||||
become: false
|
||||
|
||||
- name: Keep only Downloads and Pictures as real XDG user directories
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ user_home }}/.config/user-dirs.dirs"
|
||||
owner: "{{ user_name }}"
|
||||
mode: "0644"
|
||||
content: |
|
||||
XDG_DESKTOP_DIR="$HOME"
|
||||
XDG_DOCUMENTS_DIR="$HOME"
|
||||
XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||
XDG_MUSIC_DIR="$HOME"
|
||||
XDG_PICTURES_DIR="$HOME/Pictures"
|
||||
XDG_PUBLICSHARE_DIR="$HOME"
|
||||
XDG_TEMPLATES_DIR="$HOME"
|
||||
XDG_VIDEOS_DIR="$HOME"
|
||||
become: false
|
||||
|
||||
- name: Remove unwanted empty XDG directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ user_home }}/{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- Desktop
|
||||
- Documents
|
||||
- Music
|
||||
- Public
|
||||
- Templates
|
||||
- Videos
|
||||
become: false
|
||||
|
||||
- name: Check for the Git signing public key
|
||||
ansible.builtin.stat:
|
||||
path: "{{ git_signing_key }}"
|
||||
|
||||
Reference in New Issue
Block a user