From 34798fd196f9df817c5984dc820d95ac5f60de8c Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 12 Jul 2024 14:58:28 +0200 Subject: [PATCH] feat(server/cups): implement CUPS role Signed-off-by: Matej Focko --- roles/server/cups/tasks/install.yml | 7 +++++++ roles/server/cups/tasks/main.yml | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 roles/server/cups/tasks/install.yml create mode 100644 roles/server/cups/tasks/main.yml diff --git a/roles/server/cups/tasks/install.yml b/roles/server/cups/tasks/install.yml new file mode 100644 index 0000000..879ba03 --- /dev/null +++ b/roles/server/cups/tasks/install.yml @@ -0,0 +1,7 @@ +--- +- name: Install the cups and deps + ansible.builtin.package: + name: + - cups + - hplip + state: present diff --git a/roles/server/cups/tasks/main.yml b/roles/server/cups/tasks/main.yml new file mode 100644 index 0000000..a66a298 --- /dev/null +++ b/roles/server/cups/tasks/main.yml @@ -0,0 +1,24 @@ +--- +- name: Packages + ansible.builtin.include_tasks: install.yml + tags: install + +- name: Add target user as an admin + ansible.builtin.user: + name: "{{ target_user }}" + append: true + groups: "lp" + +- name: Allow cups on the firewall + ansible.posix.firewalld: + service: ipp + immediate: true + permanent: true + state: enabled + tags: firewall + +- name: Enable cups + ansible.builtin.service: + name: cups + enabled: true + state: restarted