Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associate more templates with CentOS Stream #1885

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions roles/foreman_provisioning/tasks/configure_centos_9.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- name: "Find all relevant templates" # noqa: args[module]
theforeman.foreman.resource_info:
resource: provisioning_templates
search: name ~ "Kickstart default" or name = "Linux host_init_config default"
register: result

- name: "Ensure CentOS Stream 9" # noqa: args[module]
theforeman.foreman.operatingsystem:
name: CentOS_Stream
Expand All @@ -7,15 +13,16 @@
- x86_64
media:
- CentOS Stream 9 mirror
provisioning_templates:
- Kickstart default
provisioning_templates: "{{ result.resources | map(attribute='name') }}"
ptables:
- Kickstart default
state: present
password_hash: "SHA256"
Copy link
Member

Choose a reason for hiding this comment

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

We made this the default, but I don't mind making it explicit now because we didn't add a migration to change existing OSes.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, probably Adam didn't have theforeman/foreman-ansible-modules#1779 in his setup :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I indeed did not have that

Copy link
Member

Choose a reason for hiding this comment

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

Heh, I recall fixing that after Archana run into the same thing when initially writing this play.

Copy link
Member

Choose a reason for hiding this comment

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

Funny, I thought it was related to theforeman/foreman@e2dee7d but now that I read the PR itself it should really be the more secure SHA512.

Suggested change
password_hash: "SHA256"
password_hash: "SHA512"

Copy link
Contributor Author

Choose a reason for hiding this comment

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


- name: "Set default template for CentOS Stream 9" # noqa: args[module]
theforeman.foreman.os_default_template:
operatingsystem: "CentOS_Stream 9"
template_kind: "provision"
provisioning_template: "Kickstart default"
template_kind: "{{ item.template_kind_name }}"
provisioning_template: "{{ item.name }}"
state: present
loop: "{{ result.resources | sort(attribute='name') | unique(attribute='template_kind_name') }}"
Loading