Setting up printer services via Ansible Automation
We are going to start this section off by creating a playbook for enabling print services using cups
. We will then create playbooks to enable and disable the print queues and also to drain any queued print jobs that might be in line to print. This will allow us to control setting up printers over many devices via automation, which will shorten the time to completion considerably.
First, we will start with a playbook directory, inside of which we will have an inventory file with a list of the servers we want to set up services on. In our case, we are going to set up a print queue on rhel1.example.com
and rhel2.example.com
. This will allow us to showcase using Ansible Automation in more than just a single playbook. We are going to create a cups_playbook
directory, inside of which we are going to first create the inventory file shown in the following screenshot:
Figure 6.12 – Inventory file for playbook...