On 3 March 2016 at 20:12, Sergey Zemlyanoy <s.zemlya...@gmail.com> wrote: > Hey folks, > > How you guys maintain your ec2 instances using aws module from command line? > I intend to rely on RAL or mco to be able to provision instances on demand, > without declaring them in puppet/hiera, but just take defaults from there. I > want to let my build server to execute command like: > > puppet resource ec2_instance <hostname> ensure=present =<value> > > so it could take defaults(ami, region etc) from hiera and kick few build > instances with unique hostnames. > > I faced with some issues here: not all params can be passed to RAL, namely > user_data, blockdevices > > > puppet resource ec2instance someinstance ensure=present region=eu-central-1 > imageid=xxxxx securitygroups='xxxxx' subnet=xxxxx instancetype=m3.medium > blockdevices=[{'deleteontermination':'true', 'volumesize':10, > 'devicename':'/dev/sda'}] Error: Could not run: Invalid parameter setting > volumesize:10, > > > seems its not possible to pass hash to 'puppet resource' either. >
Yup, that's the current issue with that you propose via puppet resource. The other approach is to use the -e (execute) flag on puppet apply like so: http://www.puppetcookbook.com/posts/simple-adhoc-execution-with-apply-execute.html As it sounds like you're automating this anyway that should just be a matter of syntax, rather than the simple key=value pairs that resource uses you can use the full Puppet language. Which also means you could create some basic defined types which provide the defaults and only pass in the variables that change. Gareth > Any thoughts on how can I pass these attributes or how to force usage of > defaults from hiera? > > Much appreciated, Sergey > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/5e530737-2231-489c-b5e1-1f8f480ff772%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAFi_6yJteXp8e_NEaYNeTQsZ_UerCih%2BB6PhG5cLg2s%2B6qBpsA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.