Project

General

Profile

Actions

Feature #17021

closed

no functionality within hammer to unlock a locked provisioning template

Added by Marcus Torres over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Provisioning templates
Target version:
Difficulty:
medium
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

I'm attempting to completely automate my foreman installation and configuration (including discovery plugin). The only issue i'm running into during the discovery configuration is that i want to update the locked template 'PXELinux global default'. I'm not seeing any method within 'hammer template update' to unlock a template that is by default in locked mode. (by default the PXELinux global default template is locked). Is there any way to unlock this template without using the GUI ?

Actions #1

Updated by Marek Hulán over 7 years ago

  • Status changed from New to Need more information

It works fine for me, did you try using the update command?

hammer template update --locked true --id 170 
Config template updated

hammer template info --id 170                
Id:                170
Name:              Community Alterator default PXELinux
Type:              PXELinux
Locked:            yes
Operating systems:

hammer template update --locked false --id 170
Config template updated

hammer template info --id 170                 
Id:                170
Name:              Community Alterator default PXELinux
Type:              PXELinux
Locked:            no
Operating systems:
Actions #2

Updated by Marcus Torres over 7 years ago

Marek Hulán wrote:

It works fine for me, did you try using the update command?

[...]

that worked ! sorry for the easy question. the template help output wasn't too clear on true|false being the switch. Thanks!

  1. hammer template update --help
    Usage:
    hammer template update [OPTIONS]

Options:
--audit-comment AUDIT_COMMENT
--file TEMPLATE Path to a file that contains the template
--id ID
--locked LOCKED Whether or not the template is locked for editing
--name NAME Name to search by
--new-name NEW_NAME template name
--operatingsystem-ids OPERATINGSYSTEM_IDS Array of operating system IDs to associate with the template
Comma separated list of values.
--operatingsystems OPERATINGSYSTEM_TITLES Comma separated list of values.
--type TYPE Template type. Eg. snippet, script, provision
-h, --help print help

Actions #3

Updated by Marek Hulán over 7 years ago

  • Status changed from Need more information to Assigned
  • Assignee set to Marek Hulán
  • Target version set to 1.4.2

Thanks for letting us know, it revealed a bug in boolean detection. The help with the fix should look like this

 --locked LOCKED                           Whether or not the template is locked for editing
                                           One of true/false, yes/no, 1/0.
Actions #4

Updated by The Foreman Bot over 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/225 added
Actions #5

Updated by Marek Hulán over 7 years ago

  • Target version changed from 1.4.2 to 1.4.4
Actions #6

Updated by Marek Hulán over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #7

Updated by Tomáš Strachota about 7 years ago

  • translation missing: en.field_release set to 235
Actions

Also available in: Atom PDF