So I found a solution for this.
Using a File resource upload your folders into /tmp/modules
In the json add extra arguments as this
"extra_arguments" :
["--modulepath=/tmp/modules","--disable_warnings"," deprecations"," -e
'include <classname>'"]
The actual command that comes up on packer will be --> puppet apply
--detailed-exitcodes --modulepath=/tmp/modules --disable_warnings
deprecations -e 'include <class_name>'
/tmp/packer-puppet-masterless/manifests
Unfortunately we cannot leave the manifest_file column blank so it may
cause a double uploading of your manifest. But hey u can upload a dummy
init.pp too...
The init.pp manifest will be something like this.
class <class_name>{
include <class_name>::<another_module_name>
}
ex
class abcd{
include abcd::xyz
}
On Tuesday, December 18, 2018 at 1:31:44 PM UTC-8, vishanth bharadwaj wrote:
>
> Hi,
> The puppet masterless provisioner has the following command. In simpler
> terms this does like puppet apply --detailed-exitcodes
> /tmp/puppet-masterless/init.pp.
>
> Is there a way to do puppet apply
> --modulepath=/tmp/modules/puppet_manifest -e 'include classname' ?
> I saw the go provisioner file but looks like though it may be able to take
> in the modulepath and all other details but it maynot be able to omit the
> manifest file. Like the command can be modified but not completely changed,
> Is this true?
>
> cd {{.WorkingDir}} &&
> {{if ne .FacterVars ""}}{{.FacterVars}} {{end}}
> {{if .Sudo}}sudo -E {{end}}
> {{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}
> puppet apply --detailed-exitcodes
> {{if .Debug}}--debug {{end}}
> {{if ne .ModulePath ""}}--modulepath='{{.ModulePath}}' {{end}}
> {{if ne .HieraConfigPath ""}}--hiera_config='{{.HieraConfigPath}}' {{end}}
> {{if ne .ManifestDir ""}}--manifestdir='{{.ManifestDir}}' {{end}}
> {{if ne .ExtraArguments ""}}{{.ExtraArguments}} {{end}}
> {{.ManifestFile}}
>
>
--
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/ccf8a1e3-f3c6-4e62-9329-1c741baa1bd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.