Skip to content

Commit 17226bf

Browse files
authored
SECURESIGN-55 | Monitoring of Sigstore containers with Cockpit (#112)
1 parent 9a0ea95 commit 17226bf

File tree

7 files changed

+94
-15
lines changed

7 files changed

+94
-15
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ You can also install a specific version of the collection, for example, if you n
8585
ansible-galaxy collection install redhat.artifact_signer:==1.1.0
8686
```
8787

88+
### Monitoring of containers with Cockpit
89+
To monitor containers with Cockpit, you need to install the Red Hat Enterprise Linux System Roles Ansible Collection, found [here](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles/) using the following command: `ansible-galaxy collection install redhat.rhel_system_roles:==1.88.9` (NOTE: minimum required version is 1.88.9), authentication with AAH (Ansible Automation Hub) is required for this.
90+
After installing the collection, you can enable and configure Cockpit as shown below
91+
92+
```
93+
tas_single_node_cockpit:
94+
enabled: true
95+
user:
96+
create: true
97+
username: cockpit-user
98+
password: password
99+
```
88100

89101
## Downloading CLI tools
90102
To Download tools to interact with Red Hat Trusted Artifact Signer, you can visit `https://cli-server.<base_hostname>`

roles/tas_single_node/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Deploy the [RHTAS](https://docs.redhat.com/en/documentation/red_hat_trusted_arti
4646
| tas_single_node_tsa_image | Timestamp Authority Image | str | `registry.redhat.io/rhtas/timestamp-authority-rhel9@sha256:3fba2f8cd09548d2bd2dfff938529952999cb28ff5b7ea42c1c5e722b8eb827f` |
4747
| tas_single_node_rekor_search_image | Rekor search UI image | str | `registry.redhat.io/rhtas/rekor-search-ui-rhel9@sha256:8c478fc6122377c6c9df0fddf0ae42b6f6b1648e3c6cf96a0558f366e7921b2b` |
4848
| tas_single_node_podman | Configuration options for Podman. | dict of 'tas_single_node_podman' options | |
49+
| tas_single_node_cockpit | Configuration options for Cockpit. | dict of 'tas_single_node_cockpit' options | `{'enabled': False, 'user': {'create': False, 'username': 'cockpit-user'}}` |
4950

5051
#### Options for main > tas_single_node_rekor_redis
5152

@@ -118,6 +119,21 @@ Deploy the [RHTAS](https://docs.redhat.com/en/documentation/red_hat_trusted_arti
118119
| location | The primary registry location for the image. | str | yes | |
119120
| mirror | The mirror registry to use for pulling images from the primary registry location. | str | yes | |
120121

122+
#### Options for main > tas_single_node_cockpit
123+
124+
|Option|Description|Type|Required|Default|
125+
|---|---|---|---|---|
126+
| enabled | Whether or not to install Cockpit. | bool | no | |
127+
| user | Configuration for the cockpit user. | dict of 'user' options | no | |
128+
129+
#### Options for main > tas_single_node_cockpit > user
130+
131+
|Option|Description|Type|Required|Default|
132+
|---|---|---|---|---|
133+
| create | Whether or not to create the cockpit user. | bool | no | |
134+
| username | Username for the cockpit user. | str | no | |
135+
| password | Password for the cockpit user. | str | yes | |
136+
121137
## Example Playbook
122138

123139
```

roles/tas_single_node/defaults/main.yml

+7
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,10 @@ tas_single_node_client_server_image:
9494
"registry.redhat.io/rhtas/client-server-rhel9@sha256:9537329d0166b8d41ffd5f5d79c052fc27abe426a20cba5733c84030013c4e29"
9595

9696
tas_single_node_podman: {}
97+
98+
tas_single_node_cockpit:
99+
enabled: false # install redhat.rhel_system_roles before enabling
100+
user:
101+
create: false
102+
username: cockpit-user
103+
password: ""

roles/tas_single_node/meta/argument_specs.yml

+37
Original file line numberDiff line numberDiff line change
@@ -375,3 +375,40 @@ argument_specs:
375375
type: "str"
376376
required: true
377377
version_added: "1.1.1"
378+
tas_single_node_cockpit:
379+
description: "Configuration options for Cockpit."
380+
type: "dict"
381+
required: false
382+
version_added: "1.1.1"
383+
default:
384+
enabled: false
385+
user:
386+
create: false
387+
username: cockpit-user
388+
options:
389+
enabled:
390+
description: "Whether or not to install Cockpit."
391+
type: "bool"
392+
required: false
393+
version_added: "1.1.1"
394+
user:
395+
description: "Configuration for the cockpit user."
396+
type: "dict"
397+
required: false
398+
version_added: "1.1.1"
399+
options:
400+
create:
401+
description: "Whether or not to create the cockpit user."
402+
type: "bool"
403+
required: false
404+
version_added: "1.1.1"
405+
username:
406+
description: "Username for the cockpit user."
407+
type: "str"
408+
required: false
409+
version_added: "1.1.1"
410+
password:
411+
description: "Password for the cockpit user."
412+
type: "str"
413+
required: true
414+
version_added: "1.1.1"

roles/tas_single_node/tasks/main.yml

+22
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@
99
ansible.builtin.include_tasks: os.yml
1010
when: not tas_single_node_skip_os_install
1111

12+
- name: Create cockpit-user
13+
ansible.builtin.user:
14+
name: "{{ tas_single_node_cockpit.user.username }}"
15+
shell: /bin/bash
16+
group: wheel
17+
password: "{{ tas_single_node_cockpit.user.password | password_hash('sha512') }}"
18+
create_home: true
19+
when:
20+
- tas_single_node_cockpit.enabled | bool
21+
- tas_single_node_cockpit.user.create | bool
22+
23+
- name: Install Cockpit
24+
ansible.builtin.include_role:
25+
name: redhat.rhel_system_roles.cockpit
26+
vars:
27+
cockpit_packages:
28+
- cockpit-storaged
29+
- cockpit-podman
30+
- cockpit
31+
cockpit_manage_firewall: true
32+
when: tas_single_node_cockpit.enabled | bool
33+
1234
- name: Create Certificates
1335
ansible.builtin.include_tasks: certificates.yml
1436

roles/tas_single_node/tasks/os.yml

-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
name: "{{ tas_single_node_system_packages }}"
99
state: latest
1010

11-
- name: Install Cockpit
12-
ansible.builtin.include_role:
13-
name: cockpit
14-
vars:
15-
cockpit_packages: "{{ tas_single_node_cockpit.cockpit_packages }}"
16-
cockpit_manage_firewall: "{{ tas_single_node_cockpit.cockpit_manage_firewall }}"
17-
when: tas_single_node_cockpit.enabled | bool
18-
1911
- name: Configure /etc/hosts DNS block
2012
ansible.builtin.blockinfile:
2113
dest: /etc/hosts

roles/tas_single_node/vars/main.yml

-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ tas_single_node_system_packages:
55
- podman-plugins
66
- firewalld
77

8-
tas_single_node_cockpit:
9-
enabled: false
10-
cockpit_packages:
11-
- cockpit-storaged
12-
- cockpit-podman
13-
- cockpit
14-
cockpit_manage_firewall: true
158

169
tas_single_node_rekor_signer_type: file # to be exposed to users later on
1710
tas_single_node_rekor_templates:

0 commit comments

Comments
 (0)