cups.yml 889 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
10
  become: yes
11 12 13 14 15 16
  dnf:
    name: "{{ item }}"
    state: present
  with_items:
    - "hplip-common"
    - "hplip"
17
  when: ansible_distribution == 'Fedora'
18

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

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

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