79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
- name: Deploy Sway Configuration
|
|
hosts: localhost
|
|
connection: local
|
|
become: true # Run the entire playbook with elevated privileges
|
|
|
|
vars:
|
|
target_user: jonnybravo
|
|
|
|
tasks:
|
|
- name: Install required packages for Arch Linux
|
|
tags: install_packages
|
|
community.general.pacman:
|
|
name:
|
|
- sway
|
|
- waybar
|
|
- wofi
|
|
- alacritty
|
|
- swaylock
|
|
- swayidle
|
|
- mako
|
|
- kanshi
|
|
- wl-clipboard
|
|
- brightnessctl
|
|
- grim
|
|
- slurp
|
|
- playerctl
|
|
- qalculate-gtk
|
|
- tmux
|
|
state: present
|
|
|
|
- name: Ensure .config directory exists for target user
|
|
ansible.builtin.file:
|
|
path: "/home/{{ target_user }}/.config"
|
|
state: directory
|
|
owner: "{{ target_user }}"
|
|
group: "{{ target_user }}"
|
|
mode: '0755'
|
|
|
|
- name: Ensure .config subdirectories exist
|
|
ansible.builtin.file:
|
|
path: "/home/{{ target_user }}/.config/{{ item }}"
|
|
state: directory
|
|
owner: "{{ target_user }}"
|
|
group: "{{ target_user }}"
|
|
mode: '0755'
|
|
loop:
|
|
- sway
|
|
- waybar
|
|
- mako
|
|
- wofi
|
|
- alacritty
|
|
- kanshi
|
|
|
|
- name: Copy all config files
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/config/{{ item.path }}"
|
|
dest: "/home/{{ target_user }}/.config/{{ item.path }}"
|
|
owner: "{{ target_user }}"
|
|
group: "{{ target_user }}"
|
|
mode: '0644'
|
|
loop:
|
|
- { path: 'sway/config' }
|
|
- { path: 'waybar/config' }
|
|
- { path: 'waybar/style.css' }
|
|
- { path: 'mako/config' }
|
|
- { path: 'wofi/config' }
|
|
- { path: 'alacritty/alacritty.toml' }
|
|
- { path: 'alacritty/alacritty.yml' }
|
|
- { path: 'alacritty/catppuccin-mocha.toml' }
|
|
- { path: 'kanshi/config' }
|
|
|
|
- name: Copy Tmux config to home directory
|
|
ansible.builtin.copy:
|
|
src: "{{ playbook_dir }}/.tmux.conf"
|
|
dest: "/home/{{ target_user }}/.tmux.conf"
|
|
owner: "{{ target_user }}"
|
|
group: "{{ target_user }}"
|
|
mode: '0644'
|