Skip to content

Commit

Permalink
Merge pull request #607 from stackhpc/stackhpc/2024.1-ironic-cherry
Browse files Browse the repository at this point in the history
inspector: Add support for copying known_devices.yaml
  • Loading branch information
grzegorzkoper authored Sep 6, 2024
2 parents 7a1b58d + f15d88a commit 6474e19
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ansible/roles/ironic/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@
when:
- ironic_inspector_policy.results

- name: Check if Ironic Inspector known_devices.yaml shall be overwritten
stat:
path: "{{ node_custom_config }}/ironic-inspector/known_devices.yaml"
delegate_to: localhost
run_once: True
register: ironic_inspector_known_devices

- name: Set known_devices file path
set_fact:
ironic_inspector_known_devices_file_path: "{{ ironic_inspector_known_devices.stat.path }}"
when:
- ironic_inspector_known_devices.stat.exists

- name: Copying over known_devices.yaml
template:
src: "{{ ironic_inspector_known_devices_file_path }}"
dest: "{{ node_config_directory }}/ironic-inspector/known_devices.yaml"
mode: "0660"
become: true
when:
- ironic_inspector_known_devices_file_path is defined
- inventory_hostname in groups["ironic-inspector"]
- ironic_services["ironic-inspector"].enabled | bool
notify:
- "Restart ironic-inspector container"

- include_tasks: copy-certs.yml
when:
- kolla_copy_ca_into_containers | bool or ironic_enable_tls_backend | bool
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/ironic/templates/ironic-inspector.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"dest": "/etc/ironic-inspector/{{ ironic_inspector_policy_file }}",
"owner": "ironic-inspector",
"perm": "0600"
}{% endif %}{% if ironic_inspector_known_devices_file_path is defined %},
{
"source": "{{ container_config_directory }}/known_devices.yaml",
"dest": "/etc/ironic-inspector/known_devices.yaml",
"owner": "ironic-inspector",
"perm": "0600"
}{% endif %}
]
}

0 comments on commit 6474e19

Please sign in to comment.