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
Updated by Etzion Bar-Noy almost 11 years ago
- rpm -qa | grep foreman
foreman-installer-1.4.0-1.el6.noarch
foreman-mysql2-1.4.0-1.el6.noarch
foreman-release-1.4.0-1.el6.noarch
foreman-proxy-1.4.0-1.el6.noarch
rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
foreman-1.4.0-1.el6.noarch
rubygem-foreman_api-0.1.11-1.el6.noarch
- rpm -qa | grep hammer
rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
rubygem-hammer_cli-0.0.18-1.el6.noarch
Updated by Dominic Cleal almost 11 years ago
- Project changed from Foreman to Hammer CLI
- Category set to Foreman commands (obsolete)
- Translation missing: en.field_release deleted (
2)
Could you include the output of your hammer update command using "-v"? Also please attach the /var/log/foreman/production.log output while running it.
Updated by Etzion Bar-Noy almost 11 years ago
I want to modify the default pxe, so it's id 1, by default. I will continue with it:
hammer -v template update --id 1 --file $BASE/discovery-pxe.txt
Config template updated
From /var/log/foreman/production.log:
Started PUT "/api/config_templates/1" for ::1 at 2014-02-17 09:16:42 +0000
Processing by Api::V2::ConfigTemplatesController#update as JSON
Parameters: {"config_template"=>{}, "apiv"=>"v2", "id"=>"1"}
Authorized user admin(Admin User)
Completed 200 OK in 29ms (Views: 0.3ms | ActiveRecord: 0.0ms)
Versions:
rpm -qa | grep foreman
rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
foreman-proxy-1.4.0-1.el6.noarch
rubygem-foreman_api-0.1.11-1.el6.noarch
foreman-1.4.0-1.el6.noarch
foreman-cli-1.4.0-1.el6.noarch
foreman-mysql2-1.4.0-1.el6.noarch
foreman-installer-1.4.0-1.el6.noarch
Hammer:
rpm -qa | grep hammer
rubygem-hammer_cli-0.0.18-1.el6.noarch
rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
Updated by Tomáš Strachota almost 11 years ago
- Status changed from New to Assigned
- Assignee set to Tomáš Strachota
- Target version set to 1.9.1
Updated by Anonymous almost 11 years ago
- Target version changed from 1.9.1 to 1.9.0
Updated by Tomáš Strachota almost 11 years ago
- Status changed from Assigned to Ready For Testing
Updated by Tomáš Strachota almost 11 years ago
- Status changed from Ready For Testing to Closed