Initial commit
This commit is contained in:
		
							
								
								
									
										152
									
								
								roles/common/tasks/cups-install.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								roles/common/tasks/cups-install.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,152 @@ | ||||
| --- | ||||
|  | ||||
|  | ||||
| # --- | ||||
| # Cups Server | ||||
| # --- | ||||
|  | ||||
| - name: (cups-install.yml) Ensure CUPS packages server (buster) are installed. | ||||
|   package: | ||||
|     pkg: '{{ apt_install_server_cups_buster }}' | ||||
|     state: present | ||||
|   when: | ||||
|     - ansible_facts['distribution'] == "Debian" | ||||
|     - ansible_facts['distribution_major_version'] == "10" | ||||
|   tags: | ||||
|     - cups-server | ||||
|  | ||||
|  | ||||
| # --- | ||||
| # Cups clients | ||||
| # --- | ||||
|  | ||||
| - name: (cups.yml) Ensure CUPS packages clients are installed. | ||||
|   package: | ||||
|     pkg: "{{ apt_install_client_cups }}" | ||||
|     state: present | ||||
|   when:  | ||||
|     - ansible_distribution_version ==  "18.04" | ||||
|     - ansible_architecture == "x86_64" | ||||
|   tags: | ||||
|     - cups-client | ||||
|  | ||||
|  | ||||
|  | ||||
| # -- file /etc/cups/cups-browsed.conf | ||||
| - name: (cups.yml) Check if file '/etc/cups/cups-browsed.conf.ORIGi' exists | ||||
|   stat: | ||||
|     path: /etc/cups/cups-browsed.conf.ORIG | ||||
|   register: cups_browsed_conf_orig_exists | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
| - name: (cups.yml) Backup /etc/cups/cups-browsed.conf file | ||||
|   command: cp /etc/cups/cups-browsed.conf /etc/cups/cups-browsed.conf.ORIG | ||||
|   when: cups_browsed_conf_orig_exists.stat.exists == False | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
| - name: (cups.yml) update configuration file server - /etc/cups/cups-browsed.conf | ||||
|   template: | ||||
|     src: "etc/cups/cups-browsed.conf.server.j2" | ||||
|     dest: /etc/cups/cups-browsed.conf | ||||
|     owner: root | ||||
|     group: root | ||||
|     mode: 0644 | ||||
|   notify: | ||||
|      Restart cups-browsed | ||||
|   when: | ||||
|     - groups['file_server']|string is search(inventory_hostname) | ||||
|   tags: | ||||
|     - cups-server | ||||
|  | ||||
| - name: (cups.yml) update configuration file client - /etc/cups/cups-browsed.conf | ||||
|   template: | ||||
|     src: "etc/cups/cups-browsed.conf.client.j2" | ||||
|     dest: /etc/cups/cups-browsed.conf | ||||
|     owner: root | ||||
|     group: root | ||||
|     mode: 0644 | ||||
|   notify: | ||||
|      Restart cups-browsed | ||||
|   when: | ||||
|     - groups['client_pc']|string is search(inventory_hostname) | ||||
|   tags: | ||||
|     - cups-client | ||||
|  | ||||
|  | ||||
| # -- file /etc/cups/cupsd.conf | ||||
| - name: (cups.yml) Check if file '/etc/cups/cupsd.conf.ORIG' exists | ||||
|   stat: | ||||
|     path: /etc/cups/cupsd.conf.ORIG | ||||
|   register: cupsd_conf_orig_exists | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
| - name: (cups.yml) Backup /etc/cups/cupsd.conf file | ||||
|   command: cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.ORIG | ||||
|   when: cupsd_conf_orig_exists.stat.exists == False | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
| - name: (cups.yml) update configuration file server - /etc/cups/cupsd.conf | ||||
|   template: | ||||
|     src: "etc/cups/cupsd.conf.server.j2" | ||||
|     dest: /etc/cups/cupsd.conf | ||||
|     owner: root | ||||
|     group: root | ||||
|     mode: 0644 | ||||
|   notify: | ||||
|      Restart cups | ||||
|   when: | ||||
|     - groups['file_server']|string is search(inventory_hostname) | ||||
|   tags: | ||||
|     - cups-server | ||||
|  | ||||
| - name: (cups.yml) update configuration file client - /etc/cups/cupsd.conf | ||||
|   template: | ||||
|     src: "etc/cups/cupsd.conf.client.j2" | ||||
|     dest: /etc/cups/cupsd.conf | ||||
|     owner: root | ||||
|     group: root | ||||
|     mode: 0644 | ||||
|   notify: | ||||
|      Restart cups | ||||
|   when: | ||||
|     - groups['client_pc']|string is search(inventory_hostname) | ||||
|   tags: | ||||
|     - cups-server | ||||
|  | ||||
| # -- file /etc/cups/cups-files.conf | ||||
| - name: (cups.yml) Check if file '/etc/cups/cups-files.conf.ORIGi' exists | ||||
|   stat: | ||||
|     path: /etc/cups/cups-files.conf.ORIG | ||||
|   register: cups_files_conf_orig_exists | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
| - name: (cups.yml) Backup /etc/cups/cups-files.conf file | ||||
|   command: cp /etc/cups/cups-files.conf /etc/cups/cups-files.conf.ORIG | ||||
|   when: cups_files_conf_orig_exists.stat.exists == False | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
| - name: (cups.yml) update configuration file server - /etc/cups/cups-files.conf | ||||
|   template: | ||||
|     src: "etc/cups/cups-files.conf.j2" | ||||
|     dest: /etc/cups/cups-files.conf | ||||
|     owner: root | ||||
|     group: root | ||||
|     mode: 0644 | ||||
|   notify: | ||||
|      Restart cups | ||||
|   tags: | ||||
|     - cups-server | ||||
|     - cups-client | ||||
|  | ||||
		Reference in New Issue
	
	Block a user