1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-14 20:22:08 +00:00

Clean up roles/network/tasks/netwarn.yml

This commit is contained in:
root 2022-07-21 19:53:37 +00:00
parent 42b5b766c4
commit 44af07638b

View file

@ -1,26 +1,3 @@
# mate desktop detection based on 'register: nd_dir' in enable_services
- name: Does /usr/share/mate/autostart/ exist?
stat:
path: /usr/share/mate/autostart/
register: mate_dir
# contents work with mate as of 'switch to using dash via sh'
# 'text' is up for debate other structural changes I do not recommend JV
- name: 'Install from template: /usr/local/sbin/netwarn'
file:
src: netwarn/netwarn
dest: /usr/local/sbin/
mode: 0755
when: mate_dir.stat.exists and mate_dir.stat.isdir
- name: 'Install from template: /usr/share/mate/autostart/netwarn-iiab-network.desktop'
file:
src: netwarn/netwarn-iiab-network.desktop
dest: /usr/share/mate/autostart/
when: mate_dir.stat.exists and mate_dir.stat.isdir
- name: Does /etc/xdg/lxsession/LXDE-pi/autostart exist?
stat:
path: /etc/xdg/lxsession/LXDE-pi/autostart
@ -34,4 +11,30 @@
when: lxde_pi_autostart_present.stat.exists
# mate desktop detection based on 'register: nd_dir' in enable_services
- name: Does /usr/share/mate/autostart/ exist?
stat:
path: /usr/share/mate/autostart/
register: mate_dir
# contents work with mate as of 'switch to using dash via sh'
# 'text' is up for debate other structural changes I do not recommend JV
- name: 'Install from template: /usr/share/mate/autostart/netwarn-iiab-network.desktop'
template:
src: netwarn/netwarn-iiab-network.desktop
dest: /usr/share/mate/autostart/
when: mate_dir.stat.exists and mate_dir.stat.isdir
# 2022-07-21: Is autostart pop-up logic for Mint & stock Ubuntu much the same?
# (Let's insert those here if so, and refine the 'when:' line below.)
- name: 'If a supported graphical OS is detected, install from template: /usr/local/sbin/netwarn'
template:
src: netwarn/netwarn
dest: /usr/local/sbin/
mode: 0755
when: lxde_pi_autostart_present or (mate_dir.stat.exists and mate_dir.stat.isdir)