printer-reject.yml 487 B

12345678910111213141516171819
  1. ---
  2. - name: Reject print jobs
  3. hosts: servera.lab.example.com
  4. become: true
  5. vars:
  6. queue_name: "office-printer"
  7. tasks:
  8. - name: check if print queue already exists
  9. command: lpstat -p "{{ queue_name }}"
  10. register: cmdout
  11. ignore_errors: true
  12. changed_when: false
  13. - name: print jobs are rejected
  14. #FIXME: reject jobs for the {{ queue_name}} queue with the
  15. # message: Printer on Fire
  16. command: #FIXME#
  17. when: cmdout.rc == 0