Bug #4352
closedHammer cli cannot update template
Description
Attempting to use a predefined file (example: discovery-pxe.txt) results in a success, however, the operation doesn't really happen. Below is a sequence of tasks, in the following order:
1. Show discovery-pxe.txt template file
2. Show current template dump (it's template id 2)
3. Import the file to template id 2
4. Show that the current template id 2 dump has not changed
- cat /var/share/config-files/discovery-pxe.txt
<%# This template has special name (do not change it) and it is used for booting unknown hosts. %>
DEFAULT menu
PROMPT 0
MENU TITLE PXE Menu
TIMEOUT 200
TOTALTIMEOUT 6000
DEFAULT menu
PROMPT 0
MENU TITLE PXE Menu
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT discovery
LABEL discovery
MENU LABEL Boot Discovery
TEXT HELP
Boot the Foreman Discovery Image
Use TAB to edit options for specific needs.
ENDTEXT
KERNEL /boot/discovery
APPEND initrd=/boot/initrd.gz.1.0.0 foreman.ip=192.168.11.1
- hammer template dump --id 2
<%#
kind: PXELinux
name: Community PXE Localboot
%>
<%# This template has special name (do not change it) and it is used for booting already provisioned hosts. %>
DEFAULT menu
PROMPT 0
MENU TITLE PXE Menu
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT 0
- hammer template update --id 2 --file /var/share/config-files/discovery-pxe.txt
Config template updated
- hammer template dump --id 2
<%#
kind: PXELinux
name: Community PXE Localboot
%>
<%# This template has special name (do not change it) and it is used for booting already provisioned hosts. %>
DEFAULT menu
PROMPT 0
MENU TITLE PXE Menu
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT 0