From 1e066fe8d9ef283d45ec49c5083af8033b9882ce Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 8 Nov 2019 12:51:20 +0100 Subject: [PATCH] add custom systemd unit --- meta/main.yml | 2 +- tasks/install.yml | 6 ++++++ .../system/org.cups.cupsd.service.service.j2 | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 templates/etc/systemd/system/org.cups.cupsd.service.service.j2 diff --git a/meta/main.yml b/meta/main.yml index ffbc642..4c01cf6 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -4,7 +4,7 @@ galaxy_info: # @meta author:value: [xoxys](https://gitea.rknet.org/xoxys) author: xoxys description: Setup cups printserver - license: Robert Kaussow + license: MIT min_ansible_version: 2.6 platforms: - name: EL diff --git a/tasks/install.yml b/tasks/install.yml index cf7a20d..c3de440 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -31,5 +31,11 @@ module_arguments: "{{ item.arguments | default(omit) }}" new_module_path: "{{ item.new_module }}" loop: "{{ __pam_config }}" + + - name: Replace default systemd unit + template: + src: "etc/systemd/system/org.cups.cupsd.service.service.j2" + dest: "/etc/systemd/system/org.cups.cupsd.service.service" + notify: __cupsd_restart become: True become_user: root diff --git a/templates/etc/systemd/system/org.cups.cupsd.service.service.j2 b/templates/etc/systemd/system/org.cups.cupsd.service.service.j2 new file mode 100644 index 0000000..e84694b --- /dev/null +++ b/templates/etc/systemd/system/org.cups.cupsd.service.service.j2 @@ -0,0 +1,16 @@ +#jinja2: lstrip_blocks: True +{{ ansible_managed | comment }} +[Unit] +Description=CUPS Scheduler +Documentation=man:cupsd(8) +After=sssd.service network.target +Wants=network.target + +[Service] +ExecStart=/usr/sbin/cupsd -l +Type=simple +Restart=on-failure + +[Install] +Also=org.cups.cupsd.socket org.cups.cupsd.path +WantedBy=printer.target