Packer Dollhouse

I am very new to this world of Packer / Vagrant, Puppet. I am trying to create my first virtual machine using Packer and Puppet.

I can successfully create a virtual box, and I have included a script shell tool to install the puppet. I went to the virtual machine to make sure it was working and the puppet was installed.

Then I added an additional puppet master without a proxy, which looks just like this:

# java dependency
package { 'openjdk-7-jdk' :
    ensure => present
}

When I start the packer, it gets to this point and gets stuck:

==> virtualbox-iso: Provisioning with Puppet...
virtualbox-iso: Creating Puppet staging directory...
virtualbox-iso: Uploading manifests...
virtualbox-iso: Running Puppet:   sudo -E puppet apply --verbose --modulepath='' --detailed-exitcodes /tmp/packer-puppet-masterless/manifests/ubuntu.pp

Any suggestions would be helpful. Even how to debug it to see what happens behind the scenes

+4
source share
1 answer

, execute_command, -.

"override": {
    "virtualbox-iso": {
    "execute_command": "echo 'vagrant' | {{.FacterVars}}{{if .Sudo}} sudo -S -E {{end}}puppet apply  --verbose --modulepath='{{.ModulePath}}' {{if ne .HieraConfigPath \"\"}}--hiera_config='{{.HieraConfigPath}}' {{end}} {{if ne .ManifestDir \"\"}}--manifestdir='{{.ManifestDir}}' {{end}} --detailed-exitcodes {{.ManifestFile}}"
     }
 }

:

{
        "type": "puppet-masterless",
        "manifest_file": "../puppet/manifests/base.pp",
        "module_paths": [
            "../puppet/modules/"
        ],
        "override": {
            "virtualbox-iso": {
                "execute_command": "echo 'vagrant' | {{.FacterVars}}{{if .Sudo}} sudo -S -E {{end}}puppet apply  --verbose --modulepath='{{.ModulePath}}' {{if ne .HieraConfigPath \"\"}}--hiera_config='{{.HieraConfigPath}}' {{end}} {{if ne .ManifestDir \"\"}}--manifestdir='{{.ManifestDir}}' {{end}} --detailed-exitcodes {{.ManifestFile}}"
            }
        }
    }

: https://github.com/AdoptOpenJDK/openjdk-virtual-images/blob/master/packer/openjdk-development/openjdk-development.json

+3

Source: https://habr.com/ru/post/1531651/


All Articles