Git Product home page Git Product logo

ansible-cups's People

Contributors

hp41 avatar jontheniceguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ansible-cups's Issues

Error in cups_lpadmin.py while running role

With Ubuntu 16.04 using

ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

Here's the play item which has errored, when I run ansible-playbook with -vvv

TASK [HP41.cups : Install printers using cups_lpadmin] ******************************************************************************************
task path: /etc/ansible/roles/HP41.cups/tasks/printer_and_class_install.yml:14
Using module file /etc/ansible/roles/HP41.cups/library/cups_lpadmin.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~ && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1494079292.48-254030271278802 `" && echo ansible-tmp-1494079292.48-254030271278802="` echo /root/.ansible/tmp/ansible-tmp-14940
79292.48-254030271278802 `" ) && sleep 0'
<localhost> PUT /tmp/tmpJwH5cU TO /root/.ansible/tmp/ansible-tmp-1494079292.48-254030271278802/cups_lpadmin.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1494079292.48-254030271278802/ /root/.ansible/tmp/ansible-tmp-1494079292.48-254030271278802/cups_lpadmin.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1494079292.48-254030271278802/cups_lpadmin.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1494079292.48-254030271278802/" > /dev/null 2>&1 && slee
p 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 1187, in <module>
    main()
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 1180, in main
    result_info = cups_command.start_process()
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 1104, in start_process
    self.printer_install()
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 1040, in printer_install
    if self.exists_self() and not self.printer_check_cups_options():
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 856, in printer_check_cups_options
    'printer-make-and-model': self._printer_get_make_and_model(),
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 593, in _printer_get_make_and_model
    installed_drivers = self._printer_get_installed_drivers()
  File "/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py", line 542, in _printer_get_installed_drivers
    curr[kv[0]] = kv[1]
TypeError: 'itertools.imap' object has no attribute '__getitem__'

failed: [localhost] (item={u'info': u'HP Officejet 6500 e709n', u'name': u'HPPrinter', u'driver': u'drv:///hpcups.drv/hp-officejet_6500_e709n.ppd', u'uri': u'hp:/net/Officejet_6500_E709n?ip=192.168.1.55', u'default_pri
nter': True, u'location': u'Playroom', u'shared': True}) => {
    "failed": true, 
    "item": {
        "default_printer": true, 
        "driver": "drv:///hpcups.drv/hp-officejet_6500_e709n.ppd", 
        "info": "HP Officejet 6500 e709n", 
        "location": "Playroom", 
        "name": "HPPrinter", 
        "shared": true, 
        "uri": "hp:/net/Officejet_6500_E709n?ip=192.168.1.55"
    }, 
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py\", line 1187, in <module>\n    main()\n  File \"/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py\"
, line 1180, in main\n    result_info = cups_command.start_process()\n  File \"/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py\", line 1104, in start_process\n    self.printer_install()\n  File \"/tmp/ansible_ji0fa4
/ansible_module_cups_lpadmin.py\", line 1040, in printer_install\n    if self.exists_self() and not self.printer_check_cups_options():\n  File \"/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py\", line 856, in printe
r_check_cups_options\n    'printer-make-and-model': self._printer_get_make_and_model(),\n  File \"/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py\", line 593, in _printer_get_make_and_model\n    installed_drivers = 
self._printer_get_installed_drivers()\n  File \"/tmp/ansible_ji0fa4/ansible_module_cups_lpadmin.py\", line 542, in _printer_get_installed_drivers\n    curr[kv[0]] = kv[1]\nTypeError: 'itertools.imap' object has no attr
ibute '__getitem__'\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}

This is the line I get when I run lpinfo -m | grep e709n

drv:///hpcups.drv/hp-officejet_6500_e709n.ppd HP Officejet 6500 e709n, hpcups 3.16.3

PPD not installed

I'm havi ng trouble using HP41.cups to install a HP Laserjet 2200. Its connected via the ethernet.
This is an extract from yhe yml:

  • name: Base Configuration
    hosts: zfs11
    become: True
    vars:
    cups_purge_all_printers_and_classes: True
    cups_printers_and_classes_to_be_removed:

    • pdf
    • HP-LaserJet-2200
      cups_ppd_files_to_be_copied: ppd
      cups_printer_list:
    • name: "HP-LaserJet-2200"
      printer_or_class: "printer"
      uri: "hp:/net/HP_LaserJet_2200?ip=192.168.1.5"
      state: "present"
      default: True
      shared: False
      options: {HPOption_Duplexer: True, Duplex: DuplexNoTumble, media: iso_a4_210x297mm}

    cups_openprinting_apt_required:
    cups_ricoh_openprinting_ppds: False

    roles:

    • hp41.cups

It installs the printer but not the appropriate ppd. lpoptions -l reports no ppd.

I tried adding these lines
driver: ppd
model: 'hplip:0/ppd/hplip/HP/hp-laserjet_2200-ps.ppd'
#model: 'drv:///hpcups.drv/hp-laserjet_2200_series.ppd'

these came from lpinfo -m
either version of the model variable gives "ppd cannot be copied"

Can you advise a solution please?

Best wsihes
Terry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.