Skip to content

Ansible role to deploy Cat Printer as a quadlet container

License

Notifications You must be signed in to change notification settings

fansilet-roles/cat_printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cat_printer

Deploy Cat-Printer as a Podman Quadlet container.

Cat Printer is a web app daemon that allows communitcation with thermal printers via bluetooth. The container must have access to the bluetooth device, which by default will be /dev/usb/hiddev0. It's possible to adjust the device by changing the variable cat_printer_quadlet_devices. To figure out what is your bluetooth device use the command lsusb |grep -i bluetooth|awk -F':' '{print $1}'|awk '{print "/dev/bus/usb/" $2 "/" $4}'.
This quadlet, by default will run as rootfull.

Requirements

  • podman - version 4.7.2+

Role Variables

  • cat_printer_quadlet: (dict) - Define the Container image and tag
  • cat_printer_environment: (dict) - Define the environment variables
  • cat_printer_volumes: (list) - A list of paths to be mounted
  • cat_printer_quadlet_ports: (list) - A list of ports to be exposed
  • cat_printer_quadlet_devices: (list) - A list of devices to bind in the container. (default: /dev/usb/hiddev0 will be mounted)
  • cat_printer_autodetect_bluetooth: (bool) - If enabled, tries to autodetect the bluetooth device
  • cat_printer_dependecies: (list) - List of packages to be installed as dependencies

Dependencies

None

Example Playbook

  • Deploy using default settings:
---
- name: Deploy Cat Printer Quadlet
  hosts: all
  gather_facts: false
  cat_printer_quadlet_devices:
    - name: usb
      path: /dev/usb/hiddev1
      enable: true
  roles:
    - role: cat_printer
  • Autodetect bluetooth:
---
- name: Deploy Cat Printer Quadlet
  hosts: all
  gather_facts: false
  cat_printer_autodetect_bluetooth: true
  roles:
    - role: cat_printer

Developing and Testing

This role was developed using ansible molecule. The use of molecule is optional but recommended.

  • Testing:
    Unit tests for checking code regression are available in the tests directory. use the verify or test commands, e.g:
molecule test

while developing use verify instead:

molecule create
molecule verify

License

GPL-2.0-or-later

Author Information

@mrbrandao - Igor Brandão

About

Ansible role to deploy Cat Printer as a quadlet container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages