Giter Club home page Giter Club logo

ansible-role-cups's Introduction

Install and configure CUPS, the Common Unix Printing System.

GitHub GitLab Quality Downloads Version
github gitlab quality downloads Version

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.cups

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: robertdebock.bootstrap

Also see a full explanation and example on how to use these roles.

The default values for the variables are set in defaults/main.yml:

---
# defaults file for cups

# Allow remote access
cups_listen: "localhost:631"
cups_serveralias: "*"

# Share local printers on the local network. (boolean)
cups_browsing: no

# Allow access to the server...
cups_locations:
  - name: /
    order: allow,deny
    allow: "@LOCAL"
  - name: /admin
    order: allow,deny
    allow: "@LOCAL"
  - name: /admin/conf
    authtype: Default
    require: user @SYSTEM
    order: allow,deny
    allow: "@LOCAL"
  - name: /admin/log
    authtype: Default
    require: user @SYSTEM
    order: allow,deny

# Cups can save a job history. (boolean)
cups_preserve_job_history: yes

# Cups can offer a web-interface. (boolean)
cups_web_interface: yes

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

This role has been tested on these container images:

container tags
Alpine all
Amazon Candidate
EL 8, 9
Debian all
Fedora all
opensuse all
Ubuntu all

The minimum version of Ansible required is 2.12, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub

Apache-2.0.

robertdebock

Please consider sponsoring me.

ansible-role-cups's People

Contributors

denics avatar dfein38347g avatar robert-de-bock avatar robertdebock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-role-cups's Issues

Cannot access web interface

Describe the bug

After running the role, I cannot access the CUPS interface from my network.

Environment

  • Control node OS: PopOS 21.04
  • Control node Ansible version: 2.11.6
  • Managed node OS: Proxmox 7

Please consider sponsoring me.

Configure cups: `failed to validate`

Describe the bug

The Configure cups task fails with: failed to validate

Playbook

---
--
- name: Additional features
  hosts: web:&{{ env }}
  become: yes
  roles:
    - { role: robertdebock.cups, tags: [printer] }

Output

TASK [robertdebock.cups : Configure cups] **************************************
fatal: [staging-2.localdomain]: FAILED! => {"changed": false, "checksum": "4bcc5dff4c0183708e300b6c69624ddbdb203991", "exit_status": 1, "msg": "failed to validate", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
fatal: [staging-2.localdomain]: FAILED! => {
    "changed": false,
    "checksum": "4bcc5dff4c0183708e300b6c69624ddbdb203991",
    "diff": [],
    "exit_status": 1,
    "invocation": {
        "module_args": {
            "_original_basename": "cupsd.conf.j2",
            "attributes": null,
            "backup": false,
            "checksum": "4bcc5dff4c0183708e300b6c69624ddbdb203991",
            "content": null,
            "dest": "/etc/cups/cupsd.conf",
            "directory_mode": null,
            "follow": false,
            "force": true,
            "group": null,
            "local_follow": null,
            "mode": "0640",
            "owner": null,
            "remote_src": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "src": "/home/admin/.ansible/tmp/ansible-tmp-1695691360.9995403-26245-83999800941144/source",
            "unsafe_writes": false,
            "validate": "cupsd -t -c %s"
        }
    },
    "msg": "failed to validate",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "",
    "stdout_lines": []
}

Environment

  • Control node OS: Ubuntu 22.04.3 LTS
  • Control node Ansible version: ansible [core 2.15.0]
  • Managed node OS: Ubuntu 20.04.5 LTS

Add server alias

To be able to log into the webinterface using the server name and not the ip, we should add the
ServerAlias *

configuration element. Usually a * is ok, but we can customize it.

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.