-
Notifications
You must be signed in to change notification settings - Fork 37
httpboot feature for proxy #518
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| - name: Check if httpboot root directory exists | ||
| ansible.builtin.stat: | ||
| path: "{{ foreman_proxy_httpboot_root_dir }}" | ||
| register: _foreman_proxy_httpboot_root_dir | ||
|
|
||
| - name: Mount httpboot root directory | ||
| ansible.builtin.copy: | ||
| dest: /etc/containers/systemd/foreman-proxy.container.d/httpboot-volume.conf | ||
| content: | | ||
| [Container] | ||
| Volume={{ foreman_proxy_httpboot_root_dir }}:{{ foreman_proxy_httpboot_root_dir }}:z | ||
| mode: '0644' | ||
| owner: root | ||
| group: root | ||
| when: _foreman_proxy_httpboot_root_dir.stat.exists | ||
| notify: | ||
|
Comment on lines
+7
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid enabling HTTPBoot with an unmounted When the directory is absent, this task skips the mount but the feature config still advertises Suggested fix (fail fast) - name: Check if httpboot root directory exists
ansible.builtin.stat:
path: "{{ foreman_proxy_httpboot_root_dir }}"
register: _foreman_proxy_httpboot_root_dir
+- name: Validate httpboot root directory exists when feature is enabled
+ ansible.builtin.fail:
+ msg: "HTTPBoot root directory '{{ foreman_proxy_httpboot_root_dir }}' does not exist on host."
+ when: not _foreman_proxy_httpboot_root_dir.stat.exists
+
- name: Mount httpboot root directory
ansible.builtin.copy:
dest: /etc/containers/systemd/foreman-proxy.container.d/httpboot-volume.conf
content: |
[Container]
Volume={{ foreman_proxy_httpboot_root_dir }}:{{ foreman_proxy_httpboot_root_dir }}:z
@@
- when: _foreman_proxy_httpboot_root_dir.stat.exists
notify:
- Restart Foreman Proxy
- Refresh Foreman Proxy🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
---
- name: Check if httpboot root directory exists
ansible.builtin.stat:
path: "{{ foreman_proxy_httpboot_root_dir }}"
register: _foreman_proxy_httpboot_root_dir
- name: Fail if httpboot root directory does not exist
ansible.builtin.fail:
msg: >-
HTTPBoot root directory '{{ foreman_proxy_httpboot_root_dir }}' does not
exist on the host. Enable the tftp feature first, or create the directory
manually, before enabling httpboot.
when: not _foreman_proxy_httpboot_root_dir.stat.exists
- name: Mount httpboot root directory
ansible.builtin.copy:
dest: /etc/containers/systemd/foreman-proxy.container.d/httpboot-volume.conf
content: |
[Container]
Volume={{ foreman_proxy_httpboot_root_dir }}:{{ foreman_proxy_httpboot_root_dir }}:z
mode: '0644'
owner: root
group: root
notify:
- Restart Foreman Proxy
- Refresh Foreman ProxyKey changes from the draft:
|
||
| - Restart Foreman Proxy | ||
| - Refresh Foreman Proxy | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --- | ||
| :enabled: {{ feature_enabled }} | ||
| :root_dir: {{ foreman_proxy_httpboot_root_dir }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems redundant given the variable name.