update ansible files
This commit is contained in:
@@ -1 +1,4 @@
|
|||||||
ansible
|
ansible
|
||||||
|
Makefile
|
||||||
|
ansible.cfg
|
||||||
|
inventory
|
||||||
|
|||||||
3
ansible.cfg
Normal file
3
ansible.cfg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[defaults]
|
||||||
|
localhost_warning=false
|
||||||
|
inventory = inventory
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
- name: set gnome config
|
|
||||||
become_user: user
|
|
||||||
dconf:
|
|
||||||
key: "{{ item.key }}"
|
|
||||||
value: "{{ item.value }}"
|
|
||||||
with_items: "{{ dconf }}"
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
- name: Load a variable file based on the OS type
|
|
||||||
include_vars: "{{ item }}"
|
|
||||||
with_first_found:
|
|
||||||
- "vars/defaults.yml"
|
|
||||||
|
|
||||||
- name:
|
|
||||||
include_tasks: "defaults.yml"
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
dconf:
|
|
||||||
# - {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings', value: "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"}
|
|
||||||
# - {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding', value: "'<Super>t'"}
|
|
||||||
# - {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command', value: "'terminator'"}
|
|
||||||
# - {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name', value: "'Terminator'"}
|
|
||||||
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings', value: "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/']"}
|
|
||||||
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding', value: "'<Super>w'"}
|
|
||||||
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command', value: "'flatpak run io.gitlab.librewolf-community'"}
|
|
||||||
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name', value: "'Librewolf'"}
|
|
||||||
- {key: '/org/gnome/desktop/background/picture-uri', value: "'file://${HOME}/.config/ansible/roles/customize/files/wallpaper.png'"}
|
|
||||||
- {key: '/org/gnome/desktop/background/picture-uri-dark', value: "'file://${HOME}/.config/ansible/roles/customize/files/wallpaper.png'"}
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
|
become: true
|
||||||
# vars_prompt:
|
# vars_prompt:
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
- packages
|
||||||
- customize
|
- customize
|
||||||
|
Before Width: | Height: | Size: 362 KiB After Width: | Height: | Size: 362 KiB |
29
ansible/roles/customize/tasks/defaults.yml
Normal file
29
ansible/roles/customize/tasks/defaults.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
- name: install fonts
|
||||||
|
include_tasks: "./scripts/install_fonts.yml"
|
||||||
|
|
||||||
|
- name: set gnome config
|
||||||
|
become_user: user
|
||||||
|
dconf:
|
||||||
|
key: "{{ item.key }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
|
with_items: "{{ dconf }}"
|
||||||
|
when: dconf is defined
|
||||||
|
|
||||||
|
- user:
|
||||||
|
name: "user"
|
||||||
|
shell: /usr/bin/zsh
|
||||||
|
|
||||||
|
- name: Create bin folder
|
||||||
|
become_user: user
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: ~/.local/bin
|
||||||
|
owner: "user"
|
||||||
|
group: "user"
|
||||||
|
mode: '0770'
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: run stow
|
||||||
|
become_user: user
|
||||||
|
shell: "stow --adopt ."
|
||||||
|
args:
|
||||||
|
chdir: ~/.dotfiles
|
||||||
11
ansible/roles/customize/tasks/main.yml
Normal file
11
ansible/roles/customize/tasks/main.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
- name: Load a variable file
|
||||||
|
include_vars: "{{ item }}"
|
||||||
|
with_first_found:
|
||||||
|
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
|
||||||
|
- "vars/{{ ansible_distribution }}.yml"
|
||||||
|
- "vars/{{ ansible_os_family }}.yml"
|
||||||
|
- "vars/defaults.yml"
|
||||||
|
|
||||||
|
- name:
|
||||||
|
include_tasks: "defaults.yml"
|
||||||
|
|
||||||
11
ansible/roles/customize/vars/Pop!_OS-22.04.yml
Normal file
11
ansible/roles/customize/vars/Pop!_OS-22.04.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
dconf:
|
||||||
|
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings', value: "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/']"}
|
||||||
|
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding', value: "'<Super>t'"}
|
||||||
|
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command', value: "'terminator'"}
|
||||||
|
- {key: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name', value: "'Terminator'"}
|
||||||
|
- {key: '/org/gnome/desktop/background/picture-uri', value: "'file://${HOME}/.config/ansible/roles/customize/files/wallpaper.png'"}
|
||||||
|
- {key: '/org/gnome/desktop/background/picture-uri-dark', value: "'file://${HOME}/.config/ansible/roles/customize/files/wallpaper.png'"}
|
||||||
|
|
||||||
|
fonts:
|
||||||
|
- {name: 'GoMonoNerd', url: "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/Go-Mono.zip"}
|
||||||
|
- {name: 'FiraCodeNerd', url: "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/FiraCode.zip"}
|
||||||
8
ansible/roles/packages/tasks/defaults.yml
Normal file
8
ansible/roles/packages/tasks/defaults.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- name: install apt
|
||||||
|
include_tasks: "./scripts/install_apt.yml"
|
||||||
|
|
||||||
|
- name: install flatpak
|
||||||
|
include_tasks: "./scripts/install_flatpak.yml"
|
||||||
|
|
||||||
|
- name: install brew
|
||||||
|
include_tasks: "./scripts/install_brew.yml"
|
||||||
11
ansible/roles/packages/tasks/main.yml
Normal file
11
ansible/roles/packages/tasks/main.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
- name: Load a variable file
|
||||||
|
include_vars: "{{ item }}"
|
||||||
|
with_first_found:
|
||||||
|
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
|
||||||
|
- "vars/{{ ansible_distribution }}.yml"
|
||||||
|
- "vars/{{ ansible_os_family }}.yml"
|
||||||
|
- "vars/defaults.yml"
|
||||||
|
|
||||||
|
- name:
|
||||||
|
include_tasks: "defaults.yml"
|
||||||
|
|
||||||
29
ansible/roles/packages/vars/Pop!_OS-22.04.yml
Normal file
29
ansible/roles/packages/vars/Pop!_OS-22.04.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
install_homebrew_if_missing: true
|
||||||
|
|
||||||
|
required_packages_brew:
|
||||||
|
- lazygit
|
||||||
|
- fzf
|
||||||
|
- glab
|
||||||
|
- go
|
||||||
|
- neovim
|
||||||
|
- oh-my-posh
|
||||||
|
- tpm
|
||||||
|
- terraform
|
||||||
|
- kubernetes-cli
|
||||||
|
- zsh-autosuggestions
|
||||||
|
|
||||||
|
apt_keys:
|
||||||
|
- https://packages.microsoft.com/keys/microsoft.asc
|
||||||
|
apt_repo:
|
||||||
|
- deb [arch=amd64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main
|
||||||
|
|
||||||
|
required_packages_apt:
|
||||||
|
- powershell
|
||||||
|
- curl
|
||||||
|
|
||||||
|
flatpak_remote:
|
||||||
|
- {name: 'flathub', url: "https://dl.flathub.org/repo/flathub.flatpakrepo"}
|
||||||
|
|
||||||
|
required_packages_flatpak:
|
||||||
|
- VSCodium
|
||||||
|
|
||||||
28
ansible/scripts/install_apt.yml
Normal file
28
ansible/scripts/install_apt.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
- name: add apt repository key
|
||||||
|
apt_key:
|
||||||
|
url: "{{ item }}"
|
||||||
|
with_items: "{{ apt_keys }}"
|
||||||
|
become: yes
|
||||||
|
when: apt_keys is defined
|
||||||
|
|
||||||
|
- name: add apt repository
|
||||||
|
apt_repository:
|
||||||
|
repo: "{{ item }}"
|
||||||
|
with_items: "{{ apt_repo }}"
|
||||||
|
become: yes
|
||||||
|
when: apt_repo is defined
|
||||||
|
|
||||||
|
- name: Upgrade Packages
|
||||||
|
package:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: safe
|
||||||
|
become: yes
|
||||||
|
when: required_packages_apt is defined
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
apt:
|
||||||
|
state: latest
|
||||||
|
update_cache: yes
|
||||||
|
pkg: "{{ required_packages_apt }}"
|
||||||
|
become: yes
|
||||||
|
when: required_packages_apt is defined
|
||||||
39
ansible/scripts/install_brew.yml
Normal file
39
ansible/scripts/install_brew.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
- name: Ensuring Homebrew Is Installed
|
||||||
|
stat:
|
||||||
|
path: /home/linuxbrew/.linuxbrew/bin/
|
||||||
|
register: homebrew_check
|
||||||
|
|
||||||
|
- name: Fail If Homebrew Is Not Installed and install_homebrew_if_missing Is False
|
||||||
|
fail:
|
||||||
|
msg: Homebrew is missing, install from http://brew.sh
|
||||||
|
when:
|
||||||
|
- not homebrew_check.stat.exists
|
||||||
|
- not install_homebrew_if_missing
|
||||||
|
|
||||||
|
- name: Installing Homebrew
|
||||||
|
become_user: user
|
||||||
|
shell: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
when:
|
||||||
|
- not homebrew_check.stat.exists
|
||||||
|
- install_homebrew_if_missing
|
||||||
|
|
||||||
|
- name: Install Brew Taps
|
||||||
|
become_user: user
|
||||||
|
community.general.homebrew_tap:
|
||||||
|
name: "{{ item }}"
|
||||||
|
with_items: "{{ required_taps }}"
|
||||||
|
when: required_taps is defined
|
||||||
|
|
||||||
|
- name: Install Brew Casks
|
||||||
|
become_user: user
|
||||||
|
community.general.homebrew_cask:
|
||||||
|
name: "{{ item }}"
|
||||||
|
with_items: "{{ required_packages_casks }}"
|
||||||
|
when: required_packages_casks is defined
|
||||||
|
|
||||||
|
- name: Install Brew Packages
|
||||||
|
become_user: user
|
||||||
|
community.general.homebrew:
|
||||||
|
name: "{{ item }}"
|
||||||
|
with_items: "{{ required_packages_brew }}"
|
||||||
|
when: required_packages_brew is defined
|
||||||
22
ansible/scripts/install_flatpak.yml
Normal file
22
ansible/scripts/install_flatpak.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
- name: configure flatpak
|
||||||
|
become_user: user
|
||||||
|
community.general.flatpak_remote:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
state: present
|
||||||
|
flatpakrepo_url: "{{ item.url }}"
|
||||||
|
with_items: "{{ flatpak_remote }}"
|
||||||
|
when: flatpak_remote is defined
|
||||||
|
|
||||||
|
- name: update flatpaks
|
||||||
|
become_user: user
|
||||||
|
shell:
|
||||||
|
cmd: flatpak update --noninteractive
|
||||||
|
when: required_packages_flatpak is defined
|
||||||
|
|
||||||
|
- name: install flatpak
|
||||||
|
become_user: user
|
||||||
|
community.general.flatpak:
|
||||||
|
name: "{{ item }}"
|
||||||
|
with_items: "{{ required_packages_flatpak }}"
|
||||||
|
when: required_packages_flatpak is defined
|
||||||
|
ignore_errors: yes
|
||||||
23
ansible/scripts/install_fonts.yml
Normal file
23
ansible/scripts/install_fonts.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
- name: ensure fonts directory
|
||||||
|
become_user: user
|
||||||
|
file:
|
||||||
|
path: "~/.fonts"
|
||||||
|
state: directory
|
||||||
|
when: fonts is defined
|
||||||
|
|
||||||
|
- name: Ensuring Fonts Exists
|
||||||
|
become_user: user
|
||||||
|
shell: "ls ~/.fonts/*{{ item.name }}*"
|
||||||
|
register: fonts_exist
|
||||||
|
ignore_errors: yes
|
||||||
|
with_items: "{{ fonts }}"
|
||||||
|
when: fonts is defined
|
||||||
|
|
||||||
|
- name: Download Fonts
|
||||||
|
when: fonts_exist is failed
|
||||||
|
become_user: user
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
src: "{{ item.url }}"
|
||||||
|
dest: "~/.fonts/"
|
||||||
|
remote_src: yes
|
||||||
|
with_items: "{{ fonts }}"
|
||||||
Reference in New Issue
Block a user