cleanup configs
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Robert Kaussow 2021-11-28 20:45:32 +01:00
parent a067372ccd
commit c3c4cec341
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
10 changed files with 32 additions and 36 deletions

View File

@ -1,5 +1,5 @@
---
cups_version: 2.3.1
cups_version: 2.3.3op2
# @var cups_packages_extra:description: >
# Install dependencies or custom driver packages
@ -16,8 +16,8 @@ cups_selinux_restorecon: []
cups_admin_group: printadmin
cups_admin_users:
- name: 'cupsadm'
password: 'secure'
- name: "cupsadm"
password: "secure"
cups_bind_url:
- localhost:631

View File

@ -1,7 +1,7 @@
---
- name: Restart service
service:
name: org.cups.cupsd
name: cups
state: restarted
daemon_reload: yes
enabled: yes

View File

@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_cups_running_and_enabled(host):
cups = host.service("org.cups.cupsd")
cups = host.service("cups")
assert cups.is_running
assert cups.is_enabled

View File

@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_cups_running_and_enabled(host):
cups = host.service("org.cups.cupsd")
cups = host.service("cups")
assert cups.is_running
assert cups.is_enabled

View File

@ -3,6 +3,7 @@
- name: Install cups
package:
name: "{{ cups_packages | default(__cups_packages) }}"
disable_gpg_check: yes
state: present
notify: __cupsd_restart
@ -31,12 +32,5 @@
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.j2"
dest: "/etc/systemd/system/org.cups.cupsd.service"
mode: 0640
notify: __cupsd_restart
become: True
become_user: root

View File

@ -1,4 +1,16 @@
---
- include_vars: "{{ var_files }}"
vars:
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
params:
files:
- "{{ ansible_lsb.id | default('') | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "vars"
when: var_files
- include_tasks: prepare.yml
- include_tasks: install.yml
- include_tasks: selinux.yml

View File

@ -1,7 +1,7 @@
---
- name: Ensure cups service is up and running
service:
name: org.cups.cupsd
name: cups
state: started
daemon_reload: yes
enabled: yes

View File

@ -14,6 +14,12 @@ DefaultEncryption Never
LogLevel {{ cups_log_level | lower }}
PageLogFormat
# Specifies the maximum size of the log files before they are rotated. The value "0" disables log rotation.
MaxLogSize 1m
# Default error policy for printers
ErrorPolicy stop-printer
# Only listen for connections from the local machine.
{% for item in cups_bind_url %}
Listen {{ item }}
@ -94,7 +100,7 @@ WebInterface Yes
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order deny,allow
@ -132,7 +138,7 @@ WebInterface Yes
Order deny,allow
</Limit>
# All printer operations require a printer operator to authenticate...
# All printer operations require a printer operator to authenticate...
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @SYSTEM

View File

@ -1,16 +0,0 @@
#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

View File

@ -1,10 +1,10 @@
---
__cups_download_url: https://gitea.rknet.org/rpmbuild/cups/releases/download/v{{ cups_version }}
__cups_packages:
- "{{ __cups_download_url }}/cups-{{ cups_version }}-0.x86_64.rpm"
- "{{ __cups_download_url }}/cups-devel-{{ cups_version }}-0.x86_64.rpm"
- "{{ __cups_download_url }}/cups-libs-{{ cups_version }}-0.x86_64.rpm"
- "{{ __cups_download_url }}/cups-lpd-{{ cups_version }}-0.x86_64.rpm"
- "{{ __cups_download_url }}/cups-{{ cups_version }}-0.el{{ ansible_distribution_major_version }}.x86_64.rpm"
- "{{ __cups_download_url }}/cups-devel-{{ cups_version }}-0.el{{ ansible_distribution_major_version }}.x86_64.rpm"
- "{{ __cups_download_url }}/cups-libs-{{ cups_version }}-0.el{{ ansible_distribution_major_version }}.x86_64.rpm"
- "{{ __cups_download_url }}/cups-lpd-{{ cups_version }}-0.el{{ ansible_distribution_major_version }}.x86_64.rpm"
__pam_config:
- type: "auth"