Skip to content

Commit 4efcd62

Browse files
committed
feat(trustee_quadlet): add Trustee quadlet deployment
The deployment of Trustee server includes quadlet and associated configurations. Signed-off-by: Li Tian <litian@redhat.com>
1 parent 072113c commit 4efcd62

29 files changed

Lines changed: 222 additions & 103 deletions

.ansible-lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ exclude_paths:
2121
- .markdownlint.yaml
2222
- examples/roles/
2323
mock_roles:
24-
- linux-system-roles.template
24+
- linux-system-roles.trustee_server
2525
supported_ansible_also:
2626
- "2.14.0"

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Role Name
1+
# trustee_server
22

3-
[![ansible-lint.yml](https://github.com/linux-system-roles/template/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/template/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/ansible-test.yml) [![codespell.yml](https://github.com/linux-system-roles/template/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/template/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/markdownlint.yml) [![qemu-kvm-integration-tests.yml](https://github.com/linux-system-roles/template/actions/workflows/qemu-kvm-integration-tests.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/qemu-kvm-integration-tests.yml) [![shellcheck.yml](https://github.com/linux-system-roles/template/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/template/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/template/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/template/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/template/actions/workflows/woke.yml)
3+
[![ansible-lint.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/ansible-test.yml) [![codespell.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/markdownlint.yml) [![qemu-kvm-integration-tests.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/qemu-kvm-integration-tests.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/qemu-kvm-integration-tests.yml) [![shellcheck.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/trustee_server/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/trustee_server/actions/workflows/woke.yml)
44

5-
![template](https://github.com/linux-system-roles/template/workflows/tox/badge.svg)
5+
![trustee_server](https://github.com/linux-system-roles/trustee_server/workflows/tox/badge.svg)
66

7-
A template for an ansible role that configures some GNU/Linux subsystem or
7+
A trustee_server for an ansible role that configures some GNU/Linux subsystem or
88
service. A brief description of the role goes here.
99

1010
## Requirements
@@ -34,12 +34,12 @@ A description of all input variables (i.e. variables that are defined in
3434
`defaults/main.yml`) for the role should go here as these form an API of the
3535
role. Each variable should have its own section e.g.
3636

37-
### template_foo
37+
### trustee_server_foo
3838

3939
This variable is required. It is a string that lists the foo of the role.
4040
There is no default value.
4141

42-
### template_bar
42+
### trustee_server_bar
4343

4444
This variable is optional. It is a boolean that tells the role to disable bar.
4545
The default value is `true`.
@@ -53,8 +53,8 @@ the lifetime.
5353
Example of setting the variables:
5454

5555
```yaml
56-
template_foo: "oof"
57-
template_bar: false
56+
trustee_server_foo: "oof"
57+
trustee_server_bar: false
5858
```
5959
6060
## Variables Exported by the Role
@@ -63,12 +63,12 @@ This section is optional. Some roles may export variables for playbooks to
6363
use later. These are analogous to "return values" in Ansible modules. For
6464
example, if a role performs some action that will require a system reboot, but
6565
the user wants to defer the reboot, the role might set a variable like
66-
`template_reboot_needed: true` that the playbook can use to reboot at a more
66+
`trustee_server_reboot_needed: true` that the playbook can use to reboot at a more
6767
convenient time.
6868

6969
Example:
7070

71-
### template_reboot_needed
71+
### trustee_server_reboot_needed
7272

7373
Default `false` - if `true`, this means a reboot is needed to apply the changes
7474
made by the role
@@ -79,13 +79,13 @@ Including an example of how to use your role (for instance, with variables
7979
passed in as parameters) is always nice for users too:
8080

8181
```yaml
82-
- name: Manage the template subsystem
82+
- name: Manage the trustee_server subsystem
8383
hosts: all
8484
vars:
85-
template_foo: "foo foo!"
86-
template_bar: false
85+
trustee_server_foo: "foo foo!"
86+
trustee_server_bar: false
8787
roles:
88-
- linux-system-roles.template
88+
- linux-system-roles.trustee_server
8989
```
9090

9191
More examples can be provided in the [`examples/`](examples) directory. These

contributing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to the template Linux System Role
1+
# Contributing to the trustee_server Linux System Role
22

33
## Where to start
44

@@ -12,12 +12,12 @@ This has all of the common information that all role developers need:
1212
* How to create git commits and submit pull requests
1313

1414
**Bugs and needed implementations** are listed on
15-
[Github Issues](https://github.com/linux-system-roles/template/issues).
15+
[Github Issues](https://github.com/linux-system-roles/trustee_server/issues).
1616
Issues labeled with
17-
[**help wanted**](https://github.com/linux-system-roles/template/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
17+
[**help wanted**](https://github.com/linux-system-roles/trustee_server/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
1818
are likely to be suitable for new contributors!
1919

20-
**Code** is managed on [Github](https://github.com/linux-system-roles/template), using
20+
**Code** is managed on [Github](https://github.com/linux-system-roles/trustee_server), using
2121
[Pull Requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests).
2222

2323
## Running CI Tests Locally

defaults/main.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
# Here is the right place to put the role's input variables.
44
# This file also serves as a documentation for such a variables.
55

6-
# Examples of role input variables:
7-
template_foo: foo
8-
template_bar: true
6+
# Trustee Server Components Quadlet repository configuration
7+
trustee_server_trustee: true
8+
trustee_server_quadlet_repo_url: "https://github.com/litian1992/trustee-quadlet-rhel.git"
9+
trustee_server_quadlet_repo_path: "quadlet"
10+
trustee_server_quadlet_repo_branch: "main"
11+
trustee_server_quadlet_install_dir: "/etc/containers/systemd"
12+
trustee_attestation_server_config_dir: "/etc/trustee"
13+
14+
# Secret registration service configuration
15+
trustee_server_secret_registration_service_enabled: false
16+
17+
# SSL certificate generation (used with -config trustee_server.conf)
18+
trustee_server_ssl_bits: 4096
19+
trustee_server_ssl_md: sha256
20+
trustee_server_ssl_days: 3650
21+
trustee_server_ssl_cn: trustee-server
22+
trustee_server_ssl_org: Trustee
23+
trustee_server_ssl_country: US
24+
trustee_server_ssl_cert_path: /etc/trustee/kbs/server.crt
25+
trustee_server_ssl_key_path: /etc/trustee/kbs/server.key

examples/simple.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# SPDX-License-Identifier: MIT
22
---
3-
- name: Example template role invocation
3+
- name: Deploy Trustee Server Components using Podman Quadlets from GitHub repository
44
hosts: all
55
vars:
6-
template_foo: example variable value
7-
template_bar: false
6+
trustee_server_trustee: true
7+
trustee_server_quadlet_repo_url: "https://github.com/litian1992/trustee-quadlet-rhel.git"
8+
trustee_server_quadlet_repo_path: "quadlet"
9+
trustee_server_quadlet_repo_branch: "main"
10+
trustee_server_quadlet_install_dir: "/etc/containers/systemd"
11+
trustee_server_secret_registration_service_enabled: false
812
roles:
9-
- linux-system-roles.template
13+
- linux-system-roles.trustee-server

handlers/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: MIT
22
---
3-
- name: Handler for template to restart services
3+
- name: Handler for trustee_server to restart services
44
service:
55
name: "{{ item }}"
66
state: restarted
7-
loop: "{{ __template_services }}"
7+
loop: "{{ __trustee_server_services }}"

meta/main.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# SPDX-License-Identifier: MIT
22
---
33
galaxy_info:
4-
author: John Doe <jdoe@corp.com>
5-
description: Basic template for Linux system roles
6-
company: John Doe, Inc.
4+
author: Li Tian <litian@redhat.com>
5+
description: Deploy Trustee Server Components using Podman Quadlets from GitHub repository
6+
company: Red Hat, Inc.
77
license: MIT
88
min_ansible_version: "2.9"
99
platforms:
@@ -14,13 +14,15 @@ galaxy_info:
1414
versions:
1515
- "9"
1616
galaxy_tags:
17+
- trustee
18+
- attestation
1719
- el9
1820
- el10
1921
- fedora
2022
# Support running this role in system container environments, and enable
2123
# tests. Remove if not applicable.
22-
- container
24+
# - container
2325
# Support running this role during container builds (mostly useful for
2426
# bootc), and enable tests. Remove if not applicable.
25-
- containerbuild
27+
# - containerbuild
2628
dependencies: []

plans/README-plans.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Introduction CI Testing Plans
22

3-
Linux System Roles CI runs [tmt](https://tmt.readthedocs.io/en/stable/index.html) test plans in [Testing farm](https://docs.testing-farm.io/Testing%20Farm/0.1/index.html) with the [tft.yml](https://github.com/linux-system-roles/template/blob/main/.github/workflows/tft.yml) GitHub workflow.
3+
Linux System Roles CI runs [tmt](https://tmt.readthedocs.io/en/stable/index.html) test plans in [Testing farm](https://docs.testing-farm.io/Testing%20Farm/0.1/index.html) with the [tft.yml](https://github.com/linux-system-roles/trustee_server/blob/main/.github/workflows/tft.yml) GitHub workflow.
44

55
The `plans/test_playbooks_parallel.fmf` plan is a test plan that runs test playbooks in parallel on multiple managed nodes.
66
`plans/test_playbooks_parallel.fmf` is generated centrally from `https://github.com/linux-system-roles/.github/`.
@@ -16,7 +16,7 @@ The `plans/test_playbooks_parallel.fmf` plan does the following steps:
1616
2. Does the required preparation on systems.
1717
3. For the given role and the given PR, runs the general test from [test.sh](https://github.com/linux-system-roles/tft-tests/blob/main/tests/general/test.sh).
1818

19-
The [tft.yml](https://github.com/linux-system-roles/template/blob/main/.github/workflows/tft.yml) workflow runs the above plan and uploads the results to our Fedora storage for public access.
19+
The [tft.yml](https://github.com/linux-system-roles/trustee_server/blob/main/.github/workflows/tft.yml) workflow runs the above plan and uploads the results to our Fedora storage for public access.
2020
This workflow uses Testing Farm's Github Action [Schedule tests on Testing Farm](https://github.com/marketplace/actions/schedule-tests-on-testing-farm).
2121

2222
## Running Tests
@@ -47,7 +47,7 @@ You can run tests locally with the `tmt try` cli or remotely in Testing Farm.
4747
$ TESTING_FARM_API_TOKEN=<your_api_token> \
4848
testing-farm request --pipeline-type="tmt-multihost" \
4949
--plan-filter="tag:playbooks_parallel" \
50-
--git-url "https://github.com/<my_user>/template" \
50+
--git-url "https://github.com/<my_user>/trustee_server" \
5151
--git-ref "<my_branch>" \
5252
--compose CentOS-Stream-9 \
5353
-e "SYSTEM_ROLES_ONLY_TESTS=tests_default.yml" \

tasks/main.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@
44
include_tasks: tasks/set_vars.yml
55

66
# Examples of some tasks:
7-
- name: Ensure required packages are installed
8-
package:
9-
name: "{{ __template_packages }}"
10-
state: present
11-
use: "{{ (__template_is_ostree | d(false)) |
12-
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
7+
- name: Deploy Trustee Server Components using Podman Quadlets
8+
include_tasks: trustee_quadlet.yml
9+
when: trustee_server_trustee | bool
1310

14-
- name: Ensure required services are enabled and started
15-
service:
16-
name: "{{ item }}"
17-
state: started
18-
enabled: true
19-
loop: "{{ __template_services }}"
11+
- name: Create Secret Registration Service
12+
include_tasks: secret_registration_service.yml
13+
when: trustee_server_secret_registration_service_enabled | bool
2014

21-
- name: Generate /etc/{{ __template_foo_config }}
22-
template:
23-
src: "{{ __template_foo_config }}.j2"
24-
dest: /etc/{{ __template_foo_config }}
25-
backup: true
26-
mode: "0400"
27-
notify: Handler for template to restart services
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: MIT
2+
---

0 commit comments

Comments
 (0)