mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-25 07:27:23 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| ---
 | |
| - name: "pkgmgr install"
 | |
|   include_role:
 | |
|     name: pkgmgr-install
 | |
|   vars:
 | |
|     package_name: setup-hibernate
 | |
| 
 | |
| - name: Setup hibernate
 | |
|   command: setup-hibernate --non-interactive
 | |
|   become: true
 | |
| 
 | |
| - name: Configure systemd lid switch behavior to hibernate on lid close (battery), lock on AC and docked
 | |
|   become: true
 | |
|   lineinfile:
 | |
|     path: /etc/systemd/logind.conf
 | |
|     regexp: '^#?HandleLidSwitch='
 | |
|     line: 'HandleLidSwitch=hibernate'
 | |
|     backup: yes
 | |
|   notify: Restart systemd-logind
 | |
|   become: true
 | |
| 
 | |
| - name: Configure systemd to lock session when lid is closed on external power
 | |
|   become: true
 | |
|   lineinfile:
 | |
|     path: /etc/systemd/logind.conf
 | |
|     regexp: '^#?HandleLidSwitchExternalPower='
 | |
|     line: 'HandleLidSwitchExternalPower=lock'
 | |
|     backup: yes
 | |
|   notify: Restart systemd-logind
 | |
|   become: true
 | |
| 
 | |
| - name: Configure systemd to lock session when lid is closed while docked
 | |
|   become: true
 | |
|   lineinfile:
 | |
|     path: /etc/systemd/logind.conf
 | |
|     regexp: '^#?HandleLidSwitchDocked='
 | |
|     line: 'HandleLidSwitchDocked=lock'
 | |
|     backup: yes
 | |
|   notify: Restart systemd-logind
 | |
|   become: true |