Skip to content

Commit

Permalink
implement autologin
Browse files Browse the repository at this point in the history
  • Loading branch information
IamLunchbox committed May 16, 2024
1 parent fb738c9 commit 76c8fe4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
5 changes: 0 additions & 5 deletions ansible/roles/base/tasks/dotfiles.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: Generating non-root vars
ansible.builtin.setup:
register: setup_user
become: false

- name: Set dotfile type to empty string when it is not defined
ansible.builtin.set_fact:
system_purpose: ""
Expand Down
22 changes: 16 additions & 6 deletions ansible/roles/base/tasks/i3.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
---

- name: Add greeter
ansible.builtin.apt:
name:
- lightdm
- lightdm-gtk-greeter
state: present
notify: Set graphical target
when: >
('gdm3' not in ansible_facts['packages'] or
'sddm' not in ansible_facts['packages']) and
no_container_environment
block:
- name: Install lightdm
ansible.builtin.apt:
name:
- lightdm
- lightdm-gtk-greeter
state: present
notify: Set graphical target
- name: Enable autologin
ansible.builtin.template:
dest: /etc/lightdm/lightdm.conf.d/01_autologin.conf
src: etc/lightdm/lightdm.conf.d/01_autologin.conf.j2
owner: root
group: root
mode: '0644'
debugger: on_failed

- name: Install picom
ansible.builtin.apt:
Expand Down
7 changes: 6 additions & 1 deletion ansible/roles/base/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
loop_control:
loop_var: base_variables

- name: Generating non-root vars
ansible.builtin.setup:
register: setup_user
become: false

- name: Check installed packages
ansible.builtin.package_facts:
manager: auto
Expand Down Expand Up @@ -37,4 +42,4 @@
ansible.builtin.include_tasks: dotfiles.yaml

- name: Include system_specifics
ansible.builtin.include_tasks: "{{ system_purpose }}.yaml"
ansible.builtin.include_tasks: "{{ system_purpose }}.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[SeatDefaults]
autologin-user={{ setup_user['ansible_facts']['ansible_user_id'] }}

0 comments on commit 76c8fe4

Please sign in to comment.