--- - block: - name: Install cups yum: name: "{{ cups_packages | default(__cups_packages) }}" state: present notify: __cupsd_restart - name: Install extra packages yum: name: "{{ cups_packages_extra }}" state: present notify: __cupsd_restart - name: Deploy global config files template: src: "{{ item }}.j2" dest: "/{{ item }}" mode: 0640 loop: - etc/cups/cupsd.conf - etc/cups/cups-files.conf notify: __cupsd_restart - name: Update pamd rule's control in /etc/pam.d/cups pamd: name: cups type: "{{ item.type }}" control: "{{ item.control }}" module_path: "{{ item.module }}" 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