Project

General

Profile

Actions

Bug #3297

closed

CLI success story tracker

Added by Martin Bacovsky about 11 years ago. Updated over 10 years ago.

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

Description

The goal is to provision bare metal host on a clean install of Foreman. The following steps are necessary:

  • create smart proxy
        hammer proxy create --name myproxy --url https://proxy.my.net:8443
    
  • create architecture
        hammer architecture create --name x86_64
    
  • create new subnet
        hammer subnet create --name "My Net" --network "192.168.122.0" --mask "255.255.255.0" --gateway "192.168.122.1" --dns-primary "192.168.122.1" 
    
  • import existing subnet from a proxy
    missing, see #3355
  • create new domain
        hammer domain create --name "my.net" --fullname "My network" 
    
  • associate domain with proxy
        hammer domain update --id 1 --dns-id 1
    
  • associate subnet with domain
        hammer subnet update --id 1 --domain-ids 1
    
  • associate subnet with proxy (DHCP, TFTP, DNS)
        hammer subnet update --id 1 --dhcp-id 1 --tftp-id 1 --dns-id 1
    
  • create new partition table
        hammer partition_table create --name "Redhat test" --file /tmp/rh_test.txt
    
  • create new OS
        hammer os create --name RHEL --major 6 --minor 4
    

    --family does not work yet - PR https://github.com/theforeman/foreman/pull/777
  • create new template
        hammer template create --name "kickstart mynet" --type provision --file /tmp/ks.txt
    
  • edit existing pre-defined template
        hammer template dump --id 4 > /tmp/ks.txt
        vim /tmp/ks.txt
        hammer template update --id 4 --file /tmp/ks.txt
    
  • associate applicable OS with pre-defined template
        hammer template update --id 1 --operatingsystem-ids 1
    

    Confirmed through the UI, but listing of templates does not work. Version on GH has listing fixed, but listing associated OS's is still missing - see #3360
  • associate OS with architecture
        hammer os update --id 1 --architecture-ids 1
    
  • associate OS with part table
        hammer os update --id 1 --ptable-ids 1
    
  • associate OS with install media
        hammer os update --id 1 --medium-ids 1
    
  • associate OS with install provision and pxelinux templates
    Added to API in #3928, Hammer feature is #3970
  • create libvirt compute resource
        hammer compute_resource create --name libvirt --url "qemu:///system" --provider Libvirt
    
  • import puppet classes
    missing - see #3035
  • and finally create a host
        hammer -v host create --name "clitest.mynet.com" --ip "192.168.122.5" --host-group-id 1 --compute-resource-id 1 --interface "type=network,model=virtio,network=default" --volume "capacite=10G" --compute-attributes "start=true" 
    

    creates host in my case on Libvirt with NAT and 10GB storage
    related issues - #3063

Actions #1

Updated by Martin Bacovsky about 11 years ago

  • Tracker changed from Tracker to Bug
Actions #2

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #3

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #4

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #5

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #6

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #7

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #8

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #9

Updated by Martin Bacovsky about 11 years ago

I found nice option if you want to try the latest upstream

gem install specific_install
gem specific_install -l "theforeman/hammer-cli" 
gem specific_install -l "theforeman/hammer-cli-foreman" 

Actions #10

Updated by Lukas Zapletal about 11 years ago

Specific install does not work for me on RHEL6 Ruby 1.8:

[root@lzap-aa ~]# gem install specific_install
Successfully installed backports-3.3.5
Successfully installed specific_install-0.2.8
2 gems installed
Installing ri documentation for backports-3.3.5...
Installing ri documentation for specific_install-0.2.8...
Installing RDoc documentation for backports-3.3.5...
Installing RDoc documentation for specific_install-0.2.8...
[root@lzap-aa ~]# gem specific_install -l "theforeman/hammer-cli" 
/usr/lib/ruby/gems/1.8/gems/specific_install-0.2.8/lib/rubygems/commands/specific_install_command.rb:19: warning: multiple values for a block parameter (2 for 1)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb:435
Error: must end with .git to be a git repositoryor be in shorthand form: rdp/specific_install
[root@lzap-aa ~]# gem specific_install -l "theforeman/hammer-cli-foreman" 
/usr/lib/ruby/gems/1.8/gems/specific_install-0.2.8/lib/rubygems/commands/specific_install_command.rb:19: warning: multiple values for a block parameter (2 for 1)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb:435
Error: must end with .git to be a git repositoryor be in shorthand form: rdp/specific_install

Can I use latest nightly build now?

Actions #11

Updated by Martin Bacovsky about 11 years ago

Hmm, you are right, specific_install does not work in 1.8. You can use nightlies or 'gem install hammer-cli'. We will try to release more often to make testing less pain. Thanks!

Actions #12

Updated by Martin Bacovsky about 11 years ago

  • Description updated (diff)
Actions #13

Updated by Martin Bacovsky about 11 years ago

  • Target version changed from 1.15.0 to 1.10.0
Actions #14

Updated by Dominic Cleal almost 11 years ago

  • Target version changed from 1.10.0 to 1.9.3
Actions #15

Updated by Anonymous almost 11 years ago

  • Target version changed from 1.9.3 to 1.9.2
Actions #16

Updated by Anonymous almost 11 years ago

  • Target version changed from 1.9.2 to 1.9.1
Actions #17

Updated by Anonymous over 10 years ago

  • Target version changed from 1.9.1 to 1.9.0
Actions #18

Updated by Dominic Cleal over 10 years ago

  • Description updated (diff)
Actions #19

Updated by Dominic Cleal over 10 years ago

  • Description updated (diff)
Actions #20

Updated by Anonymous over 10 years ago

  • Target version changed from 1.9.0 to 1.8.4
Actions #21

Updated by Anonymous over 10 years ago

  • Target version changed from 1.8.4 to 1.8.3
Actions #22

Updated by Anonymous over 10 years ago

  • Target version deleted (1.8.3)
Actions #23

Updated by Ohad Levy over 10 years ago

  • Status changed from Assigned to Resolved
Actions

Also available in: Atom PDF