After initial reboot, packer connects and uploads files to /var/tmp. When executing the 1st script it errors:
I increased the default 'ulimit' from 1024 to 3072 using my kickstart file and confirmed the change by logging into the VM during provisioning.
The /etc/sudoers file is 0440 and looks OK (it's the vendor default). In addition, the 'jetbrains' account can 'sudo su -' with no password.
I get the same error whether I use ssh_user 'root' or 'jetbrains'. Looking for suggestions?
{
"variables": {
"template_version": "",
"template_prefix": "rhel7sm",
"build_uuid": "{{ uuid }}",
"disk_size": "65536",
"memory": "2048",
"esx_host": "{{ env `ESX_HOST` }}",
"esx_password": "{{ env `ESX_PASSWORD` }}",
"lab_vcenter_host": "{{ env `LAB_VCENTER_HOST` }}",
"lab_vcenter_user": "{{ env `LAB_VCENTER_USER` }}",
"lab_vcenter_password": "{{ env `LAB_VCENTER_PASSWORD` }}",
"lab_vcenter_ssl_thumbprint": "{{ env `LAB_VCENTER_SSL_THUMBPRINT` }}",
"lab_datacenter": "{{ env `LAB_DATACENTER` }}",
"lab_cluster": "{{ env `LAB_CLUSTER` }}",
"lab_datastore": "{{ env `LAB_DATASTORE` }}",
"lab_vm_folder": "{{ env `LAB_VM_FOLDER` }}",
"lab_vm_network": "{{ env `LAB_VM_NETWORK` }}",
"proxy_host": "{{ env `PROXY_HOST` }}",
"proxy_port": "{{ env `PROXY_PORT` }}",
"chroot_path": "/mnt/sysimage"
},
"builders": [
{
"name": "rhel-7.5-vmware",
"type": "vsphere-iso",
"vcenter_server": "{{ user `lab_vcenter_host` }}",
"username": "{{ user `lab_vcenter_user` }}",
"password": "{{ user `lab_vcenter_password` }}",
"insecure_connection": true,
"datacenter": "{{ user `lab_datacenter` }}",
"vm_name": "{{ user `template_prefix` }}-{{ user `build_uuid` }}",
"notes" : "{{ user `template_version` }} -- {{ user `template_date` }}",
"folder": "{{ user `lab_base_vm_folder` }}",
"cluster": "{{ user `lab_cluster` }}",
"datastore": "{{ user `lab_datastore` }}",
"iso_checksum": "e53bfe2163ad17cea800d0f89da473ef",
"iso_checksum_type": "md5",
"iso_paths": [
"[nfs01_chddc10sa0101]ISO/rhel-server-7.5-x86_64-boot.iso"
],
"floppy_files": [
"isolinux.cfg"
],
"shutdown_timeout": "10m",
"ssh_username": "root",
"ssh_password": "jetbrains",
"guest_os_type": "rhel7_64Guest",
"CPUs": 2,
"RAM": "{{ user `memory` }}",
"RAM_reserve_all": true,
"disk_controller_type": "pvscsi",
"disk_size": "{{ user `disk_size` }}",
"disk_thin_provisioned": true,
"network_card": "vmxnet3",
"network": "{{ user `lab_vm_network` }}",
"boot_wait": "20s",
"boot_order": "disk,cdrom",
"convert_to_template": true,
"boot_wait": "20s",
"boot_command": [
"<tab> text ks=hd:fd0:/isolinux.cfg<enter><wait>"
]
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"mkdir -p /var/tmp/ansible"
]
},
{
"type": "file",
"source": "ansible",
"destination": "/var/tmp/ansible"
},
{
"type": "file",
"source": "common/mirror_rhel.repo",
"destination": "/home/jetbrains/mirror_rhel.repo"
},
{
"type": "file",
"source": "common/prep.sh",
"destination": "/home/jetbrains/prep.sh"
},
{
"type": "shell",
"remote_path": "/home/jetbrains/prep.sh",
"inline": [
"sudo /home/jetbrains/prep.sh"
]
},
{
"type": "shell",
"pause_before": "50s",
"inline": [
"echo about to run ansible-playbook ... wait 30s for services to stabilize",
"sleep 10",
"sudo /usr/bin/ansible-playbook -vvv /var/tmp/ansible/ansible/site.yml -c local -i /var/tmp/ansible/ansible/inventory/inventory.txt",
"sleep 10"
]
}
]
}