refactor setup-autocall.yml

This commit is contained in:
Tomáš Mládek 2024-09-19 14:24:42 +02:00
parent 0e20540107
commit f2ee180967

View file

@ -57,48 +57,32 @@
owner: "{{ ansible_user }}" owner: "{{ ansible_user }}"
mode: "0755" mode: "0755"
- name: Symlink parsifal.service to systemd user directory - name: Symlink all service files
file: file:
src: "/home/{{ ansible_user }}/parsifal/parsifal.service" src: "/home/{{ ansible_user }}/parsifal/{{ item }}"
dest: "/home/{{ ansible_user }}/.config/systemd/user/parsifal.service" dest: "/home/{{ ansible_user }}/.config/systemd/user/{{ item }}"
state: link state: link
loop:
- parsifal.service
- unclutter.service
- x11vnc.service
- name: Symlink unclutter.service to systemd user directory - name: Reload systemd user service
file:
src: "/home/{{ ansible_user }}/parsifal/unclutter.service"
dest: "/home/{{ ansible_user }}/.config/systemd/user/unclutter.service"
state: link
- name: Symlink x11vnc.service to systemd user directory
file:
src: "/home/{{ ansible_user }}/parsifal/x11vnc.service"
dest: "/home/{{ ansible_user }}/.config/systemd/user/x11vnc.service"
state: link
- name: Reload systemd for the current user
command: systemctl --user daemon-reload
become: yes become: yes
become_user: "{{ ansible_user }}" become_user: "{{ ansible_user }}"
environment: systemd:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user daemon_reload: yes
scope: user
- name: Enable and start the Parsifal service - name: Enable and start all services
command: systemctl --user enable --now parsifal
become: yes become: yes
become_user: "{{ ansible_user }}" become_user: "{{ ansible_user }}"
environment: systemd:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user name: "{{ item }}"
enabled: yes
- name: Enable and start the Unclutter service state: started
command: systemctl --user enable --now unclutter scope: user
become: yes loop:
become_user: "{{ ansible_user }}" - parsifal
environment: - unclutter
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user - x11vnc
- name: Enable and start the x11vnc service
command: systemctl --user enable --now x11vnc
become: yes
become_user: "{{ ansible_user }}"
environment:
XDG_RUNTIME_DIR: "/run/user/{{ ansible_user_uid }}" # Needed for running systemctl --user