168 lines
4.1 KiB
YAML
168 lines
4.1 KiB
YAML
---
|
|
|
|
# ---
|
|
# Cups Server
|
|
# ---
|
|
|
|
- name: (cups-install.yml) Ensure CUPS packages server (buster) are installed.
|
|
ansible.builtin.package:
|
|
pkg: "{{ apt_install_server_cups }}"
|
|
state: present
|
|
when:
|
|
- ansible_facts['distribution'] == "Debian"
|
|
tags:
|
|
- cups-server
|
|
|
|
# ---
|
|
# Cups clients
|
|
# ---
|
|
|
|
- name: (cups.yml) Ensure CUPS packages clients are installed.
|
|
ansible.builtin.package:
|
|
pkg: "{{ apt_install_client_cups }}"
|
|
state: present
|
|
when:
|
|
- ansible_facts['distribution'] == "Ubuntu"
|
|
- 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
|
|
ansible.builtin.stat:
|
|
path: /etc/cups/cups-browsed.conf.ORIG
|
|
register: common_cups_browsed_conf_orig_exists
|
|
tags:
|
|
- cups-server
|
|
- cups-client
|
|
|
|
- name: (cups.yml) Backup /etc/cups/cups-browsed.conf file
|
|
ansible.builtin.copy:
|
|
src: /etc/cups/cups-browsed.conf
|
|
dest: /etc/cups/cups-browsed.conf.ORIG
|
|
remote_src: true
|
|
force: false
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
when: not common_cups_browsed_conf_orig_exists.stat.exists
|
|
tags:
|
|
- cups-server
|
|
- cups-client
|
|
|
|
- name: (cups.yml) update configuration file server - /etc/cups/cups-browsed.conf
|
|
ansible.builtin.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
|
|
ansible.builtin.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
|
|
ansible.builtin.stat:
|
|
path: /etc/cups/cupsd.conf.ORIG
|
|
register: common_cupsd_conf_orig_exists
|
|
tags:
|
|
- cups-server
|
|
- cups-client
|
|
|
|
- name: (cups.yml) Backup /etc/cups/cupsd.conf file
|
|
ansible.builtin.copy:
|
|
src: /etc/cups/cupsd.conf
|
|
dest: /etc/cups/cupsd.conf.ORIG
|
|
remote_src: true
|
|
force: false
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
when: not common_cupsd_conf_orig_exists.stat.exists
|
|
tags:
|
|
- cups-server
|
|
- cups-client
|
|
|
|
- name: (cups.yml) update configuration file server - /etc/cups/cupsd.conf
|
|
ansible.builtin.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
|
|
ansible.builtin.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
|
|
ansible.builtin.stat:
|
|
path: /etc/cups/cups-files.conf.ORIG
|
|
register: common_cups_files_conf_orig_exists
|
|
tags:
|
|
- cups-server
|
|
- cups-client
|
|
|
|
- name: (cups.yml) Backup /etc/cups/cups-files.conf file
|
|
ansible.builtin.copy:
|
|
src: /etc/cups/cups-files.conf
|
|
dest: /etc/cups/cups-files.conf.ORIG
|
|
remote_src: true
|
|
force: false
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
when: not common_cups_files_conf_orig_exists.stat.exists
|
|
tags:
|
|
- cups-server
|
|
- cups-client
|
|
|
|
- name: (cups.yml) update configuration file server - /etc/cups/cups-files.conf
|
|
ansible.builtin.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
|