Skip to content

refactor: rename template to cvm_deploy#2

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
richm:template-rename
Jan 21, 2026
Merged

refactor: rename template to cvm_deploy#2
richm merged 1 commit intolinux-system-roles:mainfrom
richm:template-rename

Conversation

@richm
Copy link
Contributor

@richm richm commented Jan 21, 2026

Signed-off-by: Rich Megginson rmeggins@redhat.com

Summary by Sourcery

Rename the Ansible role from a generic template to cvm_deploy and align metadata, variables, examples, and tests with its new purpose of managing confidential computing machine deployments.

Enhancements:

  • Update role metadata, documentation, and examples to describe cvm_deploy as an Ansible role for confidential computing machine deployments.
  • Rename all role variables, internal facts, templates, and handlers from template_* to cvm_deploy_* for consistent naming.
  • Adjust supported platform configuration to disable container and containerbuild targets in the role metadata.

Documentation:

  • Refresh README, contributing guide, and CI plans documentation to reference the cvm_deploy role and its repository URLs instead of the generic template role.

Tests:

  • Update example playbooks and test playbooks to use the cvm_deploy role name, variables, and expected configuration file/fingerprint paths.

@richm richm requested a review from spetrosi as a code owner January 21, 2026 23:34
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 21, 2026

Reviewer's Guide

Renames the Ansible role from the generic 'template' name to 'cvm_deploy', updating variables, internal identifiers, documentation, tests, and CI references to reflect the new role name and purpose for confidential computing machine deployments.

File-Level Changes

Change Details Files
Rename the public role interface (role name, variables, and documentation) from template to cvm_deploy.
  • Change README title, badges, example playbooks, and variable names to use cvm_deploy and describe confidential computing machine deployments.
  • Rename user-facing defaults variables from template_foo/template_bar to cvm_deploy_config1/cvm_deploy_config2 and update example usages.
  • Update contributing guide and plans README to point to the linux-system-roles/cvm_deploy repository and workflows.
README.md
defaults/main.yml
contributing.md
examples/simple.yml
plans/README-plans.md
Rename internal variables, facts handling, templates, handlers, and tests from template to cvm_deploy.
  • Refactor internal vars for packages, services, and RH distro detection to _cvm_deploy* and update their usage in tasks and tests.
  • Adjust tasks to use the new _cvm_deploy* variables, update template source/destination paths, and rename the notification and handler loop variables accordingly.
  • Update the foo.conf template to reference cvm_deploy variables and fingerprint as system_role:cvm_deploy, and align tests to check the new file path and fingerprint.
  • Switch tests and helper playbooks to import/use the linux-system-roles.cvm_deploy role instead of linux-system-roles.template.
  • Update per-distro vars files to define __cvm_deploy_packages and __cvm_deploy_services instead of _template*.
  • Comment out container/containerbuild platform support in meta/main.yml and update the role description to match cvm_deploy.
vars/main.yml
vars/Fedora.yml
vars/RedHat_7.yml
vars/RedHat_8.yml
vars/RedHat_9.yml
vars/RedHat_10.yml
tasks/main.yml
tasks/set_vars.yml
handlers/main.yml
templates/foo.conf.j2
tests/vars/rh_distros_vars.yml
tests/tests_default.yml
tests/setup-snapshot.yml
tests/tests_include_vars_from_parent.yml
examples/simple.yml
meta/main.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 4 issues, and left some high level feedback:

  • In examples/simple.yml the second variable under vars is still named cvm_deploy_config1 instead of cvm_deploy_config2, which will override the first value and likely doesn’t match the intended usage.
  • The test in tests/tests_default.yml now checks for /etc/cvm_deploy.conf, but tasks/main.yml still renders the template to /etc/{{ __cvm_deploy_foo_config }} (default foo.conf), so either the dest path or the test expectation should be updated for consistency.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `examples/simple.yml` the second variable under `vars` is still named `cvm_deploy_config1` instead of `cvm_deploy_config2`, which will override the first value and likely doesn’t match the intended usage.
- The test in `tests/tests_default.yml` now checks for `/etc/cvm_deploy.conf`, but `tasks/main.yml` still renders the template to `/etc/{{ __cvm_deploy_foo_config }}` (default `foo.conf`), so either the dest path or the test expectation should be updated for consistency.

## Individual Comments

### Comment 1
<location> `examples/simple.yml:7` </location>
<code_context>
-    template_foo: example variable value
-    template_bar: false
+    cvm_deploy_config1: example variable value
+    cvm_deploy_config1: false
   roles:
-    - linux-system-roles.template
</code_context>

<issue_to_address>
**issue (bug_risk):** The second variable in the example playbook should likely be `cvm_deploy_config2` instead of a duplicate `cvm_deploy_config1`.

In `defaults/main.yml` the role defines both `cvm_deploy_config1` and `cvm_deploy_config2`, but this example playbook sets `cvm_deploy_config1` twice, so the first value is overridden and `cvm_deploy_config2` is never shown. Please rename the second line to `cvm_deploy_config2: false` to demonstrate both variables correctly.
</issue_to_address>

### Comment 2
<location> `tasks/set_vars.yml:8-10` </location>
<code_context>

 - name: Determine if system is ostree and set flag
-  when: not __template_is_ostree is defined
+  when: not __cvm_deploy_is_ostree is defined
   block:
     - name: Check if system is ostree
</code_context>

<issue_to_address>
**suggestion (bug_risk):** The `when` condition for checking `__cvm_deploy_is_ostree` is using a potentially ambiguous Jinja expression.

`not __cvm_deploy_is_ostree is defined` is parsed as `(not __cvm_deploy_is_ostree) is defined`, which is different from what you likely intend and can behave oddly when the variable is undefined. Please change this to `__cvm_deploy_is_ostree is not defined` to express the condition clearly and avoid precedence issues.

```suggestion
- name: Determine if system is ostree and set flag
  when: __cvm_deploy_is_ostree is not defined
  block:
```
</issue_to_address>

### Comment 3
<location> `tasks/main.yml:27` </location>
<code_context>
     backup: true
     mode: "0400"
-  notify: Handler for template to restart services
+  notify: Handler for cvm_deploy to restart services
</code_context>

<issue_to_address>
**issue (bug_risk):** The handler name in the notify statement does not match the actual handler name, so the handler will never be triggered.

In `handlers/main.yml` the handler is named `Handler to restart services`, but this task notifies `Handler for cvm_deploy to restart services`. Because Ansible matches handlers by name, the restart will never run. Update the notify string or the handler name so they match.
</issue_to_address>

### Comment 4
<location> `contributing.md:15` </location>
<code_context>

 **Bugs and needed implementations** are listed on
-[Github Issues](https://github.com/linux-system-roles/template/issues).
+[Github Issues](https://github.com/linux-system-roles/cvm_deploy/issues).
 Issues labeled with
-[**help wanted**](https://github.com/linux-system-roles/template/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
</code_context>

<issue_to_address>
**nitpick (typo):** Use the correct capitalization "GitHub" instead of "Github" in the link text.

To match the official branding and existing usage, please update the link text to `[GitHub Issues]`.

Suggested implementation:

```
**Bugs and needed implementations** are listed on
[GitHub Issues](https://github.com/linux-system-roles/cvm_deploy/issues).
Issues labeled with

```

```
**Code** is managed on [GitHub](https://github.com/linux-system-roles/cvm_deploy), using

```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines 8 to 10
- name: Determine if system is ostree and set flag
when: not __template_is_ostree is defined
when: not __cvm_deploy_is_ostree is defined
block:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): The when condition for checking __cvm_deploy_is_ostree is using a potentially ambiguous Jinja expression.

not __cvm_deploy_is_ostree is defined is parsed as (not __cvm_deploy_is_ostree) is defined, which is different from what you likely intend and can behave oddly when the variable is undefined. Please change this to __cvm_deploy_is_ostree is not defined to express the condition clearly and avoid precedence issues.

Suggested change
- name: Determine if system is ostree and set flag
when: not __template_is_ostree is defined
when: not __cvm_deploy_is_ostree is defined
block:
- name: Determine if system is ostree and set flag
when: __cvm_deploy_is_ostree is not defined
block:


**Bugs and needed implementations** are listed on
[Github Issues](https://github.com/linux-system-roles/template/issues).
[Github Issues](https://github.com/linux-system-roles/cvm_deploy/issues).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Use the correct capitalization "GitHub" instead of "Github" in the link text.

To match the official branding and existing usage, please update the link text to [GitHub Issues].

Suggested implementation:

**Bugs and needed implementations** are listed on
[GitHub Issues](https://github.com/linux-system-roles/cvm_deploy/issues).
Issues labeled with

**Code** is managed on [GitHub](https://github.com/linux-system-roles/cvm_deploy), using

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm merged commit 0f6cb58 into linux-system-roles:main Jan 21, 2026
18 of 22 checks passed
@richm richm deleted the template-rename branch January 21, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant