Actions
Bug #3297
closedCLI success story tracker
Status:
Resolved
Priority:
Normal
Assignee:
Category:
Foreman commands (obsolete)
Target version:
-
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