Files
Compose-Files/AnisiblePlaybooks/Playbooks/laptop/laptop.yml
T
2026-07-20 09:23:17 -04:00

93 lines
2.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
- hosts: localhost
connection: local
become: true
tasks:
# updates keyring to installs packages
- name: Update apt package index
ansible.builtin.apt:
update_cache: true
- name: Install prerequisites
ansible.builtin.apt:
name:
- software-properties-common
- apt-transport-https
state: present
- name: Add Mozilla gpg key
ansible.builtin.apt_key:
url: https://packages.mozilla.org/apt/repo-signing-key.gpg
state: present
- name: Add Mozilla repository
apt_repository:
repo: deb [arch=amd64] https://packages.mozilla.org/apt mozilla main
- name: Add VSCode gpg key
ansible.builtin.apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
state: present
- name: Add VSCode repository
apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
- name: Add Github gpg key
ansible.builtin.apt_key:
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
state: present
- name: Add Github repository
apt_repository:
repo: deb [arch=amd64] https://cli.github.com/packages stable main
# Need to find the latest version and replace 1.5.12 with it. However, this is not upgradable.
# Use only if needed.
- name: Install Obsidian
ansible.builtin.apt:
deb: "https://github.com/obsidianmd/obsidian-releases/releases/download/v1.5.12/obsidian_1.5.12_amd64.deb"
# curls the GitHub API for the latest release of the Obsidian official repo, parses the JSON to pick the url
# of the .deb package from a list of other package types, then downloads and installs the file from that url.
- name: Get Obsidian Releases
ansible.builtin.uri:
url: https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest
return_content: true
register: json_response
- name: Install Obsidian
ansible.builtin.apt:
deb: "{{ item.browser_download_url }}"
loop_control:
label: "{{ item.browser_download_url }}"
loop: "{{ json_response.json.assets }}"
when: item.browser_download_url is search("amd64.deb")
register: download_url
# Install packages using apt
- name: Install apt packages
ansible.builtin.apt:
state: present
update_cache: true
name:
- htop
- tree
- neofetch
- code
- firefox
- gh
- curl
- wireguard-tools
- wireguard
- qbittorrent
- terminator
- filezilla
- git-all
- stacer
- tor
- wget
- python3-pip
- ansible
- geany