cups_server: Convert modules to use FQCN

This commit is contained in:
Timo Makinen 2022-04-14 13:33:34 +00:00
parent 711cec9b54
commit d1c80cf452
2 changed files with 19 additions and 19 deletions

View file

@ -1,6 +1,6 @@
--- ---
- name: restart cups - name: restart cups
service: ansible.builtin.service:
name: cups name: cups
state: restarted state: restarted

View file

@ -1,11 +1,11 @@
--- ---
- name: install cups packages - name: install cups packages
package: ansible.builtin.package:
name: cups name: cups
state: installed state: installed
- name: create cups systemd override directory - name: create cups systemd override directory
file: ansible.builtin.file:
path: /etc/systemd/system/cups.service.d path: /etc/systemd/system/cups.service.d
state: directory state: directory
mode: 0755 mode: 0755
@ -13,7 +13,7 @@
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: configure cups keytab location - name: configure cups keytab location
copy: ansible.builtin.copy:
dest: /etc/systemd/system/cups.service.d/keytab.conf dest: /etc/systemd/system/cups.service.d/keytab.conf
content: "[Service]\nEnvironment=KRB5_KTNAME=FILE:/etc/cups/cups.keytab\n" content: "[Service]\nEnvironment=KRB5_KTNAME=FILE:/etc/cups/cups.keytab\n"
mode: 0644 mode: 0644
@ -21,49 +21,49 @@
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: enable gssapi authentication from cups - name: enable gssapi authentication from cups
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
regexp: "^DefaultAuthType .*" regexp: "^DefaultAuthType .*"
line: "DefaultAuthType Negotiate" line: "DefaultAuthType Negotiate"
notify: restart cups notify: restart cups
- name: disable cups plain text port - name: disable cups plain text port
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
regexp: "^#?Listen (.*:)?631" regexp: "^#?Listen (.*:)?631"
line: "#Listen 631" line: "#Listen 631"
notify: restart cups notify: restart cups
- name: set ssl listen port - name: set ssl listen port
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
line: "SSLListen 631" line: "SSLListen 631"
insertafter: "Listen /var/run/cups/cups.sock" insertafter: "Listen /var/run/cups/cups.sock"
notify: restart cups notify: restart cups
- name: require tls 1.3 - name: require tls 1.3
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
line: "SSLOptions MinTLS1.3" line: "SSLOptions MinTLS1.3"
insertafter: "SSLListen 631" insertafter: "SSLListen 631"
notify: restart cups notify: restart cups
- name: write all requests to cups access log - name: write all requests to cups access log
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
line: "AccessLogLevel all" line: "AccessLogLevel all"
insertafter: "LogLevel warn" insertafter: "LogLevel warn"
notify: restart cups notify: restart cups
- name: disable printer advertisements - name: disable printer advertisements
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
regexp: "^BrowseLocalProtocols .*" regexp: "^BrowseLocalProtocols .*"
line: "BrowseLocalProtocols none" line: "BrowseLocalProtocols none"
notify: restart cups notify: restart cups
- name: link private key - name: link private key
file: ansible.builtin.file:
dest: "/etc/cups/ssl/{{ inventory_hostname }}.key" dest: "/etc/cups/ssl/{{ inventory_hostname }}.key"
src: "{{ tls_private }}/{{ inventory_hostname }}.key" src: "{{ tls_private }}/{{ inventory_hostname }}.key"
state: link state: link
@ -74,7 +74,7 @@
notify: restart cups notify: restart cups
- name: link certificate - name: link certificate
file: ansible.builtin.file:
dest: "/etc/cups/ssl/{{ inventory_hostname }}.crt" dest: "/etc/cups/ssl/{{ inventory_hostname }}.crt"
src: "{{ tls_certs }}/{{ inventory_hostname }}.crt" src: "{{ tls_certs }}/{{ inventory_hostname }}.crt"
state: link state: link
@ -85,14 +85,14 @@
notify: restart cups notify: restart cups
- name: disable printer advertising - name: disable printer advertising
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
regexp: "^Browsing .*" regexp: "^Browsing .*"
line: "Browsing No" line: "Browsing No"
notify: restart cups notify: restart cups
- name: disable unauthenticated access from cups - name: disable unauthenticated access from cups
blockinfile: ansible.builtin.blockinfile:
path: /etc/cups/cupsd.conf path: /etc/cups/cupsd.conf
insertafter: "^<Location />" insertafter: "^<Location />"
block: | block: |
@ -101,14 +101,14 @@
notify: restart cups notify: restart cups
- name: configure cups admin group - name: configure cups admin group
lineinfile: ansible.builtin.lineinfile:
path: /etc/cups/cups-files.conf path: /etc/cups/cups-files.conf
regexp: "^SystemGroup .*" regexp: "^SystemGroup .*"
line: "SystemGroup root sysadm" line: "SystemGroup root sysadm"
notify: restart cups notify: restart cups
- name: add static files to cups web interface - name: add static files to cups web interface
copy: ansible.builtin.copy:
dest: "/usr/share/cups/www/{{ item }}" dest: "/usr/share/cups/www/{{ item }}"
src: "{{ item }}" src: "{{ item }}"
mode: 0644 mode: 0644
@ -119,7 +119,7 @@
- local.css - local.css
- name: create custom header for cups web interface - name: create custom header for cups web interface
copy: ansible.builtin.copy:
dest: /usr/share/cups/templates/header.tmpl dest: /usr/share/cups/templates/header.tmpl
src: header.tmpl src: header.tmpl
mode: 0644 mode: 0644
@ -127,13 +127,13 @@
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: disable cups socket service - name: disable cups socket service
systemd: ansible.builtin.systemd:
name: cups.socket name: cups.socket
enabled: false enabled: false
state: stopped state: stopped
- name: enable cups service - name: enable cups service
service: ansible.builtin.service:
name: cups name: cups
enabled: true enabled: true
state: started state: started