Skip to main content

Ansible Playbook for cleaning all print jobs

- hosts: print_servers
  tasks:
    - name: Clears all print jobs from the queues of the specified printers.
      shell: for i in $(/usr/bin/lpstat -o {{ item }} | awk '{ print $1 }'); do /usr/bin/cancel $i; done
      with_items:
        - printer1
        - printer2

Comments

Popular posts from this blog