feat(system/cockpit): implement Cockpit role
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
1380efe400
commit
918f7c8fbf
4 changed files with 32 additions and 0 deletions
5
roles/system/cockpit/defaults/main.yml
Normal file
5
roles/system/cockpit/defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
# Boolean variable that adjust the Cockpit config when it's being served via
|
||||
# reverse proxy (adjusts the origin, so that the Cockpit doesn't drop sessions,
|
||||
# and checks for SSL/TLS connections)
|
||||
system_cockpit_has_reverse_proxy: false
|
5
roles/system/cockpit/tasks/install.yml
Normal file
5
roles/system/cockpit/tasks/install.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Install cockpit
|
||||
ansible.builtin.package:
|
||||
name: cockpit
|
||||
state: present
|
19
roles/system/cockpit/tasks/main.yml
Normal file
19
roles/system/cockpit/tasks/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
- name: Packages
|
||||
ansible.builtin.include_tasks: install.yml
|
||||
tags: install
|
||||
|
||||
- name: Install config to enable reverse proxy
|
||||
ansible.builtin.template:
|
||||
src: templates/cockpit.conf
|
||||
dest: /etc/cockpit/cockpit.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
when: system_cockpit_has_reverse_proxy
|
||||
|
||||
- name: Enable cockpit
|
||||
ansible.builtin.service:
|
||||
name: "cockpit.socket"
|
||||
enabled: true
|
||||
state: restarted
|
3
roles/system/cockpit/templates/cockpit.conf
Normal file
3
roles/system/cockpit/templates/cockpit.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
[WebService]
|
||||
Origins = https://cockpit.{{ host_fqdn }} wss://cockpit.{{ host_fqdn }}
|
||||
ProtocolHeader = X-Forwarded-Proto
|
Loading…
Reference in a new issue