Enable authentication in sushy-tools

Change-Id: Iacfae6b27bcf4c410040d452c31f2e9e1aafe53c
This commit is contained in:
Dmitry Tantsur 2021-09-23 15:57:21 +02:00
parent e2928841ec
commit fe984d0d76
4 changed files with 17 additions and 3 deletions

View File

@ -215,7 +215,7 @@
include_role:
name: bifrost-pip-install
vars:
package: sushy-tools
package: sushy-tools>=0.18.2
- name: create Redfish Emulator state directory
file:
@ -263,6 +263,16 @@
with_first_found: "{{ efi_nvram_locations }}"
when: default_boot_mode == 'uefi'
- name: write Redfish Emulator password file
htpasswd:
path: /etc/redfish-emulator.htpasswd
crypt_scheme: bcrypt
name: "admin"
password: "password"
owner: root
group: root
mode: 0600
- name: write Redfish Emulator configuration file
template:
src: redfish-emulator.conf.j2
@ -296,5 +306,5 @@
systemd:
name: redfish-emulator
enabled: yes
state: "{{ 'restarted' if redfish_emulator_config_file.changed else 'started' }}"
state: restarted
become: true

View File

@ -9,6 +9,7 @@ SUSHY_EMULATOR_BOOT_LOADER_MAP = {
}
}
SUSHY_EMULATOR_AUTH_FILE = '/etc/redfish-emulator.htpasswd'
SUSHY_EMULATOR_LISTEN_IP = '{{ redfish_emulator_host }}'
SUSHY_EMULATOR_LISTEN_PORT = {{ redfish_emulator_port }}
SUSHY_EMULATOR_STATE_DIR = '{{ redfish_emulator_state_dir }}'

View File

@ -18,7 +18,6 @@ pip_install_retries: 5
pip_install_delay: 10
reqs_git_folder: /opt/stack/requirements
state: present
version:
upper_constraints_file: >-
{{ lookup('env', 'UPPER_CONSTRAINTS_FILE')
| default(lookup('env', 'TOX_CONSTRAINTS_FILE'), True)

View File

@ -0,0 +1,4 @@
---
other:
- |
The redfish emulator now has authentication enabled by default.