Project

General

Profile

Actions

Bug #4352

closed

Hammer cli cannot update template

Added by Etzion Bar-Noy about 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Foreman commands (obsolete)
Target version:
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

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

  1. 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

  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

  1. hammer template update --id 2 --file /var/share/config-files/discovery-pxe.txt
    Config template updated
  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

Actions #1

Updated by Etzion Bar-Noy about 10 years ago

A note - Centos 6.5, with the latest release version of Foreman and CLI:
  1. 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
  1. rpm -qa | grep hammer
    rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
    rubygem-hammer_cli-0.0.18-1.el6.noarch
Actions #2

Updated by Dominic Cleal about 10 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.

Actions #3

Updated by Etzion Bar-Noy about 10 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

Actions #4

Updated by Tomáš Strachota about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
  • Target version set to 1.9.1
Actions #5

Updated by Anonymous about 10 years ago

  • Target version changed from 1.9.1 to 1.9.0
Actions #6

Updated by Tomáš Strachota about 10 years ago

  • Status changed from Assigned to Ready For Testing
Actions #7

Updated by Tomáš Strachota about 10 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF