cups.yml 853 Bytes
Newer Older
julian.gethmann's avatar
julian.gethmann committed
1 2 3
---
- name: install CUPS
  become: yes
julian.gethmann's avatar
julian.gethmann committed
4 5 6
  dnf:
    name: cups
    state: present
julian.gethmann's avatar
julian.gethmann committed
7 8
  when: ansible_distribution == 'Fedora'

9
- name: install dependencies
julian.gethmann's avatar
julian.gethmann committed
10
  become: yes
11
  dnf:
julian.gethmann's avatar
julian.gethmann committed
12
    name: ["hplip-common", "hplip"]
13
    state: present
14
  when: ansible_distribution == 'Fedora'
15

julian.gethmann's avatar
julian.gethmann committed
16 17
- name: install CUPS
  become: yes
julian.gethmann's avatar
julian.gethmann committed
18 19 20
  apt:
    name: cups
    state: present
julian.gethmann's avatar
julian.gethmann committed
21 22 23 24
  when: ansible_distribution == 'Ubuntu'

- name: copy CUPS' configs
  become: yes
julian.gethmann's avatar
julian.gethmann committed
25 26
  copy:
    src: "{{ item }}"
julian.gethmann's avatar
julian.gethmann committed
27 28 29 30
    dest: /etc/cups
    backup: yes
    group: lp
    owner: root
julian.gethmann's avatar
julian.gethmann committed
31 32 33 34 35 36 37
  with_items:
  - "printers.conf"
  - "cupsd.conf"
  notify: restart cups

- name: copy PPD files
  become: yes
julian.gethmann's avatar
julian.gethmann committed
38 39 40 41 42 43 44
  copy:
    src: "ppd/{{ item }}"
    dest: /etc/cups/ppd
    backup: yes
    group: root
    owner: root
    mode: 0644
julian.gethmann's avatar
julian.gethmann committed
45 46 47 48
  notify: restart cups
  with_items:
  - "HP-LaserJet-P2015-Series.ppd"
  - "Oki-MC851(PS).ppd"