dotfiles/bootstrap.yml

120 lines
3.7 KiB
YAML

- name: Bootstrap dotfile and depencies
hosts: localhost
vars:
dconf_tilix: "{{ lookup('file', '.dconf/Tilix.dconf') }}"
dconf_gnome_mk: "{{ lookup('file', '.dconf/MediaKeys.dconf') }}"
dconf_gnome_mutter: "{{ lookup('file', '.dconf/Mutter.dconf') }}"
dconf_gnome_mutter_w: "{{ lookup('file', '.dconf/MutterWayland.dconf') }}"
dconf_gnome_shell: "{{ lookup('file', '.dconf/Shell.dconf') }}"
dconf_gnome_wm: "{{ lookup('file', '.dconf/WindowManager.dconf') }}"
dconf_gnome_forge: "{{ lookup('file', '.dconf/Forge.dconf') }}"
tasks:
- name: Full system upgrade
become: true
community.general.pacman:
update_cache: true
upgrade: true
- name: Install yay dependencies
become: true
community.general.pacman:
state: present
name:
- git
- base-devel
- name: Clone yay
git:
repo: https://aur.archlinux.org/yay.git
dest: "/tmp/yay"
update: true
- name: Build and install yay
command:
chdir: "/tmp/yay"
cmd: "makepkg -sfi --noconfirm"
creates: /usr/bin/yay
- name: Install standard dependencies
become: True
community.general.pacman:
state: present
name:
- zsh
- vim
- ttf-meslo-nerd
- tilix
- name: Check install packages (for later use with yay)
ansible.builtin.command: pacman -Qm
register: installed_packages
- name: "Install package"
become: false
ansible.builtin.command: "yay --noconfirm --noprogressbar --needed --sync {{ item }}"
when: item not in installed_packages.stdout
with_items:
- find-the-command
- oh-my-posh
- archey4
- find-the-command
- name: Install oh-my-posh config
copy:
src: "{{playbook_dir}}/.ohmyposh/"
dest: ~/.ohmyposh/
- name: Install oh-my-posh config for root
become: true
copy:
src: "{{playbook_dir}}/.ohmyposh/"
dest: /root/.ohmyposh/
- name: Install bashrc
copy:
src: "{{playbook_dir}}/.bashrc"
dest: ~/.bashrc
- name: Install bashrc for root
become: true
copy:
src: "{{playbook_dir}}/.bashrc"
dest: /root/.bashrc
- name: Install zshrc
copy:
src: "{{playbook_dir}}/.zshrc"
dest: ~/.zshrc
- name: Install zshrc for root
become: true
copy:
src: "{{playbook_dir}}/.zshrc"
dest: /root/.zshrc
- name: Reset tilix config
community.general.dconf:
key: "/com/gexperts/Tilix"
state: absent
- name: Import tilix config
ansible.builtin.command: "dconf load /com/gexperts/Tilix/"
args:
stdin: "{{dconf_tilix}}"
- name: Install fancy helper scripts
become: true
copy:
src: "{{playbook_dir}}/.scripts/"
dest: /opt
mode: '0755'
- name: Import Gnome MediaKey Shortcuts
ansible.builtin.command: "dconf load /org/gnome/settings-daemon/plugins/media-keys/"
args:
stdin: "{{dconf_gnome_mk}}"
- name: Import Gnome Mutter Shortcuts
ansible.builtin.command: "dconf load /org/gnome/mutter/keybindings/"
args:
stdin: "{{dconf_gnome_mutter}}"
- name: Import Gnome Mutter Wayland Shortcuts
ansible.builtin.command: "dconf load /org/gnome/mutter/wayland/keybindings/"
args:
stdin: "{{dconf_gnome_mutter_w}}"
- name: Import Gnome Shell Shortcuts
ansible.builtin.command: "dconf load /org/gnome/shell/keybindings/"
args:
stdin: "{{dconf_gnome_shell}}"
- name: Import Gnome Window Manager Shortcuts
ansible.builtin.command: "dconf load /org/gnome/desktop/wm/keybindings/"
args:
stdin: "{{dconf_gnome_wm}}"
- name: Import Gnome Extension Forge
ansible.builtin.command: "dconf load /org/gnome/shell/extensions/forge/keybindings/"
args:
stdin: "{{dconf_gnome_forge}}"