2024-02-25 20:30:31 +01:00
|
|
|
- name: Create group for sudoers config
|
|
|
|
become: yes
|
|
|
|
group:
|
|
|
|
name: admins
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add user to group for sudoers config
|
|
|
|
become: yes
|
|
|
|
user:
|
|
|
|
append: true
|
|
|
|
name: "{{ ansible_user_id }}"
|
|
|
|
groups:
|
|
|
|
- admins
|
|
|
|
|
|
|
|
- name: Create sudoers config
|
|
|
|
become: yes
|
|
|
|
community.general.sudoers:
|
|
|
|
name: desktop-environment
|
|
|
|
group: admins
|
|
|
|
nopassword: true
|
|
|
|
commands:
|
|
|
|
- "/usr/bin/systemctl poweroff"
|
|
|
|
- "/usr/bin/systemctl reboot"
|
|
|
|
- "/usr/bin/systemctl suspend"
|
|
|
|
|
|
|
|
- name: Copy static config files
|
|
|
|
copy:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
loop:
|
|
|
|
- src: "{{ role_path }}/files/.config"
|
|
|
|
dest: "{{ ansible_env.HOME }}/"
|
|
|
|
|
|
|
|
- name: Ensure presence of required directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
recurse: yes
|
|
|
|
state: directory
|
|
|
|
loop:
|
|
|
|
- "{{ ansible_env.HOME }}/.config/hypr"
|
|
|
|
- "{{ ansible_env.HOME }}/.config/waybar"
|
2024-05-27 20:57:26 +02:00
|
|
|
- "{{ ansible_env.HOME }}/.local/bin"
|
2024-02-25 20:30:31 +01:00
|
|
|
|
|
|
|
- name: Render config files
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
loop:
|
|
|
|
- src: "bash_profile.j2"
|
|
|
|
dest: "{{ ansible_env.HOME }}/.bash_profile"
|
|
|
|
- src: ".config/hypr/hyprland.conf.j2"
|
|
|
|
dest: "{{ ansible_env.HOME }}/.config/hypr/hyprland.conf"
|
|
|
|
- src: ".config/waybar/config.j2"
|
2024-05-27 20:57:26 +02:00
|
|
|
dest: "{{ ansible_env.HOME }}/.config/waybar/config"
|
|
|
|
- src: ".local/bin/hyprhelpr.j2"
|
|
|
|
dest: "{{ ansible_env.HOME }}/.local/bin/hyprhelpr"
|
|
|
|
|
|
|
|
- name: Make "~/.local/bin/hyprhelpr" executable
|
|
|
|
ansible.builtin.file:
|
|
|
|
dest: "{{ ansible_env.HOME }}/.local/bin/hyprhelpr"
|
2024-05-27 23:46:38 +02:00
|
|
|
mode: "ug+x"
|