From 3ca4ef859951813721f6b191961f19bb3b1b6257 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 8 Dec 2017 06:58:15 -0500 Subject: [PATCH] Update main.yml --- roles/cups/tasks/main.yml | 69 ++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/roles/cups/tasks/main.yml b/roles/cups/tasks/main.yml index 111b5098e..d765c4908 100644 --- a/roles/cups/tasks/main.yml +++ b/roles/cups/tasks/main.yml @@ -1,40 +1,46 @@ # administer this service by browsing to localhost:631 - name: Get the CUPS package installed - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - cups when: cups_install tags: - download -- name: Put our own config file in place, to permit local LAN admin - template: dest=/etc/cups/cupsd.conf - src=cupsd.conf +- name: Put our own /etc/cups/cupsd.conf in place, to permit local LAN admin + template: + src: cupsd.conf + dest: /etc/cups/cupsd.conf - name: Put an apache2 config file in place - template: dest=/etc/{{ apache_config_dir }}/ - src=cups.conf + template: + src: cups.conf + dest: "/etc/{{ apache_config_dir }}/" -- name: Create the link for sites-enabled - file: src=/etc/apache2/sites-available/cups.conf - dest=/etc/apache2/sites-enabled/cups.conf - state=link +- name: Create the link for sites-enabled (debuntu) + file: + src: /etc/apache2/sites-available/cups.conf + dest: /etc/apache2/sites-enabled/cups.conf + state: link when: cups_enabled and is_debuntu - name: Enable services for CUPS (OS's other than Fedora 18) - service: name={{ item }} - state=started - enabled=yes + service: + name: "{{ item }}" + state: started + enabled: yes with_items: - cups - cups-browsed when: cups_enabled and not is_F18 - name: Enable services for CUPS (Fedora 18, for XO laptops) - service: name=cups - state=started - enabled=yes + service: + name: cups + state: started + enabled: yes when: cups_enabled and is_F18 - name: Permit headless admin of CUPS -- only works when CUPS daemon is running @@ -42,30 +48,33 @@ when: cups_enabled - name: Disable services for CUPS (OS's other than Fedora 18) - service: name={{ item }} - state=stopped - enabled=no + service: + name: "{{ item }}" + state: stopped + enabled: no with_items: - cups - cups-browsed when: not cups_enabled and not is_F18 - name: Disable services for CUPS (Fedora 18, for XO laptops) - service: name=cups - state=stopped - enabled=no + service: + name: cups + state: stopped + enabled: no when: not cups_enabled and is_F18 -- name: Add 'cups' to service list - ini_file: dest={{ service_filelist }} - section=cups - option={{ item.option }} - value={{ item.value }} +- name: Add 'cups' to list of services at /etc/iiab/iiab.ini + ini_file: + dest: "{{ service_filelist }}" + section: cups + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: name - value: '"Common UNIX Printing System (CUPS)"' + value: CUPS - option: description - value: '"CUPS is a modular printing system which allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer."' + value: '"CUPS (Common UNIX Printing System) is a modular printing system that allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer."' - option: installed value: "{{ cups_install }}" - option: enabled