Re: [Puppet Users] Usage of aws module from resource abstraction layer

2016-03-04 Thread Gareth Rushgrove
On 3 March 2016 at 20:12, Sergey Zemlyanoy  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  ensure=present =
>
> 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=x securitygroups='x' subnet=x 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.


[Puppet Users] Re: Usage of aws module from resource abstraction layer

2016-03-04 Thread Sergey Zemlyanoy
Thanks for reply,

Will check that link.
Re defined type this is what I already was thinking about but I literally 
can't call my new type from RAL command while it works perfectly for 
generic puppet applies. From what I know only ruby types can be passed to 
'puppet resource', am I right?

Thnaks

-- 
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/e60aae5a-61bf-4238-99c2-6bdcf3feed0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Usage of aws module from resource abstraction layer

2016-03-04 Thread Gareth Rushgrove
On 4 March 2016 at 10:55, Sergey Zemlyanoy  wrote:
> Thanks for reply,
>
> Will check that link.
> Re defined type this is what I already was thinking about but I literally
> can't call my new type from RAL command while it works perfectly for generic
> puppet applies. From what I know only ruby types can be passed to 'puppet
> resource', am I right?
>

This is unfortunately true at present. However if you use the puppet
apply -e trick you can use defined types.

> Thnaks
>
> --
> 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/e60aae5a-61bf-4238-99c2-6bdcf3feed0f%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_6yKFaRbcHby4QAWdCmeR1cgMcp%2B_7AFAL3Q6TvHE%2B8ZTnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Usage of aws module from resource abstraction layer

2016-03-04 Thread Sergey Zemlyanoy
Regarding advise to use 'puppet apply -e'

Some odd issue with processing resource $title by erb template

I call

puppet apply -e "ec2_instance {"szemlyanoy-test-5": ensure => present, 
region => eu-west-1, image_id => ami-12249661, instance_type => 
'm3.medium', key_name => 'CLI_Deploy', security_groups => ['Allow all'], 
subnet =>  'ec2_generic', user_data => 
template('files/aws_ec2_init.sh.erb'), block_devices => [{'device_name' => 
'/dev/sda1', 'delete_on_termination' => 'true', volume_size => 15}]}"

where in template('files/aws_ec2_init.sh.erb')  I use few commands like

#!/bin/bash
hostnamectl set-hostname <%= @title %>.somedomain


and it applies hostname 'main.somedomain'

So cannot get from where this $title evaluates to 'main' ?


Thanks in advance

-- 
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/ec630430-7dde-40c2-b077-82090b8b0a19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] validate_bool() throwing in error syaing the value not a boolean

2016-03-04 Thread Sans

I'm on v3.8.4
Can it be run from agent? If it does, then it gonna solve my another issue 
as well.

-San


On Thursday, March 3, 2016 at 6:10:33 PM UTC, Henrik Lindberg wrote:
>
>
> If you are on a newer puppet version where the lookup command is 
> available you can use 'puppet lookup --explain your::variable' 
> as it will tell you how it searched for the value. 
>
> - henrik 
>
>
> -- 
>
> Visit my Blog "Puppet on the Edge" 
> http://puppet-on-the-edge.blogspot.se/ 
>

-- 
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/8f38c396-c514-40f0-ac8c-b36d4406d4a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Usage of aws module from resource abstraction layer

2016-03-04 Thread Sergey Zemlyanoy
ignore it

Fixed by invoking command with defined type which pass params into 
ec2_instance type.

The last thing bothers me - I cannot make 'puppet apply -e'  to lookup for 
params from hiera or even puppet classes, so need to pass all keys from cli 
which is inconvenient 

-- 
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/9fe3f057-1425-4536-82a1-d186d933c232%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] validate_bool() throwing in error syaing the value not a boolean

2016-03-04 Thread Henrik Lindberg

On 04/03/16 16:41, Sans wrote:


I'm on v3.8.4
Can it be run from agent? If it does, then it gonna solve my another
issue as well.



Recent would be >= 4.2 wrt. lookup functionality.
Sorry.
- henrik



-San


On Thursday, March 3, 2016 at 6:10:33 PM UTC, Henrik Lindberg wrote:


If you are on a newer puppet version where the lookup command is
available you can use 'puppet lookup --explain your::variable'
as it will tell you how it searched for the value.

- henrik


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/


--
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/8f38c396-c514-40f0-ac8c-b36d4406d4a2%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.



--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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/56D9BD25.5040803%40puppetlabs.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Avoiding duplicate exported resource

2016-03-04 Thread 'Reinhard Vicinus' via Puppet Users
We use a wrapper resource to ensure that only one resource is created. It's 
not perfect, because you need an additional resource, but it works. Here is 
an example:

Multiple nodes want to ensure that the following resource is created on a 
node:

file { '/tmp/at_least_one_node_exists.txt':
}

so we create a wrapper resource:

define export_file (
  filename,
) {
  ensure_resource('file', $filename, {})
}

and export the wrapper resource (here you need different names for all 
nodes, so we use fqdn in the name):

@@export_file { "${fqdn}_one_node":
  filename => '/tmp/at_least_one_node_exists.txt',
}

and also collect the wrapper resource on the destination node:

Export_file <<| |>>

-- 
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/999f5533-1ead-4d11-8c63-4d00d0c4dc95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Setting up Code Manager and running in to problem with r10k_api_user needing key and web hook failing test pushes

2016-03-04 Thread evan . hisey
As the title says this is dealing with Code Manager. First I followed the 
directions in the gitlab module to setup gitlab, and that much worked up to 
testing code pushes. At this point it was apparent the the r10k_api_user 
had a problem do to no ssh key, and that the web hook trigger is not 
working. I am not sure where how to go about debugging this as the only 
error I have found is the un helpful:
500 Whoops, something went wrong on our end. 
--

Try refreshing the page, or going back and attempting the action again.

Please contact your GitLab administrator if this problem persists.


This looks like something is configured wrong on the gitlab side by I need 
help in hunting it down. 


Evan

-- 
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/ed6de589-a17b-4e82-acb6-3fe6474f3558%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] mcollective modules for puppet4

2016-03-04 Thread zdehnert
Does anyone have any examples of how to install the mcollective modules in 
a puppet4 environment?

The yum repos for pc1 do not have the mcollective modules in the repo's 
path.  They are there, but to get them you need to navigate there with a 
browser and download them manually, and the rpm's don't install one the 
correct locations for puppet4.

The few modules I have seen also want to install them in pre-puppet4 
locations, and they want to ensure that mcollective-client, etc. is 
installed as opposed to puppet-agent.

It took me a long time to map the documented installation instructions for 
mcollective into a working puppet4 install, and I really want to add the 
file manager, iptables, and package functionality to mcollective, but I'm 
can't tell if what is available now will even work under puppet4, if I can 
manage to massage things into the correct locations.

 Thanks,
James "Zeke" Dehnert

--
mailto:zdehn...@enphase.com  James "Zeke" Dehnert
  -= Eschew Obfuscation =-
 "Life is racing. Everything else is just waiting"

-- 
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/212787f9-fc15-406a-abce-18d09b3ddc3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.