Collect some general tasks from other roles into role_misc

Control execution of task by variables with defaults.
This commit is contained in:
Raphael Dannecker 2025-03-26 14:44:19 +01:00
parent a8736395c8
commit 5b19a529f2
14 changed files with 659 additions and 612 deletions

View file

@ -139,49 +139,6 @@
"ProxyMode": "auto_detect"
}
- name: Update all packages unattended
ansible.builtin.replace:
path: /etc/apt/apt.conf.d/50unattended-upgrades
regexp: '^//(\s+"origin=.+-updates";)$'
replace: ' \1'
- name: Copy some scripts
ansible.builtin.copy:
src: "{{ item }}"
dest: /usr/local/sbin/
mode: '0755'
loop:
- pwroff
- bootorder.sh
- reporter
- name: Provide services and timers for some scripts
ansible.builtin.copy:
src: "{{ item }}"
dest: "/etc/systemd/system/{{ item }}"
mode: '0644'
loop:
- pwroff.service
- pwroff.timer
- reporter.service
- reporter.timer
when: "'teacherlaptop' not in group_names"
- name: Enable pwroff.timer
ansible.builtin.systemd:
name: "{{ item }}"
enabled: true
loop:
- pwroff.timer
- reporter.timer
when: "'teacherlaptop' not in group_names"
- name: PXE first boot order
ansible.builtin.command: /usr/local/sbin/bootorder.sh
register: cmd_result
changed_when: cmd_result.stdout is not search('Nothing to do.')
when: "'PCroom' in group_names"
- name: Copy dolphin config scripts
ansible.builtin.copy:
src: "{{ item }}"