diff --git a/defaults/main.yml b/defaults/main.yml index 9f47f4b..3b9aee0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,7 @@ display_manager_state: multiuser -display_manager_mainentance_text: Wartungsmodus – bitte nicht abschalten! -display_manager_mainentance_icon: preferences-system +display_manager_maintenance_text: Wartungsmodus – bitte nicht abschalten! +display_manager_maintenance_icon: preferences-system display_manager_background_image: Hubble2005-01-barred-spiral-galaxy-NGC1300.jpg # source: https://upload.wikimedia.org/wikipedia/commons/5/52/Hubble2005-01-barred-spiral-galaxy-NGC1300.jpg diff --git a/tasks/cleanup-litter.yaml b/tasks/cleanup-litter.yaml new file mode 100644 index 0000000..ad3c8f2 --- /dev/null +++ b/tasks/cleanup-litter.yaml @@ -0,0 +1,17 @@ +--- + +# to be removed when roled out +- name: remove wrong "mainentance" directory + file: + path: /usr/local/share/mainentance + state: absent + +- name: remove wrong "mainentance" user + user: + name: mainentance + state: absent + +- name: remove wrong "mainentance" user home directory + file: + path: /var/lib/mainentance + state: absent diff --git a/tasks/main.yml b/tasks/main.yml index 2b2d0e0..e0291c7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,8 +24,8 @@ - onboard notify: restart lightdm -- include: mainentance.yml - when: display_manager_state == 'mainentance' +- import_tasks: maintenance.yml + when: display_manager_state == 'maintenance' - name: lightdm configuration template: @@ -64,3 +64,5 @@ enabled: yes - meta: flush_handlers + +- import_tasks: cleanup-litter.yaml diff --git a/tasks/mainentance.yml b/tasks/mainentance.yml deleted file mode 100644 index 3971da3..0000000 --- a/tasks/mainentance.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- - -- name: install mainentance mode packages - apt: - pkg: "{{ item }}" - state: installed - with_items: - - yad - - xbindkeys - - feh - notify: restart lightdm - -- name: mainentance user - user: - name: mainentance - system: yes - createhome: yes - home: /var/lib/mainentance - notify: restart lightdm - -- name: mainentance directory - file: - path: /usr/local/share/mainentance - state: directory - notify: restart lightdm - -- name: mainentance xsession desktop - template: - src: mainentance.desktop.j2 - dest: /usr/local/share/mainentance/mainentance.desktop - notify: restart lightdm - -- name: mainentance xsession script - template: - src: mainentance-xsession.sh.j2 - dest: /usr/local/share/mainentance/xsession - mode: u=rwx,g=rx,o=rx - notify: restart lightdm - -- name: mainentance xbindkeys - template: - src: mainentance.xbindkeys.j2 - dest: /usr/local/share/mainentance/xbindkeys - notify: restart lightdm diff --git a/tasks/maintenance.yml b/tasks/maintenance.yml new file mode 100644 index 0000000..3466a71 --- /dev/null +++ b/tasks/maintenance.yml @@ -0,0 +1,44 @@ +--- + +- name: install maintenance mode packages + apt: + pkg: "{{ item }}" + state: installed + with_items: + - yad + - xbindkeys + - feh + notify: restart lightdm + +- name: maintenance user + user: + name: maintenance + system: yes + createhome: yes + home: /var/lib/maintenance + notify: restart lightdm + +- name: maintenance directory + file: + path: /usr/local/share/maintenance + state: directory + notify: restart lightdm + +- name: maintenance xsession desktop + template: + src: maintenance.desktop.j2 + dest: /usr/local/share/maintenance/maintenance.desktop + notify: restart lightdm + +- name: maintenance xsession script + template: + src: maintenance-xsession.sh.j2 + dest: /usr/local/share/maintenance/xsession + mode: u=rwx,g=rx,o=rx + notify: restart lightdm + +- name: maintenance xbindkeys + template: + src: maintenance.xbindkeys.j2 + dest: /usr/local/share/maintenance/xbindkeys + notify: restart lightdm diff --git a/templates/lightdm.conf.j2 b/templates/lightdm.conf.j2 index 6fb4a07..398e00f 100644 --- a/templates/lightdm.conf.j2 +++ b/templates/lightdm.conf.j2 @@ -20,8 +20,8 @@ # backup-logs = True to move add a .old suffix to old log files when opening new ones # [LightDM] -{% if display_manager_state == "mainentance" %} -sessions-directory=/usr/local/share/mainentance +{% if display_manager_state == "maintenance" %} +sessions-directory=/usr/local/share/maintenance {% endif %} # @@ -76,10 +76,10 @@ sessions-directory=/usr/local/share/mainentance [Seat:*] greeter-session=lightdm-gtk-greeter -{% if display_manager_state == "mainentance" %} -autologin-user=mainentance +{% if display_manager_state == "maintenance" %} +autologin-user=maintenance autologin-user-timeout=0 -user-session=mainentance +user-session=maintenance {% endif %} {% if display_setup_commands is defined %} diff --git a/templates/mainentance.desktop.j2 b/templates/mainentance.desktop.j2 deleted file mode 100644 index e7b7fb5..0000000 --- a/templates/mainentance.desktop.j2 +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=mainentance -Comment=mainentance xsession -Exec=/usr/local/share/mainentance/xsession -Type=Application -X-LightDM-DesktopName=mainentance -DesktopNames=mainentance -Keywords=wm;windowmanager;window;manager; diff --git a/templates/mainentance-xsession.sh.j2 b/templates/maintenance-xsession.sh.j2 similarity index 55% rename from templates/mainentance-xsession.sh.j2 rename to templates/maintenance-xsession.sh.j2 index e88b2a9..81c5f4c 100644 --- a/templates/mainentance-xsession.sh.j2 +++ b/templates/maintenance-xsession.sh.j2 @@ -3,5 +3,5 @@ xset -dpms xset s off feh --bg-scale "{{display_manager_background_image_path}}" -xbindkeys -f /usr/local/share/mainentance/xbindkeys & -exec yad --no-buttons --no-escape --image-on-top --center --borders 50 --image="{{display_manager_mainentance_icon}}" --text="{{display_manager_mainentance_text}}" +xbindkeys -f /usr/local/share/maintenance/xbindkeys & +exec yad --no-buttons --no-escape --image-on-top --center --borders 50 --image="{{display_manager_maintenance_icon}}" --text="{{display_manager_maintenance_text}}" diff --git a/templates/maintenance.desktop.j2 b/templates/maintenance.desktop.j2 new file mode 100644 index 0000000..f42e19d --- /dev/null +++ b/templates/maintenance.desktop.j2 @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=maintenance +Comment=maintenance xsession +Exec=/usr/local/share/maintenance/xsession +Type=Application +X-LightDM-DesktopName=maintenance +DesktopNames=maintenance +Keywords=wm;windowmanager;window;manager; diff --git a/templates/mainentance.xbindkeys.j2 b/templates/maintenance.xbindkeys.j2 similarity index 100% rename from templates/mainentance.xbindkeys.j2 rename to templates/maintenance.xbindkeys.j2