Provisioning hosts Red Hat Satellite 6.16 Configure provisioning resources and networking, provision physical machines, provision virtual machines on cloud providers or virtualization infrastructure, create hosts manually or by using the Discovery service Red Hat Satellite Documentation Team satellite-doc-list@redhat.com

Commands:
hammer host list --organization " My_Organization " --location " My_Location "
hammer os create --architectures "x86_64" --description " My_Operating_System " --family "Redhat" --major 8 --media "Red Hat" --minor 8 --name "Red Hat Enterprise Linux" --partition-tables " My_Partition_Table " --provisioning-templates " My_Provisioning_Template "
PARTID=USD(hammer --csv partition-table list | grep "Kickstart default," | cut -d, -f1) PXEID=USD(hammer --csv template list --per-page=1000 | grep "Kickstart default PXELinux" | cut -d, -f1) SATELLITE_ID=USD(hammer --csv template list --per-page=1000 | grep "provision" | grep ",Kickstart default" | cut -d, -f1) for i in USD(hammer --no-headers --csv os list | awk -F, {'print USD1'}) do hammer partition-table add-operatingsystem --id="USD{PARTID}" --operatingsystem-id="USD{i}" hammer template add-operatingsystem --id="USD{PXEID}" --operatingsystem-id="USD{i}" hammer os set-default-template --id="USD{i}" --config-template-id=USD{PXEID} hammer os add-config-template --id="USD{i}" --config-template-id=USD{SATELLITE_ID} hammer os set-default-template --id="USD{i}" --config-template-id=USD{SATELLITE_ID} done
hammer os info --id 1
hammer architecture create --name " My_Architecture " --operatingsystems " My_Operating_System "
hammer model create --hardware-model " My_Hardware_Model " --info " My_Description " --name " My_Hardware_Model_Name " --vendor-class " My_Vendor_Class "
hammer medium list --organization " My_Organization "
http://download.example.com/centos/USDversion/Server/USDarch/os/
hammer medium create --locations " My_Location " --name " My_Operating_System " --organizations " My_Organization " --os-family "Redhat" --path "http://download.example.com/centos/USDversion/Server/USDarch/os/"
zerombr clearpart --all --initlabel autopart
zerombr clearpart --all --initlabel autopart
hammer partition-table create --file " ~/My_Partition_Table " --locations " My_Location " --name " My_Partition_Table " --organizations " My_Organization " --os-family "Redhat" --snippet false
zerombr clearpart --all --initlabel autopart <%= host_param('autopart_options') %>
#Dynamic (do not remove this line) MEMORY=USD((`grep MemTotal: /proc/meminfo | sed 's/^MemTotal: *//'|sed 's/ .*//'` / 1024)) if [ "USDMEMORY" -lt 2048 ]; then SWAP_MEMORY=USD((USDMEMORY * 2)) elif [ "USDMEMORY" -lt 8192 ]; then SWAP_MEMORY=USDMEMORY elif [ "USDMEMORY" -lt 65536 ]; then SWAP_MEMORY=USD((USDMEMORY / 2)) else SWAP_MEMORY=32768 fi cat <<EOF > /tmp/diskpart.cfg zerombr clearpart --all --initlabel part /boot --fstype ext4 --size 200 --asprimary part swap --size "USDSWAP_MEMORY" part / --fstype ext4 --size 1024 --grow EOF
hammer template create --file ~/my-template --locations " My_Location " --name " My_Provisioning_Template " --organizations " My_Organization " --type provision
hammer template create --file " /path/to/My_Snippet " --locations " My_Location " --name " My_Template_Name_custom_pre" \ --organizations "_My_Organization " --type snippet
echo "Calling API to report successful host deployment" install -y curl ca-certificates curl -X POST -H "Content-Type: application/json" -d '{"name": "<%= @host.name %>", "operating_system": "<%= @host.operatingsystem.name %>", "status": "provisioned",}' "https://api.example.com/"
hammer template list
hammer os list
hammer template add-operatingsystem --id My_Template_ID --operatingsystem-id My_Operating_System_ID
hammer compute-profile create --name " My_Compute_Profile "
hammer compute-profile values create --compute-attributes " flavor=m1.small,cpus=2,memory=4GB,cpu_mode=default --compute-resource " My_Compute_Resource " --compute-profile " My_Compute_Profile " --volume size= 40GB
hammer compute-profile values update --compute-resource " My_Compute_Resource " --compute-profile " My_Compute_Profile " --attributes " cpus=2,memory=4GB " --interface " type=network,bridge=br1,index=1 " --volume "size= 40GB "
hammer compute-profile update --name " My_Compute_Profile " --new-name " My_New_Compute_Profile "
python3 -c 'import crypt,getpass;pw=getpass.getpass(); print(crypt.crypt(pw)) if (pw==getpass.getpass("Confirm: ")) else exit()'
firewall-cmd --add-port=5900-5930/tcp firewall-cmd --add-port=5900-5930/tcp --permanent
hammer settings set --name destroy_vm_on_host_delete --value true --location " My_Location " --organization " My_Organization "
foreman-rake facts:clean
foreman-rake interfaces:clean
satellite-installer --foreman-proxy-tftp-servername 1.2.3.4
foreman-rake orchestration:dhcp:add_missing subnet_name=NAME
foreman-rake orchestration:dhcp:add_missing subnet_name=NAME perform=1
foreman-rake orchestration:dhcp:remove_offending subnet_name=NAME
foreman-rake orchestration:dhcp:remove_offending subnet_name=NAME perform=1
satellite-installer --foreman-proxy-dhcp true --foreman-proxy-dhcp-gateway " 192.168.140.1 " --foreman-proxy-dhcp-managed true --foreman-proxy-dhcp-nameservers " 192.168.140.2 " --foreman-proxy-dhcp-range " 192.168.140.10 192.168.140.110 " --foreman-proxy-dhcp-server " 192.168.140.2 " --foreman-proxy-dns true --foreman-proxy-dns-forwarders " 8.8.8.8 " --foreman-proxy-dns-forwarders " 8.8.4.4 " --foreman-proxy-dns-managed true --foreman-proxy-dns-reverse " 140.168.192.in-addr.arpa " --foreman-proxy-dns-server " 127.0.0.1 " --foreman-proxy-dns-zone " example.com " --foreman-proxy-tftp true --foreman-proxy-tftp-managed true
hammer capsule list
hammer capsule refresh-features --name " satellite.example.com "
hammer capsule info --name " satellite.example.com "
dhcp::pools: isolated.lan: network: 192.168.99.0 mask: 255.255.255.0 gateway: 192.168.99.1 range: 192.168.99.5 192.168.99.49 dns::zones: # creates @ SOA USD::fqdn root.example.com. # creates USD::fqdn A USD::ipaddress example.com: {} # creates @ SOA test.example.net. hostmaster.example.com. # creates test.example.net A 192.0.2.100 example.net: soa: test.example.net soaip: 192.0.2.100 contact: hostmaster.example.com. # creates @ SOA USD::fqdn root.example.org. # does NOT create an A record example.org: reverse: true # creates @ SOA USD::fqdn hostmaster.example.com. 2.0.192.in-addr.arpa: reverse: true contact: hostmaster.example.com.
firewall-cmd --add-service=tftp
firewall-cmd --runtime-to-permanent
iptables --sport 69 --state ESTABLISHED -A OUTPUT -i eth0 -j ACCEPT -m state -p udp service iptables save
IPTABLES_MODULES="ip_conntrack_tftp"
hammer domain create --description " My_Domain " --dns-id My_DNS_ID --locations " My_Location " --name " my-domain.tld " --organizations " My_Organization "
hammer subnet create --boot-mode "DHCP" --description " My_Description " --dhcp-id My_DHCP_ID --dns-id My_DNS_ID --dns-primary "192.168.140.2" --dns-secondary "8.8.8.8" --domains " my-domain.tld" \ --from "192.168.140.111" \ --gateway "192.168.140.1" \ --ipam "DHCP" \ --locations "_My_Location " --mask "255.255.255.0" --name " My_Network " --network "192.168.140.0" --organizations " My_Organization " --tftp-id My_TFTP_ID --to "192.168.140.250"
hammer host create --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --mac " My_MAC_Address " --managed true --name " My_Host_Name " --organization " My_Organization "
hammer host interface update --host "_My_Host_Name_" --managed true --primary true --provision true
hammer host create --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --mac " My_MAC_Address " --managed true --name " My_Host_Name " --organization " My_Organization "
hammer host interface update --host " My_Host_Name " --managed true --primary true --provision true
hammer bootdisk host --full true --host My_Host_Name
hammer bootdisk subnet --subnet My_Subnet_Name
satellite-maintain packages update grub2-efi
satellite-installer --foreman-proxy-http true --foreman-proxy-httpboot true --foreman-proxy-tftp true
satellite-maintain packages update grub2-efi
satellite-installer --foreman-proxy-http true --foreman-proxy-httpboot true --foreman-proxy-tftp true
hammer host create --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --mac " My_MAC_Address " --managed true --name " My_Host_Name " --organization " My_Organization " --pxe-loader "Grub2 UEFI HTTP"
hammer host interface update --host " My_Host_Name " --managed true --primary true --provision true
<%= snippet('create_users') %>
satellite-installer --foreman-proxy-httpboot true --foreman-proxy-tftp true
satellite-maintain packages install ipxe-bootimgs
cp /usr/share/ipxe/ipxe.lkrn /var/lib/tftpboot/
cp /usr/share/ipxe/undionly.kpxe /var/lib/tftpboot/undionly-ipxe.0
restorecon -RvF /var/lib/tftpboot/
satellite-installer --foreman-proxy-dhcp-ipxefilename "http:// satellite.example.com /unattended/iPXE?bootstrap=1"
satellite-installer --foreman-proxy-dhcp-ipxe-bootstrap true
satellite-maintain packages install foreman-discovery-image
satellite-installer --enable-foreman-proxy-plugin-discovery
satellite-maintain packages install foreman-discovery-image
dd bs=4M if=/usr/share/foreman-discovery-image/foreman-discovery-image- version .iso of=/dev/sdb
discovery-remaster ~/iso/foreman-discovery-image- version .iso "fdi.pxip=192.168.140.20/24 fdi.pxgw=192.168.140.1 fdi.pxdns=192.168.140.2 proxy.url=https:// satellite.example.com :9090 proxy.type=proxy fdi.pxfactname1= My_Custom_Hostname fdi.pxfactvalue1= My_Host fdi.pxmac=52:54:00:be:8e:8c fdi.pxauto=1"
dd bs=4M if=/usr/share/foreman-discovery-image/foreman-discovery-image- version .iso of=/dev/sdb
hammer discovery list
hammer discovery provision --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --managed true --name " My_Host_Name " --new-name " My_New_Host_Name " --organization " My_Organization "
hammer discovery-rule create --enabled true --hostgroup " My_Host_Group " --hostname "hypervisor-<%= rand(99999) %>" --hosts-limit 5 --name " My_Hypervisor " --priority 5 --search "cpu_count > 8"
hammer discovery auto-provision --name "macabcdef123456"
. ├── autostart.d │ └── 01_zip.sh ├── bin │ └── ntpdate ├── facts │ └── test.rb └── lib ├── libcrypto.so.1.0.0 └── ruby └── test.rb
zip -r my_extension.zip .
fdi.zips=zip1.zip,boot/zip2.zip
fdi.vlan.primary= My_VLAN_ID
proxy.url=https:// capsule.example.com :9090 proxy.type=proxy
fdi.ssh=1 fdi.rootpw= My_Password
usermod -a -G libvirt non_root_user
su foreman -s /bin/bash
ssh-keygen
ssh-copy-id root@kvm.example.com
exit
satellite-maintain packages install libvirt-client
su foreman -s /bin/bash -c 'virsh -c qemu+ssh://root@kvm.example.com/system list'
qemu+ssh:// root@kvm.example.com /system
virsh edit your_VM_name <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd=' your_randomly_generated_password '>
hammer compute-resource create --name " My_KVM_Server " --provider "Libvirt" --description "KVM server at kvm.example.com " --url "qemu+ssh://root@ kvm.example.com/system " --locations "New York" --organizations " My_Organization "
/var/lib/libvirt/images/TestImage.qcow2
hammer compute-resource image create --name " KVM Image " --compute-resource " My_KVM_Server " --operatingsystem "RedHat version " --architecture "x86_64" --username root --user-data false --uuid "/var/lib/libvirt/images/ KVMimage .qcow2" \
hammer compute-profile create --name "Libvirt CP"
hammer compute-profile values create --compute-profile "Libvirt CP" --compute-resource " My_KVM_Server " --interface "compute_type=network,compute_model=virtio,compute_network= examplenetwork " --volume "pool_name=default,capacity=20G,format_type=qcow2" --compute-attributes "cpus=1,memory=1073741824"
hammer host create --build true --compute-attributes="cpus=1,memory=1073741824" --compute-resource " My_KVM_Server " --enabled true --hostgroup " My_Host_Group " --interface "managed=true,primary=true,provision=true,compute_type=network,compute_network= examplenetwork " --location " My_Location " --managed true --name " My_Host_Name " --organization " My_Organization " --provision-method "build" --root-password " My_Password " --volume="pool_name=default,capacity=20G,format_type=qcow2"
hammer host create --compute-attributes="cpus=1,memory=1073741824" --compute-resource " My_KVM_Server " --enabled true --hostgroup " My_Host_Group " --image " My_KVM_Image " --interface "managed=true,primary=true,provision=true,compute_type=network,compute_network=examplenetwork" --location " My_Location " --managed true --name " My_Host_Name " --organization " My_Organization " --provision-method "image" --volume="pool_name=default,capacity=20G,format_type=qcow2"
hammer compute-resource create --name " My_RHV " --provider "Ovirt" --description "RHV server at rhv.example.com " --url " https://rhv.example.com/ovirt-engine/api/v4 " --user " Satellite_User " --password " My_Password " --locations "New York" --organizations " My_Organization " --datacenter " My_Datacenter "
dnf install cloud-init
datasource_list: ["NoCloud", "ConfigDrive"]
hammer compute-resource image create --name " RHV_Image " --compute-resource " My_RHV " --operatingsystem "RedHat version " --architecture "x86_64" --username root --uuid "9788910c-4030-4ae0-bad7-603375dd72b1" \
<%# kind: user_data name: Cloud-init -%> #cloud-config hostname: <%= @host.shortname %> <%# Allow user to specify additional SSH key as host parameter -%> <% if @host.params['sshkey'].present? || @host.params['remote_execution_ssh_keys'].present? -%> ssh_authorized_keys: <% if @host.params['sshkey'].present? -%> - <%= @host.params['sshkey'] %> <% end -%> <% if @host.params['remote_execution_ssh_keys'].present? -%> <% @host.params['remote_execution_ssh_keys'].each do |key| -%> - <%= key %> <% end -%> <% end -%> <% end -%> runcmd: - | #!/bin/bash <%= indent 4 do snippet 'subscription_manager_registration' end %> <% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'Red Hat Identity Management' -%> <%= indent 4 do snippet 'freeipa_register' end %> <% end -%> <% unless @host.operatingsystem.atomic? -%> # update all the base packages from the updates repository yum -t -y -e 0 update <% end -%> <% # safemode renderer does not support unary negation non_atomic = @host.operatingsystem.atomic? ? false : true pm_set = @host.puppetmaster.empty? ? false : true puppet_enabled = non_atomic && (pm_set || @host.params['force-puppet']) %> <% if puppet_enabled %> yum install -y puppet cat > /etc/puppet/puppet.conf << EOF <%= indent 4 do snippet 'puppet.conf' end %> EOF # Setup puppet to run on system reboot /sbin/chkconfig --level 345 puppet on /usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --tags no_such_tag <%= @host.puppetmaster.blank? ? '' : "--server #{@host.puppetmaster}" %> --no-daemonize /sbin/service puppet start <% end -%> phone_home: url: <%= foreman_url('built') %> post: [] tries: 10pp
hammer compute-profile create --name "Red Hat Virtualization CP"
hammer compute-profile values create --compute-profile "Red Hat Virtualization CP" --compute-resource " My_RHV " --interface "compute_interface= Interface_Type ,compute_name=eth0,compute_network=satnetwork" --volume "size_gb=20G,storage_domain=Data,bootable=true" --compute-attributes "cluster=Default,cores=1,memory=1073741824,start=true""
hammer host create --build true --compute-attributes="cluster=Default,cores=1,memory=1073741824,start=true" --compute-resource " My RHV_" --enabled true --hostgroup " My_Host_Group " --interface "managed=true,primary=true,provision=true,compute_name=eth0,compute_network=satnetwork" --location " My_Location " --managed true --name " My_Host_Name " --organization " My_Organization " --provision-method build --volume="size_gb=20G,storage_domain=Data,bootable=true"
hammer host create --compute-attributes="cluster=Default,cores=1,memory=1073741824,start=true" --compute-resource " My RHV_" --enabled true --hostgroup " My_Host_Group " --image " My RHV_Image_" --interface "managed=true,primary=true,provision=true,compute_name=eth0,compute_network=satnetwork" --location " My_Location " --managed true --name " My_Host_Name " --organization " My_Organization " --provision-method "image" --volume="size_gb=20G,storage_domain=Data,bootable=true"
virsh edit your_VM_name <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd=' your_randomly_generated_password '>
hammer compute-resource create --datacenter " My_Datacenter " --description "vSphere server at vsphere.example.com " --locations " My_Location " --name "My_vSphere" --organizations " My_Organization " --password " My_Password " --provider "Vmware" --server " vsphere.example.com " --user " My_User "
hammer compute-resource image create --architecture " My_Architecture " --compute-resource " My_VMware " --name " My_Image " --operatingsystem " My_Operating_System " --username root --uuid " My_UUID "
hammer compute-profile create --name " My_Compute_Profile "
hammer compute-profile values create --compute-attributes "cpus=1,corespersocket=2,memory_mb=1024,cluster=MyCluster,path=MyVMs,start=true" --compute-profile " My_Compute_Profile " --compute-resource " My_VMware " --interface "compute_type=VirtualE1000,compute_network=mynetwork --volume "size_gb=20G,datastore=Data,name=myharddisk,thin=true"
hammer host create --build true --compute-attributes="cpus=1,corespersocket=2,memory_mb=1024,cluster=MyCluster,path=MyVMs,start=true" --compute-resource " My_VMware " --enabled true --hostgroup " My_Host_Group " --interface "managed=true,primary=true,provision=true,compute_type=VirtualE1000,compute_network=mynetwork" --location " My_Location " --managed true --name " My_Host " --organization " My_Organization " --provision-method build --volume="size_gb=20G,datastore=Data,name=myharddisk,thin=true"
hammer host create --compute-attributes="cpus=1,corespersocket=2,memory_mb=1024,cluster=MyCluster,path=MyVMs,start=true" --compute-resource " My_VMware " --enabled true --hostgroup " My_Host_Group " --image " My_VMware_Image " --interface "managed=true,primary=true,provision=true,compute_type=VirtualE1000,compute_network=mynetwork" --location " My_Location " --managed true --name " My_Host " --organization " My_Organization " --provision-method image --volume="size_gb=20G,datastore=Data,name=myharddisk,thin=true"
dnf install cloud-init open-vm-tools perl-interpreter perl-File-Temp
cat << EOM > /etc/cloud/cloud.cfg.d/01_network.cfg network: config: disabled EOM
cat << EOM > /etc/cloud/cloud.cfg.d/10_datasource.cfg datasource_list: [NoCloud] datasource: NoCloud: seedfrom: https://satellite.example.com/userdata/ EOM
cat << EOM > /etc/cloud/cloud.cfg cloud_init_modules: - bootcmd - ssh cloud_config_modules: - runcmd cloud_final_modules: - scripts-per-once - scripts-per-boot - scripts-per-instance - scripts-user - phone-home system_info: distro: rhel paths: cloud_dir: /var/lib/cloud templates_dir: /etc/cloud/templates ssh_svcname: sshd EOM
update-ca-trust enable
wget -O /etc/pki/ca-trust/source/anchors/cloud-init-ca.crt https:// satellite.example.com /pub/katello-server-ca.crt
update-ca-trust extract
systemctl stop rsyslog systemctl stop auditd
dnf remove --oldinstallonly
package-cleanup --oldkernels --count=1 dnf clean all
logrotate -f /etc/logrotate.conf rm -f /var/log/*-???????? /var/log/*.gz rm -f /var/log/dmesg.old rm -rf /var/log/anaconda cat /dev/null > /var/log/audit/audit.log cat /dev/null > /var/log/wtmp cat /dev/null > /var/log/lastlog cat /dev/null > /var/log/grubby
rm -f /etc/udev/rules.d/70*
rm -f /etc/sysconfig/network-scripts/ifcfg-ens* rm -f /etc/sysconfig/network-scripts/ifcfg-eth*
rm -f /etc/ssh/ssh_host_*
rm -rf ~root/.ssh/known_hosts
rm -f ~root/.bash_history unset HISTFILE
curl -H "Accept:application/json" -H "Content-Type:application/json" -X PUT -u username : password -k https:// satellite.example.com /api/compute_resources/ compute_resource_id /refresh_cache
satellite-installer --enable-foreman-plugin-kubevirt
oc get secrets
oc get secrets MY_SECRET -o jsonpath='{.data.token}' | base64 -d | xargs
hammer compute-resource create --name " My_OpenStack " --provider "OpenStack" --description " My OpenStack environment at openstack.example.com " --url " http://openstack.example.com :5000/v3/auth/tokens" --user " My_Username " --password " My_Password " --tenant " My_Openstack " --domain " My_User_Domain " --project-domain-id " My_Project_Domain_ID " --project-domain-name " My_Project_Domain_Name " --locations "New York" --organizations " My_Organization "
hammer compute-resource image create --name "OpenStack Image" --compute-resource " My_OpenStack_Platform " --operatingsystem "RedHat version " --architecture "x86_64" --username root --user-data true --uuid " /path/to/OpenstackImage.qcow2 "
hammer compute-profile values create --compute-resource " My_Laptop " --compute-profile " My_Compute_Profile " --compute-attributes "availability_zone= My_Zone ,image_ref= My_Image ,flavor_ref=m1.small,tenant_id=openstack,security_groups=default,network= My_Network ,boot_from_volume=false"
hammer host create --compute-attributes="flavor_ref=m1.small,tenant_id=openstack,security_groups=default,network=mynetwork" --compute-resource " My_OpenStack_Platform " --enabled true --hostgroup " My_Host_Group " --image " My_OpenStack_Image " --interface "managed=true,primary=true,provision=true" --location " My_Location " --managed true --name " My_Host_Name " --organization " My_Organization " --provision-method image
satellite-installer --enable-foreman-compute-ec2
hammer compute-resource create --description "Amazon EC2 Public Cloud` --locations " My_Location " --name " My_EC2_Compute_Resource " --organizations " My_Organization " --password " My_Secret_Key " --provider "EC2" --region " My_Region " --user " My_User_Name "
hammer compute-resource image create --architecture " My_Architecture " --compute-resource " My_EC2_Compute_Resource " --name " My_Amazon_EC2_Image " --operatingsystem " My_Operating_System " --user-data true --username root --uuid "ami- My_AMI_ID "
hammer compute-profile values create --compute-resource " My_Laptop " --compute-profile " My_Compute_Profile " --compute-attributes "flavor_id=1,availability_zone= My_Zone ,subnet_id=1,security_group_ids=1,managed_ip=public_ip"
hammer host create --compute-attributes="flavor_id=m1.small,image_id=TestImage,availability_zones=us-east-1a,security_group_ids=Default,managed_ip=Public" --compute-resource " My_EC2_Compute_Resource " --enabled true --hostgroup " My_Host_Group " --image " My_Amazon_EC2_Image " --interface "managed=true,primary=true,provision=true,subnet_id=EC2" --location " My_Location " --managed true --name "My_Host_Name_" --organization " My_Organization " --provision-method image
hammer compute-resource list
su - postgres -c psql foreman
select secret from key_pairs where compute_resource_id = 3; secret
vim Keyname .pem
chmod 600 Keyname .pem
ssh -i Keyname .pem ec2-user@ example.aws.com
sudo -s << EOS _Template_ _Body_ EOS
scp My_GCE_Key .json root@satellite.example.com:/etc/foreman/ My_GCE_Key .json
chown root:foreman /etc/foreman/ My_GCE_Key .json
chmod 0640 /etc/foreman/ My_GCE_Key .json
restorecon -vv /etc/foreman/ My_GCE_Key .json
hammer compute-resource create --key-path "/etc/foreman/ My_GCE_Key .json" --name " My_GCE_Compute_Resource " --provider "gce" --zone " My_Zone "
hammer compute-resource image create --name ' gce_image_name ' --compute-resource ' gce_cr ' --operatingsystem-id 1 --architecture-id 1 --uuid ' 3780108136525169178 ' --username ' admin '
hammer compute-profile create --name My_GCE_Compute_Profile
hammer compute-profile values create --compute-attributes "machine_type=f1-micro,associate_external_ip=true,network=default" --compute-profile " My_GCE_Compute_Profile " --compute-resource " My_GCE_Compute_Resource " --volume " size_gb=20 "
hammer host create --architecture x86_64 --compute-profile " My_Compute_Profile " --compute-resource " My_Compute_Resource " --image " My_GCE_Image " --interface "type=interface,domain_id=1,managed=true,primary=true,provision=true" --location " My_Location " --name " My_Host_Name " --operatingsystem " My_Operating_System " --organization " My_Organization " --provision-method "image" --puppet-ca-proxy-id My_Puppet_CA_Proxy_ID --puppet-environment-id My_Puppet_Environment_ID --puppet-proxy-id My_Puppet_Proxy_ID --root-password " My_Root_Password "
hammer compute-resource create --app-ident My_Client_ID --name My_Compute_Resource_Name --provider azurerm --region " My_Region " --secret-key My_Client_Secret --sub-id My_Subscription_ID --tenant My_Tenant_ID
hammer compute-resource image create --name Azure_image_name --compute-resource azure_cr_name --uuid ' marketplace://RedHat:RHEL:7-RAW:latest ' --username ' azure_username ' --user-data no
hammer compute-profile create --name compute_profile_name
hammer compute-profile values create --compute-attributes="resource_group= resource_group ,vm_size= Standard_B1s ,username= azure_user ,password= azure_password ,platform=Linux,script_command=touch /var/tmp/text.txt" --compute-profile " compute_profile_name " --compute-resource azure_cr_name --interface="compute_public_ip=Dynamic,compute_network=mysubnetID,compute_private_ip=false" --volume="disk_size_gb= 5 ,data_disk_caching= None "
hammer host create --architecture x86_64 --compute-profile " My_Compute_Profile " --compute-resource " My_Compute_Resource " --domain " My_Domain " --image " My_Azure_Image " --location " My_Location " --name " My_Host_Name " --operatingsystem " My_Operating_System " --organization " My_Organization " --provision-method "image"
#!/bin/bash MANIFEST=USD1 Import the content from Red Hat CDN hammer organization create --name "ACME" --label "ACME" --description "My example organization for managing content" hammer subscription upload --file ~/USDMANIFEST --organization "ACME" hammer repository-set enable --name "Red Hat Enterprise Linux 7 Server (RPMs)" --releasever "7Server" --basearch "x86_64" --product "Red Hat Enterprise Linux Server" --organization "ACME" hammer repository-set enable --name "Red Hat Enterprise Linux 7 Server (Kickstart)" --releasever "7Server" --basearch "x86_64" --product "Red Hat Enterprise Linux Server" --organization "ACME" hammer repository-set enable --name "Red Hat Satellite Client 6 (for RHEL 7 Server) (RPMs)" --basearch "x86_64" --product "Red Hat Enterprise Linux Server" --organization "ACME" hammer product synchronize --name "Red Hat Enterprise Linux Server" --organization "ACME" Create your application lifecycle hammer lifecycle-environment create --name "Development" --description "Environment for ACME's Development Team" --prior "Library" --organization "ACME" hammer lifecycle-environment create --name "Testing" --description "Environment for ACME's Quality Engineering Team" --prior "Development" --organization "ACME" hammer lifecycle-environment create --name "Production" --description "Environment for ACME's Product Releases" --prior "Testing" --organization "ACME" Create and publish your content view hammer content-view create --name "Base" --description "Base operating system" --repositories "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server,Red Hat Satellite Client 6 for RHEL 7 Server RPMs x86_64" --organization "ACME" hammer content-view publish --name "Base" --description "My initial content view for my operating system" --organization "ACME" hammer content-view version promote --content-view "Base" --version 1 --to-lifecycle-environment "Development" --organization "ACME" hammer content-view version promote --content-view "Base" --version 1 --to-lifecycle-environment "Testing" --organization "ACME" hammer content-view version promote --content-view "Base" --version 1 --to-lifecycle-environment "Production" --organization "ACME"
chmod +x content-init.sh
./content-init.sh manifest_98f4290e-6c0b-4f37-ba79-3a3ec6e405ba.zip
hammer os list
hammer os update --password-hash SHA256 --title " My_Operating_System "
hammer hostgroup set-parameter --hostgroup " My_Host_Group " --name fips_enabled --value "true"
cat /proc/sys/crypto/fips_enabled
yum install virt-manager virt-viewer libvirt qemu-kvm
yum install virt-install libguestfs-tools-c
systemctl enable --now chronyd
chkconfig --add ntpd chkconfig ntpd on service ntpd start
cp My_SSL_CA_file .pem /etc/pki/ca-trust/source/anchors
update-ca-trust
dnf install puppet-agent
yum install puppet-agent
. /etc/profile.d/puppet-agent.sh
puppet config set server satellite.example.com --section agent puppet config set environment My_Puppet_Environment --section agent
puppet resource service puppet ensure=running enable=true
puppet ssl bootstrap
puppet ssl bootstrap
yum update
yum install cloud-utils-growpart cloud-init
vi /etc/cloud/cloud.cfg
- resolv-conf
vi /etc/sysconfig/network
NOZEROCONF=yes
subscription-manager repos --disable=* subscription-manager unregister
poweroff
cd /var/lib/libvirt/images/
virt-sysprep -d rhel7
virt-sparsify --compress rhel7.qcow2 rhel7-cloud.qcow2
yum update
yum install cloud-utils-growpart cloud-init
- resolv-conf
echo "#" > /etc/udev/rules.d/75-persistent-net-generator.rules
NOZEROCONF=yes
subscription-manager repos --disable=* subscription-manager unregister yum clean all
poweroff
virt-sysprep -d rhel6
virt-sparsify --compress rhel6.qcow2 rhel6-cloud.qcow2