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

[devscripts] Allow passing a custom user ignition file for OCP nodes #1923

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion roles/devscripts/tasks/130_prep_host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@
- cifmw_devscripts_use_static_ip_addr | bool
ansible.builtin.include_tasks: 138_static_ip_addr.yml

- name: Apply the ignition patch if available.
tags:
- bootstrap
ansible.builtin.import_tasks: 139_custom_ignition.yml

- name: Generate the dev-scripts config file.
tags:
- bootstrap
ansible.builtin.import_tasks: 139_configs.yml
ansible.builtin.import_tasks: 140_configs.yml
35 changes: 35 additions & 0 deletions roles/devscripts/tasks/139_custom_ignition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: Save the ignition custom patch and the config param
when: cifmw_devscripts_ignition_patch is defined
block:
- name: Set the ignition config param
vars:
_config_data:
ignition_extra: "cifmw-ignition.ign"
ansible.builtin.set_fact:
cifmw_devscripts_config: >-
{{
cifmw_devscripts_config |
combine(_config_data, recursive=true)
}}

- name: Copy the configuration file
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if we shouldn't allow a list or, even, a directory?

ansible.builtin.copy:
src: "{{ cifmw_devscripts_ignition_patch }}"
dest: >-
{{ cifmw_devscripts_repo_dir }}/cifmw-ignition.ign
Loading