refactor(lint,fqdn-names): Full FQDN names for modules

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2025-01-22 00:06:35 +01:00
parent 87fb4fa5da
commit 71532a6d25
15 changed files with 107 additions and 85 deletions

View File

@@ -1,2 +1,2 @@
[local] [local]
test ansible_ssh_host=192.168.30.123 ansible_ssh_port=22 test ansible_connection=local

View File

@@ -1,6 +1,6 @@
--- ---
- name: Install apt packages - name: Install apt packages
apt: ansible.builtin.apt:
name: name:
- ansible - ansible
- bat - bat
@@ -28,7 +28,8 @@
- xsel - xsel
- zsh - zsh
state: present state: present
update_cache: yes update_cache: true
become: true
- name: Update tldr database - name: Update tldr database
command: tldr --update ansible.builtin.command: tldr --update

View File

@@ -1,36 +1,37 @@
--- ---
- name: Install prerequisites for Docker - name: Install prerequisites for Docker
apt: ansible.builtin.apt:
name: name:
- ca-certificates - ca-certificates
- curl - curl
state: present state: present
update_cache: yes update_cache: true
become: true
- name: Create /etc/apt/keyrings directory - name: Create /etc/apt/keyrings directory
file: ansible.builtin.file:
path: /etc/apt/keyrings path: /etc/apt/keyrings
state: directory state: directory
mode: "0755" mode: "0755"
- name: Download Docker GPG key - name: Download Docker GPG key
get_url: ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/keyrings/docker.asc dest: /etc/apt/keyrings/docker.asc
mode: "0644" mode: "0644"
- name: Add Docker repository - name: Add Docker repository
apt_repository: ansible.builtin.apt_repository:
repo: "deb [arch={{ ansible_architecture }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable" repo: "deb [arch={{ ansible_architecture }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
filename: docker filename: docker
state: present state: present
- name: Update apt cache after adding Docker repo - name: Update apt cache after adding Docker repo
apt: ansible.builtin.apt:
update_cache: yes update_cache: true
- name: Install Docker packages - name: Install Docker packages
apt: ansible.builtin.apt:
name: name:
- docker-ce - docker-ce
- docker-ce-cli - docker-ce-cli
@@ -40,7 +41,7 @@
state: present state: present
- name: Add current user to docker group - name: Add current user to docker group
user: ansible.builtin.user:
name: "{{ ansible_user_id }}" name: "{{ ansible_user_id }}"
groups: docker groups: docker
append: yes append: true

View File

@@ -1,27 +1,27 @@
--- ---
- name: Create fonts directory - name: Create fonts directory
file: ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.fonts" path: "{{ ansible_env.HOME }}/.fonts"
state: directory state: directory
mode: "0755" mode: "0755"
- name: Download FiraCode Nerd Font zip - name: Download FiraCode Nerd Font zip
get_url: ansible.builtin.get_url:
url: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraMono.zip url: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraMono.zip
dest: "/tmp/FiraMono.zip" dest: "/tmp/FiraMono.zip"
- name: Extract FiraCode from zip - name: Extract FiraCode from zip
unarchive: ansible.builtin.unarchive:
src: "/tmp/FiraMono.zip" src: "/tmp/FiraMono.zip"
dest: "{{ ansible_env.HOME }}/.fonts" dest: "{{ ansible_env.HOME }}/.fonts"
remote_src: yes remote_src: yes
- name: Remove FiraMono.zip - name: Remove FiraMono.zip
file: ansible.builtin.file:
path: "/tmp/FiraMono.zip" path: "/tmp/FiraMono.zip"
state: absent state: absent
- name: Refresh font cache - name: Refresh font cache
shell: fc-cache -fv ansible.builtin.shell: fc-cache -fv
args: args:
warn: false warn: false

View File

@@ -1,28 +1,28 @@
--- ---
- name: Get OS release info - name: Get OS release info
shell: source /etc/os-release && echo $VERSION_ID ansible.builtin.shell: source /etc/os-release && echo $VERSION_ID
register: version_id register: version_id
changed_when: false changed_when: false
- name: Get Ghostty DEB URL - name: Get Ghostty DEB URL
shell: | ansible.builtin.shell: |
curl -s https://api.github.com/repos/mkasberg/ghostty-ubuntu/releases/latest | curl -s https://api.github.com/repos/mkasberg/ghostty-ubuntu/releases/latest |
grep -oP "https://github.com/mkasberg/ghostty-ubuntu/releases/download/[^\s/]+/ghostty_[^\s/_]+_amd64_{{ version_id.stdout }}.deb" grep -oP "https://github.com/mkasberg/ghostty-ubuntu/releases/download/[^\s/]+/ghostty_[^\s/_]+_amd64_{{ version_id.stdout }}.deb"
register: ghostty_deb_url register: ghostty_deb_url
changed_when: false changed_when: false
- name: Download Ghostty deb file - name: Download Ghostty deb file
get_url: ansible.builtin.get_url:
url: "{{ ghostty_deb_url.stdout }}" url: "{{ ghostty_deb_url.stdout }}"
dest: "/tmp/{{ ghostty_deb_url.stdout | basename }}" dest: "/tmp/{{ ghostty_deb_url.stdout | basename }}"
mode: "0755" mode: "0755"
- name: Install Ghostty - name: Install Ghostty
apt: ansible.builtin.apt:
deb: "/tmp/{{ ghostty_deb_url.stdout | basename }}" deb: "/tmp/{{ ghostty_deb_url.stdout | basename }}"
state: present state: present
- name: Remove Ghostty deb file - name: Remove Ghostty deb file
file: ansible.builtin.file:
path: "/tmp/{{ ghostty_deb_url.stdout | basename }}" path: "/tmp/{{ ghostty_deb_url.stdout | basename }}"
state: absent state: absent

View File

@@ -1,22 +1,22 @@
--- ---
- name: Download git-delta deb - name: Download git-delta deb
get_url: ansible.builtin.get_url:
url: https://github.com/dandavison/delta/releases/download/0.18.2/git-delta-musl_0.18.2_amd64.deb url: https://github.com/dandavison/delta/releases/download/0.18.2/git-delta-musl_0.18.2_amd64.deb
dest: "/tmp/git-delta-musl_0.18.2_amd64.deb" dest: "/tmp/git-delta-musl_0.18.2_amd64.deb"
- name: Install git-delta - name: Install git-delta
apt: ansible.builtin.apt:
deb: "/tmp/git-delta-musl_0.18.2_amd64.deb" deb: "/tmp/git-delta-musl_0.18.2_amd64.deb"
state: present state: present
- name: Remove git-delta deb - name: Remove git-delta deb
file: ansible.builtin.file:
path: "/tmp/git-delta-musl_0.18.2_amd64.deb" path: "/tmp/git-delta-musl_0.18.2_amd64.deb"
state: absent state: absent
- name: Install atuin - name: Install atuin
become: false become: false
shell: curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh ansible.builtin.shell: curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
args: args:
creates: "{{ ansible_env.HOME }}/.config/atuin" # Adjust based on atuin installation creates: "{{ ansible_env.HOME }}/.config/atuin" # Adjust based on atuin installation

View File

@@ -1,31 +1,31 @@
--- ---
- name: Get latest lazygit version - name: Get latest lazygit version
shell: | ansible.builtin.shell: |
curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" |
grep -Po '"tag_name": *"v\K[^"]*' grep -Po '"tag_name": *"v\K[^"]*'
register: lazygit_version register: lazygit_version
changed_when: false changed_when: false
- name: Download lazygit tar.gz - name: Download lazygit tar.gz
get_url: ansible.builtin.get_url:
url: "https://github.com/jesseduffield/lazygit/releases/download/v{{ lazygit_version.stdout }}/lazygit_{{ lazygit_version.stdout }}_Linux_x86_64.tar.gz" url: "https://github.com/jesseduffield/lazygit/releases/download/v{{ lazygit_version.stdout }}/lazygit_{{ lazygit_version.stdout }}_Linux_x86_64.tar.gz"
dest: "/tmp/lazygit.tar.gz" dest: "/tmp/lazygit.tar.gz"
- name: Extract lazygit binary - name: Extract lazygit binary
unarchive: ansible.builtin.unarchive:
src: "/tmp/lazygit.tar.gz" src: "/tmp/lazygit.tar.gz"
dest: "/tmp" dest: "/tmp"
creates: "/tmp/lazygit" creates: "/tmp/lazygit"
remote_src: yes remote_src: yes
- name: Install lazygit - name: Install lazygit
copy: ansible.builtin.copy:
src: "/tmp/lazygit" src: "/tmp/lazygit"
dest: /usr/local/bin/lazygit dest: /usr/local/bin/lazygit
mode: "0755" mode: "0755"
- name: Remove lazygit tar.gz and binary - name: Remove lazygit tar.gz and binary
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
loop: loop:
@@ -33,16 +33,16 @@
- "/tmp/lazygit" - "/tmp/lazygit"
- name: Download ripgrep deb - name: Download ripgrep deb
get_url: ansible.builtin.get_url:
url: https://github.com/BurntSushi/ripgrep/releases/download/14.1.0/ripgrep_14.1.0-1_amd64.deb url: https://github.com/BurntSushi/ripgrep/releases/download/14.1.0/ripgrep_14.1.0-1_amd64.deb
dest: "/tmp/ripgrep_14.1.0-1_amd64.deb" dest: "/tmp/ripgrep_14.1.0-1_amd64.deb"
- name: Install ripgrep - name: Install ripgrep
apt: ansible.builtin.apt:
deb: "/tmp/ripgrep_14.1.0-1_amd64.deb" deb: "/tmp/ripgrep_14.1.0-1_amd64.deb"
state: present state: present
- name: Remove ripgrep deb - name: Remove ripgrep deb
file: ansible.builtin.file:
path: "/tmp/ripgrep_14.1.0-1_amd64.deb" path: "/tmp/ripgrep_14.1.0-1_amd64.deb"
state: absent state: absent

View File

@@ -1,15 +1,35 @@
--- ---
- import_tasks: apt.yml - name: Install apt packages
- import_tasks: snap.yml ansible.builtin.import_tasks: apt.yml
- import_tasks: nvim_rust.yml - name: Install snap packages
- import_tasks: ghostty.yml ansible.builtin.import_tasks: snap.yml
- import_tasks: pacstall_ledger.yml - name: Install nvim
- import_tasks: git_delta_atuin.yml ansible.builtin.import_tasks: nvim_rust.yml
- import_tasks: starship_eurkey_veracrypt.yml - name: Install Rust
- import_tasks: fira_code_fonts.yml - name: Ghostty
- import_tasks: remove_ubuntu_banner.yml ansible.builtin.import_tasks: ghostty.yml
- import_tasks: protonvpn.yml - name: Install pacstall
- import_tasks: docker.yml - name: Install ledger
- import_tasks: paisa.yml ansible.builtin.import_tasks: pacstall_ledger.yml
- import_tasks: lazygit_ripgrep.yml - name: Install git-delta
- import_tasks: hashicorp_vagrant.yml - name: Install atuin
ansible.builtin.import_tasks: git_delta_atuin.yml
- name: Install Starship
- name: Install EurKey
- name: Install Veracrypt
ansible.builtin.import_tasks: starship_eurkey_veracrypt.yml
- name: Install FiraCode
ansible.builtin.import_tasks: fira_code_fonts.yml
- name: Remove Ubuntu Pro Banner
ansible.builtin.import_tasks: remove_ubuntu_banner.yml
- name: Install ProtonVPN
ansible.builtin.import_tasks: protonvpn.yml
- name: Install Docker
ansible.builtin.import_tasks: docker.yml
- name: Install paisa.fyi
ansible.builtin.import_tasks: paisa.yml
- name: Install lazygit
- name: Install ripgrep
ansible.builtin.import_tasks: lazygit_ripgrep.yml
- name: Install Vagrant
ansible.builtin.import_tasks: hashicorp_vagrant.yml

View File

@@ -1,11 +1,11 @@
--- ---
- name: Install neovim npm package globally - name: Install neovim npm package globally
npm: ansible.builtin.npm:
name: neovim name: neovim
global: yes global: yes
- name: Install Rust (via rustup) - name: Install Rust (via rustup)
become: false become: false
shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ansible.builtin.shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
args: args:
creates: "{{ ansible_env.HOME }}/.cargo/bin/rustc" creates: "{{ ansible_env.HOME }}/.cargo/bin/rustc"

View File

@@ -1,19 +1,19 @@
--- ---
- name: Install Pacstall - name: Install Pacstall
shell: bash -c "$(curl -fsSL https://pacstall.dev/q/install)" ansible.builtin.shell: bash -c "$(curl -fsSL https://pacstall.dev/q/install)"
args: args:
creates: /usr/local/bin/pacstall # Adjust based on pacstall install path creates: /usr/local/bin/pacstall # Adjust based on pacstall install path
- name: Add Ledger PPA - name: Add Ledger PPA
apt_repository: ansible.builtin.apt_repository:
repo: ppa:mbudde/ledger repo: ppa:mbudde/ledger
state: present state: present
- name: Update apt cache after adding Ledger PPA - name: Update apt cache after adding Ledger PPA
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes
- name: Install ledger - name: Install ledger
apt: ansible.builtin.apt:
name: ledger name: ledger
state: present state: present

View File

@@ -1,48 +1,48 @@
--- ---
- name: Backup current sources.list - name: Backup current sources.list
copy: ansible.builtin.copy:
src: /etc/apt/sources.list src: /etc/apt/sources.list
dest: /etc/apt/sources.list.bak dest: /etc/apt/sources.list.bak
remote_src: yes remote_src: yes
- name: Add universe repository temporarily - name: Add universe repository temporarily
lineinfile: ansible.builtin.lineinfile:
path: /etc/apt/sources.list path: /etc/apt/sources.list
line: "deb http://archive.ubuntu.com/ubuntu jammy main universe" line: "deb http://archive.ubuntu.com/ubuntu jammy main universe"
insertafter: EOF insertafter: EOF
- name: Update apt cache - name: Update apt cache
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes
- name: Upgrade all packages - name: Upgrade all packages
apt: ansible.builtin.apt:
upgrade: dist upgrade: dist
- name: Install dependencies for Paisa - name: Install dependencies for Paisa
apt: ansible.builtin.apt:
name: name:
- libwebkit2gtk-4.0-dev - libwebkit2gtk-4.0-dev
- webkit2gtk - webkit2gtk
state: present state: present
- name: Restore original sources.list - name: Restore original sources.list
copy: ansible.builtin.copy:
src: /etc/apt/sources.list.bak src: /etc/apt/sources.list.bak
dest: /etc/apt/sources.list dest: /etc/apt/sources.list
remote_src: yes remote_src: yes
- name: Download Paisa app deb - name: Download Paisa app deb
get_url: ansible.builtin.get_url:
url: https://github.com/ananthakumaran/paisa/releases/download/v0.7.1/paisa-app-linux-amd64.deb url: https://github.com/ananthakumaran/paisa/releases/download/v0.7.1/paisa-app-linux-amd64.deb
dest: "/tmp/paisa-app-linux-amd64.deb" dest: "/tmp/paisa-app-linux-amd64.deb"
- name: Install Paisa - name: Install Paisa
apt: ansible.builtin.apt:
deb: "/tmp/paisa-app-linux-amd64.deb" deb: "/tmp/paisa-app-linux-amd64.deb"
state: present state: present
- name: Remove Paisa deb - name: Remove Paisa deb
file: ansible.builtin.file:
path: "/tmp/paisa-app-linux-amd64.deb" path: "/tmp/paisa-app-linux-amd64.deb"
state: absent state: absent

View File

@@ -1,25 +1,25 @@
--- ---
- name: Download ProtonVPN release deb - name: Download ProtonVPN release deb
get_url: ansible.builtin.get_url:
url: https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_1.0.6_all.deb url: https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_1.0.6_all.deb
dest: "/tmp/protonvpn-stable-release_1.0.6_all.deb" dest: "/tmp/protonvpn-stable-release_1.0.6_all.deb"
- name: Verify ProtonVPN deb checksum - name: Verify ProtonVPN deb checksum
shell: echo "e5e03976d0980bafdf07da2f71b14fbc883c091e72b16772199742c98473002f /tmp/protonvpn-stable-release_1.0.6_all.deb" | sha256sum --check - ansible.builtin.shell: echo "e5e03976d0980bafdf07da2f71b14fbc883c091e72b16772199742c98473002f /tmp/protonvpn-stable-release_1.0.6_all.deb" | sha256sum --check -
register: checksum_result register: checksum_result
failed_when: "'FAILED' in checksum_result.stdout" failed_when: "'FAILED' in checksum_result.stdout"
- name: Install ProtonVPN release package - name: Install ProtonVPN release package
apt: ansible.builtin.apt:
deb: "/tmp/protonvpn-stable-release_1.0.6_all.deb" deb: "/tmp/protonvpn-stable-release_1.0.6_all.deb"
state: present state: present
- name: Update apt cache after ProtonVPN repo added - name: Update apt cache after ProtonVPN repo added
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes
- name: Install ProtonVPN GNOME desktop - name: Install ProtonVPN GNOME desktop
apt: ansible.builtin.apt:
name: name:
- proton-vpn-gnome-desktop - proton-vpn-gnome-desktop
- libayatana-appindicator3-1 - libayatana-appindicator3-1
@@ -28,6 +28,6 @@
state: present state: present
- name: Remove ProtonVPN release deb - name: Remove ProtonVPN release deb
file: ansible.builtin.file:
path: "/tmp/protonvpn-stable-release_1.0.6_all.deb" path: "/tmp/protonvpn-stable-release_1.0.6_all.deb"
state: absent state: absent

View File

@@ -1,14 +1,14 @@
--- ---
- name: Backup Ubuntu Pro banner configuration - name: Backup Ubuntu Pro banner configuration
command: mv /etc/apt/apt.conf.d/20apt-esm-hook.conf /etc/apt/apt.conf.d/20apt-esm-hook.conf.bak ansible.builtin.command: mv /etc/apt/apt.conf.d/20apt-esm-hook.conf /etc/apt/apt.conf.d/20apt-esm-hook.conf.bak
args: args:
removes: /etc/apt/apt.conf.d/20apt-esm-hook.conf removes: /etc/apt/apt.conf.d/20apt-esm-hook.conf
- name: Create empty Ubuntu Pro banner configuration - name: Create empty Ubuntu Pro banner configuration
file: ansible.builtin.file:
path: /etc/apt/apt.conf.d/20apt-esm-hook.conf path: /etc/apt/apt.conf.d/20apt-esm-hook.conf
state: touch state: touch
- name: Update apt cache - name: Update apt cache
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes

View File

@@ -1,22 +1,22 @@
--- ---
- name: Install snap packages - bottom - name: Install snap packages - bottom
snap: ansible.builtin.snap:
name: bottom name: bottom
state: present state: present
- name: Install snap packages - signal-desktop - name: Install snap packages - signal-desktop
snap: ansible.builtin.snap:
name: signal-desktop name: signal-desktop
state: present state: present
- name: Install snap packages - nvim - name: Install snap packages - nvim
snap: ansible.builtin.snap:
name: nvim name: nvim
classic: true classic: true
state: present state: present
- name: Install snap packages - zellij - name: Install snap packages - zellij
snap: ansible.builtin.snap:
name: zellij name: zellij
classic: true classic: true
state: present state: present

View File

@@ -1,36 +1,36 @@
--- ---
- name: Install starship - name: Install starship
become: false become: false
shell: curl -sS https://starship.rs/install.sh | sh -s -- -y ansible.builtin.shell: curl -sS https://starship.rs/install.sh | sh -s -- -y
args: args:
creates: "{{ ansible_env.HOME }}/.config/starship.toml" # Adjust based on where starship installs creates: "{{ ansible_env.HOME }}/.config/starship.toml" # Adjust based on where starship installs
- name: Download EurKey deb - name: Download EurKey deb
get_url: ansible.builtin.get_url:
url: https://eurkey.steffen.bruentjen.eu/download/debian/eurkey.deb url: https://eurkey.steffen.bruentjen.eu/download/debian/eurkey.deb
dest: "/tmp/eurkey.deb" dest: "/tmp/eurkey.deb"
- name: Install EurKey - name: Install EurKey
apt: ansible.builtin.apt:
deb: "/tmp/eurkey.deb" deb: "/tmp/eurkey.deb"
state: present state: present
- name: Remove EurKey deb - name: Remove EurKey deb
file: ansible.builtin.file:
path: "/tmp/eurkey.deb" path: "/tmp/eurkey.deb"
state: absent state: absent
- name: Download Veracrypt deb - name: Download Veracrypt deb
get_url: ansible.builtin.get_url:
url: https://launchpad.net/veracrypt/trunk/1.26.14/+download/veracrypt-1.26.14-Debian-12-amd64.deb url: https://launchpad.net/veracrypt/trunk/1.26.14/+download/veracrypt-1.26.14-Debian-12-amd64.deb
dest: "/tmp/veracrypt.deb" dest: "/tmp/veracrypt.deb"
- name: Install Veracrypt - name: Install Veracrypt
apt: ansible.builtin.apt:
deb: "/tmp/veracrypt.deb" deb: "/tmp/veracrypt.deb"
state: present state: present
- name: Remove Veracrypt deb - name: Remove Veracrypt deb
file: ansible.builtin.file:
path: "/tmp/veracrypt.deb" path: "/tmp/veracrypt.deb"
state: absent state: absent