template.json
----------------------------------
{
  "variables": {
    "ssh_name": "packer",
    "ssh_pass": "packer",
"username" : "root",
"password" : "vagrant",
"autologin" : "true"
      },
  "builders": [
  
      {
      "type": "vmware-iso",
      "boot_command": [
        "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort 
}}/ks1.cfg<enter><wait>"
      ],
      "boot_wait": "20s",
      "disk_size": 40520,
      "guest_os_type": "centos-64",
      "http_directory": "http",
"iso_url": 
"http://mirrors.liquidweb.com/CentOS/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso";,
    "iso_checksum_type": "sha256",
    "iso_checksum" : 
"907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
"output_directory" : "C:/Users/miracle/Desktop/MSBImage8",
"communicator" : "ssh",
"ssh_username": "root",
     "ssh_password" : "vagrant",
      "ssh_port": 22,
      "ssh_wait_timeout": "10000s",
"ssh_pty" : "true",
"shutdown_command": "echo {{user `vagrant`}} | sudo -S shutdown -P now",
"tools_upload_flavor": "linux",
 
"vmx_data": {
        "memsize": "512",
        "numvcpus": "1",
        "cpuid.coresPerSocket": "1"
      }
    }
  ],
   "provisioners": [
  {
"type": "shell",
      "override": {
"vmware-iso": 
{
"execute_command" : "echo 'vagrant' | {{ .Vars }} sudo -E -S sh '{{ .Path 
}}'",
"inline" : [ "su -c 'yum install java-1.8.0-openjdk 
java-1.8.0-openjdk-devel' ",
"su -c 'yum install tomcat -y' " 
]
}
}
}
],
 "post-processors": [
    {
      "type": "vagrant",
      "override": 
 {
             "vmware":
{
          "output": "centos-7-1-x64-vmware.box"
         }
      }
    }
  ]  
 }
---------------------------------------------
ks1.cfg
-----------
install
cdrom 
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --plaintext vagrant
firewall --enabled --service=ssh
authconfig --enableshadow --passalgo=sha256
selinux --disabled
timezone Asia/Kolkata
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb 
quiet"  

text
skipx
zerombr

clearpart --all --initlabel
autopart

auth  --useshadow  --enablemd5
firstboot --disabled
reboot

%packages --ignoremissing
@core
bzip2
kernel-devel
kernel-headers
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
%end

%post
# sudo
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
sed -i "s/^[^#].*requiretty/#Defaults requiretty/" /etc/sudoers
%end

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/b8f850c7-dd9d-4454-848c-605f6928e4cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to