[Puppet Users] Re: Ruby gem-ruby-shadow RPM on RHEL 8 ?

2022-03-18 Thread Corey Osman

I would like to know your use case of this gem since parsing /etc/shadow or 
/etc/passwd can be done with other tooling like augeas.  Also, are you 
parsing the puppetserver's files or the agent?   Additionally, any ruby 
code used to parse files would be installed on the agent and never the 
puppetserver.   The puppetserver's job is to only compile the catalog. 

To answer the original question you can pre-compile the gem and 
deliver/install to the destination.   

https://github.com/apalmblad/ruby-shadow
https://stackoverflow.com/questions/3667918/how-do-you-precompile-the-native-extensions-for-a-ruby-gem-for-linux
https://github.com/rake-compiler/rake-compiler


Although I don't see a need to do this since there are other ways to solve 
actual issue.

The epel package will not work since it would install files in the wrong 
location and since puppetserver runs on jruby it wouldn't work anyways.   

Reach out on the puppet community slack channels for more support. 


Corey
NWOPS, LLC

On Thursday, March 17, 2022 at 8:49:50 AM UTC-7 nasa_dan wrote:

> Will the rubygem-ruby-shadow RPM from EPEL work with PE 2021.4 instead of 
> installing the gem ?
>
>  
>
> The command “puppetserver gem install ruby-shadow” fails, telling me I 
> need to install development tools.
>
> I can do that for the test-lab instance, but not in production.
>
>  
>
> Thanks.
>

-- 
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/7cb87ec3-d539-4cb5-81aa-0088d9d2d74an%40googlegroups.com.


[Puppet Users] Re: [INFO, maybe ACTION] r10k Feature Proposal

2021-03-16 Thread Corey Osman
Why stop at the spec directory?  Ignore all those other pesky files too 
that pdk and others leave behind.  Gemfile*  *.travis, *.gitlab-ci, 
*.ignore, ...

On Thursday, March 11, 2021 at 4:04:38 PM UTC-8 Molly Waggett wrote:

> Hey folks!
>
> We are planning an r10k feature to stop deploying module spec 
> directories. This will lower disk usage, particularly for folks with a lot 
> of modules and multiple compilers.
>
> Our hope is to enable this behavior by default, but leave the option to 
> opt out (i.e. continue including spec directories when deploying 
> modules). This is based on the assumption that most folks have no need for 
> module spec directories in a production environment, since they typically 
> just include testing materials for module development.
>
> If you think this assumption is inaccurate, or even if it’s just 
> inaccurate for you, please let us know! If we don’t hear any objections by 
> Tuesday, 
> March 23, we will proceed with the above plan to adopt this behavior but 
> include a way to opt out. 
>
> If you have any questions, please reply to this email or ping @r10k in the 
> Puppet 
> Community Slack .
>
> Thanks!
>
> -- 
> *Molly Waggett*
> she/her
> Senior Software Engineer @ Puppet
>

-- 
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/30a3ca9f-3fc3-408e-8776-0e46a17ac96dn%40googlegroups.com.


[Puppet Users] Re: Nonconformist Ubuntu based distro users

2021-03-11 Thread Corey Osman
I am thinking we can make a whole module out of this issue and fix the 
problem with puppet code. This problem appears in other tooling as well.  I 
have the following in my code now which patches the lsb-release file and 
appears to make things works.

https://gist.github.com/logicminds/0816ab9c3cd485a7270bc2795ec2b94f

Keeping track of all the flavors and codenames is annoying but can easily 
be done in hieradata with a giant hash.

I can start a module if anyone wants to contribute.   Other ideas 
welcomed.  I won't be conforming as I am not able to use Ubuntu on my 
specialized hardware.



On Friday, March 5, 2021 at 6:27:08 PM UTC-8 ama...@gmail.com wrote:

> I'm currently using Puppet Enterprise (under 10 nodes) on my personal 
> network.  I've run into some of the same issues that you have.
>
> I run Kubuntu on my desktop, which works perfectly as an Ubuntu 
> derivative.  I've used KDE Neon (another Ubuntu derivative) briefly in the 
> past too, and from what I recall, it was fine.  
>
> Pop!_OS was *not* fine, as even though most Puppet modules would have 
> worked just fine, it identifies as Pop instead of Ubuntu, so most modules 
> just bail.  I abandoned Pop!_OS partially because of that (along with other 
> reasons).
>
> I've also tried to use Puppet on Raspbian, using the Ruby agent, and it's 
> got similar problems to what you describe.  The Facts OS hash just doesn't 
> quite match what stock Debian does, so a few modules I've tried to use 
> don't work right.
>
> How do I fix all this?  Change my OS usually.  On my desktop, I stick to 
> OSs that PE supports.  And I'm thinking of changing my RPIs to Ubuntu, 
> rather than Raspbian.  And I run a couple VMs using CentOS.
>
> I've also forked a module before and patched it for Raspbian compatibility 
> for myself.  Another time, I just had to install the `lsb-release` package 
> to get the OS facts hash to a place where the module could use it.
>
> All in all, since this is my personal network, I'm pretty flexible with 
> what I can do; changing an OS isn't a big deal.  I generally don't have 
> hard requirements that I have to meet.
>
> *At work*, where I also use PE, we stick to Ubuntu-proper, and CentOS, 
> mostly as headless VMs (not desktops).  But that's for wider compatibility 
> reasons that just PE.
>
> On Thursday, March 4, 2021 at 2:22:40 PM UTC-5 Corey Osman wrote:
>
>>
>>
>> Hi,
>>
>> Curious how many of you are using a Ubuntu derivative for specialized use 
>> cases. There are many reasons to do so with use cases ranging from 
>> cryptocurrency mining hardware to a government hardened distro.  Also 
>> popular distros like Xubuntu, PopOS and LinuxMint have opinionated software 
>> configurations that some of us prefer and fall into this unsupported grey 
>> area as well.
>>
>> The problem with using a niche or custom distro is that puppet and other 
>> tools do not officially support the distro.  However these tools are 
>> completely capable of running on the distro with little issue. 
>>
>> One issue I found with facter regarding lsb-release file.  
>> https://tickets.puppetlabs.com/browse/FACT-2953
>>
>> So my questions are:
>>
>> Are you using puppet on your special distro?
>> Do you pay for open source puppet support or have PE ?
>> What distro are you using?
>> What use case do you have?
>> What issues have you had with puppet and your special distro?
>>
>>
>> Corey
>>
>> NWOPS, LLC
>> @nwops on Puppet Slack
>>
>>
>>

-- 
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/2b2e755e-1b30-4011-a405-4e5657598931n%40googlegroups.com.


[Puppet Users] Nonconformist Ubuntu based distro users

2021-03-04 Thread Corey Osman
Hi,




Curious how many of you are using a Ubuntu derivative for specialized use 
cases. There are many reasons to do so with use cases ranging from 
cryptocurrency mining hardware to a government hardened distro.  Also popular 
distros like Xubuntu, PopOS and LinuxMint have opinionated software 
configurations that some of us prefer and fall into this unsupported grey area 
as well.



The problem with using a niche or custom distro is that puppet and other tools 
do not officially support the distro.  However these tools are completely 
capable of running on the distro with little issue. 



One issue I found with facter regarding lsb-release file.  

https://tickets.puppetlabs.com/browse/FACT-2953



So my questions are:



Are you using puppet on your special distro?

Do you pay for open source puppet support or have PE ?

What distro are you using?

What use case do you have?

What issues have you had with puppet and your special distro?





Corey



NWOPS, LLC

@nwops on Puppet Slack

-- 
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/177feb0fc85.c615c129314416.1602845948050540458%40logicminds.biz.


[Puppet Users] Re: Puppet Apply

2017-06-02 Thread Corey Osman
I would suggest using a tool I wrote called the puppet debugger.  It allows you 
to write little bits of code in realtime and get the results back right away.  
It is a wonderful tool to learn the language with.  

Basically just install it and run puppet debugger, than write some puppet code. 
 

github.com/nwops/puppet-debugger 

Or online at https://www.puppet-debugger.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/3eac6702-58de-43c4-b6f7-7cd52f6589fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: puppet-debugger release 0.6.0

2017-04-14 Thread Corey Osman
Hi,

Excited to announce that I have released puppet-deubugger version 0.6.0.  It 
has been a while since my last release announcement despite many new releases. 
Additionally, I also renamed this project from puppet-repl to puppet-debugger 
since it reflected more on the capabilities of the project.  Announce most 
people don’t know what a REPL is but do understand what a debugger is.

With the new debugger name also brings a new puppet application called 
‘debugger’.  This uses the application face base to allow for many additionally 
features that get inherited using the face.  See puppet debugger -h for a few 
examples.  One of my favorite features is the integration with facterdb 
(https://github.com/camptocamp/facterdb 
<https://github.com/camptocamp/facterdb>) that allows me to pretend I am on a 
different os.  Ever wondered how you can play with the facts of a windows 
system?

puppet debugger --facterdb-filter 'operatingsystem=windows’ 

or how about AIX

puppet debugger --facterdb-filter 'kernel=AIX’


This release brings in two new features:
  — listing all the available datatypes
  — listing all the available types

These two little features will save you time from having to look them up in the 
module and puppet documentation. You can even use tab completion for the 
datatype.

Btw,  did you know the puppetlabs-stdlib module comes with several new 
datatypes that are extremely useful?


Web debugger example of new features 

https://www.puppet-debugger.com/play?url=https://gist.github.com/logicminds/b9307a71ab9f38db178ff420ba9c7a5d
 
<https://puppet-debugger.com/play?url=https://gist.github.com/logicminds/b9307a71ab9f38db178ff420ba9c7a5d>


As the puppet 4 language becomes the norm the ability to test little snippets 
of code quickly via the debugger is extremely valuable. If you are still doing 
this with puppet apply you should try the debugger and gain a realtime feedback 
loop.  Playing with structured facts with the debugger is really easy and fun.  
The debugger will help you learn the puppet language faster and with all the 
new awesome features in Puppet 4 you have much to learn.

If you like this project, put a star on it.

Puppet-debugger on github:
https://github.com/nwops/puppet-debugger 
<https://github.com/nwops/puppet-debugger>

Puppet debugger web based version (limited capability)
https://www.puppet-debugger.com <https://www.puppet-debugger.com/>

Install on your machine:
  gem install puppet-debugger

Supports puppet 3.8+

Use emacs?  Check out this puppet-debugger integration:  
https://github.com/voxpupuli/puppet-mode 
<https://github.com/voxpupuli/puppet-mode>

enjoy,

Corey Osman
NWOps


-- 
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/3320D87B-7B94-4195-9E2A-F41C55B5AD60%40nwops.io.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Draft for new type and provider API

2017-02-05 Thread Corey Osman
One improvement I would like to see with the provider API is around getting 
the current state.  I see many beginners including myself trying to add way 
more complexity than required in the exists? method.

One would think that you in order to figure out if the resource exists that 
you should just query the system and DIY.  And I'll pick on my own code as 
an example: 
https://github.com/logicminds/bmclib/blob/0.1.0/lib/puppet/provider/bmc/ipmitool.rb#L34

However, this is not the case.  This is the exact opposite of what you need 
to do. Instead you need to query the API which is hard to understand and 
not obvious at first because instinct tells you to get the state yourself.

https://github.com/logicminds/bmclib/blob/master/lib/puppet/provider/bmc/ipmitool.rb#L60

Another improvement which I hope would get addressed is self.prefetch. 
 While self.instances is pretty simple to understand the prefetch method 
could probably use a better name and an easier way to implement. It was not 
obvious at first how to implement. So many people don't implement these two 
methods when they should making their provider more useful. 


The type checking looks pretty amazing and simple to understand and 
implement in the type code.

Additionally, As Trevor mentioned I also have some projects 
(puppet-debugger and puppet-retrospec) that utilize the current Puppet API 
to introspec resources and query the catalog please so make sure this new 
code doesn't break my projects.   I'll be happy to test out any new API for 
third party compatibility. 


Corey  (NWOps)



On Tuesday, January 31, 2017 at 8:04:19 AM UTC-8, David Schmitt wrote:
>
> Hi *,
>
> The type and provider API has been the bane of my existence since I 
> [started writing native resources](
> https://github.com/DavidS/puppet-mysql-old/commit/d33c7aa10e3a4bd9e97e947c471ee3ed36e9d1e2).
>  
> Now, finally, we'll do something about it. I'm currently working on 
> designing a nicer API for types and providers. My primary goals are to 
> provide a smooth and simple ruby developer experience for both scripters 
> and coders. Secondary goals were to eliminate server side code, and make 
> puppet 4 data types available. Currently this is completely aspirational 
> (i.e. no real code has been written), but early private feedback was 
> encouraging.
>
> To showcase my vision, this [gist](
> https://gist.github.com/DavidS/430330ae43ba4b51fe34bd27ddbe4bc7) has the 
> [apt_key type](
> https://github.com/puppetlabs/puppetlabs-apt/blob/master/lib/puppet/type/apt_key.rb)
>  
> and [provider](
> https://github.com/puppetlabs/puppetlabs-apt/blob/master/lib/puppet/provider/apt_key/apt_key.rb)
>  
> ported over to my proposal. The second example there is a more long-term 
> teaser on what would become possible with such an API. 
>
> The new API, like the existing, has two parts: the implementation that 
> interacts with the actual resources, a.k.a. the provider, and information 
> about what the implementation is all about. Due to the different usage 
> patterns of the two parts, they need to be passed to puppet in two 
> different calls: 
>
> The `Puppet::SimpleResource.implement()` call receives the `current_state 
> = get()` and `set(current_state, target_state, noop)` methods. `get` 
> returns a list of discovered resources, while `set` takes the target state 
> and enforces those goals on the subject. There is only a single (ruby) 
> object throughout an agent run, that can easily do caching and what ever 
> else is required for a good functioning of the provider. The state 
> descriptions passed around are simple lists of key/value hashes describing 
> resources. This will allow the implementation wide latitude in how to 
> organise itself for simplicity and efficiency.  
>
> The `Puppet::SimpleResource.define()` call provides a data-only 
> description of the Type. This is all that is needed on the server side to 
> compile a manifest. Thanks to puppet 4 data type checking, this will 
> already be much more strict (with less effort) than possible with the 
> current APIs, while providing more automatically readable documentation 
> about the meaning of the attributes. 
>   
>
> Details in no particular order:
>
> * All of this should fit on any unmodified puppet4 installation. It is 
> completely additive and optional. Currently.
>
> * The Type definition 
>   * It is data-only.
>   * Refers to puppet data types.
>   * No code runs on the server.
>   * This information can be re-used in all tooling around 
> displaying/working with types (e.g. puppet-strings, console, ENC, etc.).
>   * autorelations are restricted to unmodified attribute values and 
> constant values.
>   * No more `validate` or `munge`! For the edge cases not covered by data 
> types, runtime checking can happen in the implementation on the agent. 
> There it can use local system state (e.g. different mysql versions have 
> different max table length constraints), and it will only fail the part of 
> t

[Puppet Users] Re: automatically generate puppet manifests for legacy servers

2016-08-12 Thread Corey Osman
You may want to check out https://github.com/devstructure/blueprint



On Thursday, August 11, 2016 at 6:40:29 AM UTC-7, Dennis McCarthy wrote:
>
> Hi puppet-users,
>
> I've worked with puppet for a while now but was stuck on how best to 
> manage legacy servers quickly without having to create specific manifests 
> for each server. I basically wrote this script to do the whole thing for me 
> and wondered if anyone else might find it useful.
>
> I've put it on github and would like some feedback from other users if you 
> have time to take a look. It's targeted specifically at managing legacy 
> servers or with people who don't know how to write their own manifests but 
> want to learn by generating their own code. It covers files, services, 
> packages, users, templates, file_line, etc. It generates a puppet apply 
> script to manage your server locally but I also added in a role so it can 
> be used with directory environments.
>
> If you want to contribute you're more then welcome to create a pull 
> request.
>
> Here's my code. 
> https://github.com/dmccuk/puppetmanifestgenerator.git
>
> Thanks.
>
>

-- 
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/1bb5fc34-024a-4c70-9934-ee49b24aa64a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: puppet-retrospec 1.0.0 now available - easiest way to generate rspec-puppet tests

2016-07-05 Thread Corey Osman
Happy to announce the 1.0.0 release of puppet-retrospec.  This release is a 
major overhaul from the previous version hence the 1.0.0 release.

This release includes full support for puppet 4 parser among other fixes.  
Horray! Puppet 4 support!

If your puppet code is non puppet4 compliant you will want to use 
puppet-retrospec versions prior to 1.0.0.  This is due to the puppet4 parser 
enforcing code deprecations by throwing errors instead of warnings.

puppet-retrospec comes bundled with puppet 4.5.2 in order to keep your current 
puppet versions safe. This is done intentionally in case you are not ready for 
puppet4 installation just yet. 

This also means your ruby version must also be complaint with puppet 4.5.2 ( 
https://docs.puppet.com/guides/platforms.html#ruby-versions 
<https://docs.puppet.com/guides/platforms.html#ruby-versions>) which is 
anything from ruby 1.9.3 -2.3.

Did you know you can also use puppet-retrospec to generate puppet modules, 
facts, types, functions, providers, and other items?  Want something else 
generated, create a feature request. 

You can install using: gem install puppet-retrospec

https://github.com/nwops/puppet-retrospec 
<https://github.com/nwops/puppet-retrospec>


enjoy.


Corey Osman
NWOps (A devops / puppet consulting company)

-- 
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/E2A4E05A-C084-4843-9B4E-02CFF19BBED9%40nwops.io.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Announce: puppet-repl v0.3.0 easiest way to learn the puppet language

2016-07-05 Thread Corey Osman


On Tuesday, July 5, 2016 at 11:01:01 AM UTC-7, Zee Alexander wrote:
>
> This is such great work Corey! Thank you!
>
> Especially useful for checking default parameter values for resource types:
>
>
> <https://lh3.googleusercontent.com/-TaJLEzAdt5g/V3v1nb6hQxI/Aks/9EwlmH_lhXcUCKswmH4A4Lxk3NkdRNrjwCLcB/s1600/2016-07-05-105613_1920x1080_scrot.png>
>
> I'm curious - how much does this tool depend on having Facter functional 
> as a Ruby gem? Given that facter is no longer shipped as a gem, and will 
> presumably break at some point with newer and newer versions of Puppet 
> (although I have no idea when).
>

The tool itself does not explicitly require facter, but it does require 
puppet which in turn requires facter and hiera. As long as there is a 
puppet gem present there shouldn't be any need to install facter since it 
would already be present.  

>
> -Zee
>
> On Monday, July 4, 2016 at 4:55:45 PM UTC-7, Corey Osman wrote:
>>
>> I am happy to announce the next release of the puppet-repl is now 
>> available.  This version now allows you to create functions, classes, and 
>> defines and use them right away in the same repl session.  While this is a 
>> small update, this release opens 
>> the door for complete manifest loading from external sources and live 
>> debugging provided dependent code is in the module path. 
>>
>> You can test this out using the web version here:  (doesn’t work with 
>> safari)
>>
>> https://www.puppet-repl.com/play?url=https://gist.github.com/logicminds/c1733683c94de7e22c9ffe0d237bc376
>>
>> or via CLI: prepl -p 
>> https://gist.github.com/logicminds/c1733683c94de7e22c9ffe0d237bc376
>>
>> If you have ever wanted to test out the new puppet language features like 
>> native functions now is your chance.
>>
>> Get out there and play in your own sandbox via the web version. 
>> https://www.puppet-repl.com
>>
>> or install locally with access to all your favorite puppet modules.
>>
>> gem install puppet-repl
>>
>> Supports Puppet 3.8+
>>
>> https://github.com/nwops/puppet-repl
>>
>>
>> Corey Osman
>> NWOps (A devops / puppet consulting company)
>>
>>
>>
>>
>>

-- 
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/13c1cd26-b506-47c2-9a22-dd38225985b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: puppet-repl v0.3.0 easiest way to learn the puppet language

2016-07-04 Thread Corey Osman
I am happy to announce the next release of the puppet-repl is now available.  
This version now allows you to create functions, classes, and defines and use 
them right away in the same repl session.  While this is a small update, this 
release opens 
the door for complete manifest loading from external sources and live debugging 
provided dependent code is in the module path. 

You can test this out using the web version here:  (doesn’t work with safari)
https://www.puppet-repl.com/play?url=https://gist.github.com/logicminds/c1733683c94de7e22c9ffe0d237bc376
 
<https://www.puppet-repl.com/play?url=https://gist.github.com/logicminds/c1733683c94de7e22c9ffe0d237bc376>

or via CLI: prepl -p 
https://gist.github.com/logicminds/c1733683c94de7e22c9ffe0d237bc376 
<https://gist.github.com/logicminds/c1733683c94de7e22c9ffe0d237bc376>

If you have ever wanted to test out the new puppet language features like 
native functions now is your chance.

Get out there and play in your own sandbox via the web version. 
https://www.puppet-repl.com <https://www.puppet-repl.com/>

or install locally with access to all your favorite puppet modules.

gem install puppet-repl

Supports Puppet 3.8+

https://github.com/nwops/puppet-repl <https://github.com/nwops/puppet-repl>


Corey Osman
NWOps (A devops / puppet consulting company)




-- 
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/877F4B83-9C70-4C81-8883-38ECC9748B99%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME cryptographic signature


[Puppet Users] Re: Is there a way to publish a module via the Forge API?

2016-05-20 Thread Corey Osman
Have you seen the dpl gem?

https://github.com/travis-ci/dpl#puppet-forge


Corey

On Thursday, May 19, 2016 at 9:51:38 PM UTC-7, Amos Shapira wrote:
>
> Hello,
>
> I didn't find a way to upload a module to the Forge using the Forge API. 
> Is this possible?
>
> I find it a bit weird that a tool which advocates "infrastructure as code" 
> doesn't cater for options to script module uploads.
>
> Am I missing something?
>
> Thanks.
>

-- 
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/f85e8e2c-906b-4f75-8cba-2ed1ffd1d6ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: puppet-repl 0.2.0 and a new web version too

2016-05-17 Thread Corey Osman
Please to announce the next release of puppet-repl.  The only REPL for the 
puppet language.

The big feature with this release is remote node functionality. 

Ever wanted to see the node classification, facts and other variables the 
master uses to compile with?  
The puppet-repl makes this easy.  Test your local code with real node info 
without ever deploying your broken code.

https://github.com/nwops/puppet-repl#remote-nodes 
<https://github.com/nwops/puppet-repl#remote-nodes>  (Some initial config 
required)

You can even test hiera lookups.
https://github.com/nwops/puppet-repl#setting-the-puppet-log-level 
<https://github.com/nwops/puppet-repl#setting-the-puppet-log-level>  (Some 
initial config required)

Wish there was a way to start a pry like repl session?  Now you can!
https://forge.puppet.com/nwops/repl <https://forge.puppet.com/nwops/repl>

Not quite sure you want to install this gem yet?  No fear check out the web 
version.  
https://www.puppet-repl.com/ <https://www.puppet-repl.com/>  (yes, I know about 
the certificate error).  Curious how quickly this will break on a the heroku 
hobby dyno.


Requires puppet 3.8+ in your development machine

gem install puppet-repl


DON’T RUN IN PRODUCTION, THIS IS A DEVELOPMENT TOOL ONLY!  AND DON’T DEVELOP IN 
PRODUCTION!

https://github.com/nwops/puppet-repl 
<https://github.com/nwops/puppet-repl#remote-nodes>

Corey Osman
NWOps 

-- 
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/1656D1C6-C10D-41E2-AC6D-30CEE0BE8BA3%40nwops.io.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Types auto generator

2016-04-09 Thread Corey Osman
I have taken a stab at generating types, providers and other items with 
puppet-retrospec.

Take a look at https://github.com/nwops/puppet-retrospec

retrospec puppet new_type -h

Generates a new type with the given name, parameters, and properties.
  -n, --name=   The name of the type you wish to create
  -p, --parameters=A list of parameters to initialize your type with
   (default: name)
  -a, --properties=A list of properties to initialize your type with
   (default: )
  -r, --providers= A list of providers to create and associate with
   this type (default: default)
  -h, --help   Show this message


Corey

On Thursday, April 7, 2016 at 9:23:51 AM UTC-4, Christoph Andreas Torlinsky 
wrote:
>
> Hello there, i'm looking for a puppet types generator tool / toolkit as we 
> have an API (Restful interface) and spec files that we would like
> to convert to puppet types for some use. If anyone has any tips, that is 
> most welcomed. 
>
> many thanks, 
>
> c
>
>

-- 
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/2e1fcebc-e5b9-451a-a75b-993e87a58682%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Announce: A REPL for the puppet language

2016-02-20 Thread Corey Osman
The gem requires puppet 3.8+.  So whatever version of ruby puppet runs on 
is supported by puppet-repl. 

If you want to run ruby 2.3 I would suggest using puppet 4.3+.   But I am 
not even sure puppet 4.3 runs on ruby 2.3 yet. 

On Friday, February 19, 2016 at 3:04:39 PM UTC-8, Corey Osman wrote:
>
> Hi,
>
> I created a REPL for the puppet language this week. This is something that 
> has been lacking for quite some time.  
>
>
> https://github.com/nwops/puppet-repl
>
> Install: gem install puppet-repl
> bash$ prepl
>
>
> It is currently at version 0.0.1 but is still very functional. 
>
>
> MacBook-Pro-2~ % prepl
> Puppet Version: 4.2.2
> Puppet Repl Version: 0.0.1
> Created by: NWOps 
> Type "exit", "functions", "types", "reset", "help" for more information.
>
> >> $hostname = 'node123.company.com'
>  => node123.company.com
> >> $hostname =~ /node/
>  => true
> >> split($hostname, 'node')
>  => ["", "123.company.com"]
> >> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { 
> file{$file_path: ensure => present}}
>  => ["/tmp/test1", "/tmp/test2"]
> >> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { 
> file{$file_path: ensure => present}}
>  => Evaluation Error: Error while evaluating a Resource Statement, 
> Duplicate declaration: File[/tmp/test1] is already declared in file :1; 
> cannot redeclare at line 1 at line 1:57
> >>
>
>
>
> Corey
>
>
>
>

-- 
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/a0f8f102-10db-4eec-9862-6d162b718ed5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: A REPL for the puppet language

2016-02-19 Thread Corey Osman
Hi,

I created a REPL for the puppet language this week. This is something that has 
been lacking for quite some time.  


https://github.com/nwops/puppet-repl 

Install: gem install puppet-repl
bash$ prepl


It is currently at version 0.0.1 but is still very functional. 


MacBook-Pro-2~ % prepl
Puppet Version: 4.2.2
Puppet Repl Version: 0.0.1
Created by: NWOps 
Type "exit", "functions", "types", "reset", "help" for more information.

>> $hostname = 'node123.company.com'
 => node123.company.com
>> $hostname =~ /node/
 => true
>> split($hostname, 'node')
 => ["", "123.company.com"]
>> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { file{$file_path: 
>> ensure => present}}
 => ["/tmp/test1", "/tmp/test2"]
>> ['/tmp/test1', '/tmp/test2'].each |String $file_path| { file{$file_path: 
>> ensure => present}}
 => Evaluation Error: Error while evaluating a Resource Statement, Duplicate 
declaration: File[/tmp/test1] is already declared in file :1; cannot redeclare 
at line 1 at line 1:57
>>



Corey



-- 
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/5D035294-B3D9-450B-A0E3-4882858B2008%40nwops.io.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: r10k database backend

2016-01-26 Thread Corey Osman
Yea, I don't see why you couldn't reach out to a redis instance and grab 
the data and then generate the puppetfile.   Curious if there is a way to 
get the current branch that r10k would be using at time of execution?

On Tuesday, January 26, 2016 at 10:27:58 AM UTC-8, Patrick Lesher wrote:
>
>
>
> On Tuesday, January 26, 2016 at 5:09:11 AM UTC-8, Clayton O'Neill wrote:
>>
>> On Monday, January 25, 2016 at 6:48:07 PM UTC-5, Patrick Lesher wrote:
>>
>>> Has anyone thought about or tried to have r10k run against a mysql 
>>> backend to populate at least the information the puppetfile gives?
>>>
>>> Updating each puppetfile for a large number of “Environments” can be 
>>> burdonsome when we have to update the version on a number of modules.  We 
>>> already have all of our hiera data in a mysql backend and would like to try 
>>> to simplify some processes.
>>>
>>
>> The Puppetfile is Ruby, so in theory you can just access the database 
>> directly form the Puppetfile and loop over the results creating new module 
>> entries.  We do something similar to read a list of modules from a YAML 
>> file with something like this:
>>
>> # This loads the YAML file that Jenkins maintains of the latest commits
>> # approved through Gerrit.
>> PUPPET_DIR = ENV['PUPPET_DIR'] || '/etc/puppet'
>> PUPPETFILE_YAML = File.join(PUPPET_DIR, 'Puppetfile.yaml')
>> if File.readable?(PUPPETFILE_YAML)
>>   require 'yaml'
>>   data = YAML.load_file(PUPPETFILE_YAML)
>>   data['modules'].each_pair do |modulename, moduledata|
>> mod modulename, :git => moduledata['git'], :commit => moduledata[
>> 'ref']
>>   end
>> end 
>>
>>
> Thank you!  That's a really interesting idea that I will look into.
>
> Garrett,  the current process of keeping the Puppet file in git works 
> fine, the problem is that after a release we might have to update 5-15 
> places in 10+  environments.  I have some of it scripted but would like to 
> have a central place to keep the versions for reporting and ease of 
> updating.
>
> Thanks!
> --Patrick
>
>

-- 
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/88f506d5-39e2-4d77-9598-68a45b7706f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Announce: puppet-retrospec release 0.12.0 - generate modules, facts, functions, types, providers and schemas easily

2016-01-26 Thread Corey Osman
Puppet 4 is "supported" when using --enable-future-parser, retrospec will 
create everything needed to test puppet4 except for the actual tests blocks 
for classes and defines.  If you have a bunch of parameters to mock 
retrospec will generate the let(:params) block.   All the new generators 
don't care about puppet versions since they are 100% ruby code.

The next version I will be rewriting the retrospec parser to parse puppet 4 
and puppet 3 code and generating a much larger set of tests and aiming for 
99% coverage.   


Corey

On Tuesday, January 26, 2016 at 9:54:13 AM UTC-8, Jo wrote:
>
> Implied but not explicit … Puppet 4 supported now?
>
> On Jan 26, 2016, at 8:59 AM, Corey Osman  > wrote:
>
> Happy to announce that release 0.12.0 of puppet-retrospec is now 
> available.   Its taking me a long time to get this ready and this is a huge 
> feature update, but retrospec is now even more useful.  Retrospec can now 
> automatically generate some of the more complex puppet module files like 
> facts, functions (v3, v4), types, providers and something new I call 
> schemas for mapping all your parameters for future validation and auto doc 
> scripts. 
>
>
> To use, just run the following:
>
> 1. gem install puppet-retrospec
> 2. cd your_module
> 3. retrospec puppet
>
> https://github.com/nwops/puppet-retrospec
>
>
> Note:  Many modules on the forge do not have tests for functions, types, 
> providers, or facts. So if you find a module without test files, retrospec 
> will generate them for you.
>
>
> Got a problem with what retrospec generates, fork or send a PR here: 
> https://github.com/nwops/retrospec-templates
>
>
>
> Corey Osman
>
>  
>
> -- 
> 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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/CA63D3D0-DAE4-45AE-B1FA-68A5135D492B%40nwops.io
>  
> <https://groups.google.com/d/msgid/puppet-users/CA63D3D0-DAE4-45AE-B1FA-68A5135D492B%40nwops.io?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> Jo Rhett
> Net Consonance : net philanthropy to improve open source and 
> internet projects.
>
>

-- 
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/ab91cc6d-f2e5-459f-b4bf-78770d55c32b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: puppet-retrospec release 0.12.0 - generate modules, facts, functions, types, providers and schemas easily

2016-01-26 Thread Corey Osman
Happy to announce that release 0.12.0 of puppet-retrospec is now available.   
Its taking me a long time to get this ready and this is a huge feature update, 
but retrospec is now even more useful.  Retrospec can now automatically 
generate some of the more complex puppet module files like facts, functions 
(v3, v4), types, providers and something new I call schemas for mapping all 
your parameters for future validation and auto doc scripts. 


To use, just run the following:

1. gem install puppet-retrospec
2. cd your_module
3. retrospec puppet

https://github.com/nwops/puppet-retrospec 
<https://github.com/nwops/puppet-retrospec>


Note:  Many modules on the forge do not have tests for functions, types, 
providers, or facts. So if you find a module without test files, retrospec will 
generate them for you.


Got a problem with what retrospec generates, fork or send a PR here: 
https://github.com/nwops/retrospec-templates 
<https://github.com/nwops/retrospec-templates>



Corey Osman

 

-- 
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/CA63D3D0-DAE4-45AE-B1FA-68A5135D492B%40nwops.io.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom provider woes and questions

2015-12-08 Thread Corey Osman
I'll be releasing a type/provider generator that creates these files with 
basic code and unit tests in the next release of puppet-retrospec.  You can 
use right now if you want to compile the gem 
yourself. https://github.com/nwops/puppet-retrospec/tree/development. 

Types and providers are documented pretty good inside the source code, so 
if your editor allows you to click on Parent classes and such (Rubymine) 
its a little bit easier to see how things work and the Puppet Types and 
Providers book by Nan Liu and Dan Bode is well written and can help explain 
many things in a somewhat concise way. 


Corey
On Monday, December 7, 2015 at 6:54:19 AM UTC-8, Salty Old Cowdawg wrote:
>
> This email has two parts:
>
> First part
>
> Looking at "Sh*t Gary Says" seems to imply I may be going about creating 
> custom types/providers.  I am currently creating a type under 
> lib/puppet/type/{typename}.rb without that logic doing anything with the 
> actual logic being in lib/puppet/provider/{typename}/ruby.rb which has 
> worked fine for me in the past.  
>
> Someone confirm/deny.
>
> Second part 
>
> I've created a pair of custom types/providers, one to set parameters and 
> the other to set state.   The issue I'm running into is the state provider 
> is trying to work and the parameter provider doesn't even seem to be 
> loading in Puppet at all without any sort of error showing up.
>
> Here is how they are being invoked in a manifest:
>
> myparmtype { 'instance':
> parm1=>'value1',
> parm2=>'value2'
> } 
> -> 
> mystatetype{'instance':
>state =>'mystate'
> } 
>
> Sorry for the obfuscation, but what I'm working on is largely company 
> proprietary. 
>
> Thoughts anybody?   
>
> Is there a limit to the number of types/providers a module can have?
>
>

-- 
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/4cef242b-845a-4ef9-9ffb-01eb4b24f59e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Still mud-wrestling with spec testing

2015-11-28 Thread Corey Osman
You should use my tool that retrofits all the files you need in your module 
automatically for spec testing.  

https://github.com/nwops/puppet-retrospec

gem install puppet-retrospec
cd your_favorite_module
retrospec puppet
bundle install
bundle exec rake spec

If you question a previous file you created is not right, just delete and 
re-run retrospec to have it automatically re-created according to the 
retrospec templates.

This tool isn't meant to automate the learning process, it just helps 
immensely with repetitive tasks.   So you will still need to learn quite a 
bit to understand unit testing.


Corey

On Friday, November 27, 2015 at 3:23:49 PM UTC-5, Salty Old Cowdawg wrote:
>
> So, 
>
> Now that my schedule has some slack in it I've turned my attention back to 
> doing spec testing of my Puppet modules.  Taking a really really simple 
> module that I wrote as an example I started in again.
>
> Here is the one and only file making up the class.  
>
> -- init.pp --
> class ntp {
>
>   package { 'ntp':
> ensure => latest
>   }
>   service { 'ntp':
> ensure  => running,
> enable  => true,
> require => Package[ntp]
>   }
> 
>
> }
> -
>
> That should be really easy to run tests against in my opinion.  I wrote a 
> Gemfle for the occasion.
>
> -Gemfile---
> source 'https://rubygems.org'
>
> puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" 
> : ['>= 3.3']
> gem 'puppet', puppetversion
> gem 'puppetlabs_spec_helper', '>= 0.1.0'
> gem 'puppet-lint', '>= 0.3.2'
> gem 'facter', '>= 1.7.0'
> gem 'rake','>= 0.0.0'
> gem 'spec','>= 0.0.0'
> 
> and my spec file looks like this: 
>
> --- spec/classes/init_spec.rb ---
> require 'spec_helper'
> describe 'ntp', :type => 'class' do
>
>   context 'On Debian' do
> let :facts do {
>  :osfamily => 'Debian'
> }
> end
>   
>   it {
> should contain_package('ntp').with({ 'name' =>  'ntp' })
> should contain_service('ntp').with({ 'name' => 'ntp' })
>   }
> end
> 
> end
> ---
>
> and when I run "rake spec" I get this (severely trimmed) set of errors:
> -errors--
>  1) ntp On Debian should contain Package[ntp] with name => "ntp"
>  Failure/Error: should contain_package('ntp').with({ 'name' =>  'ntp' 
> })
>  
>  ArgumentError:
>wrong number of arguments (2 for 1)
> 
>
> Looks to me after reading "The Next Generation of Puppet Module Testing" 
>  at this page: 
> https://puppetlabs.com/blog/the-next-generation-of-puppet-module-testing
> there should only be one argument to  "with" so.. if that's not an 
> authoritative page for that information, which one is? 
>
> Can somebody clarify for me what;s going on here?
>
>
>

-- 
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/624d92fe-7175-4fb4-9f08-81f467053a02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Migrating to future parser (on 3.8) in preparation for upgrade to 4.0

2015-11-26 Thread Corey Osman
It looks like your doing parameter validation the old fashioned way.  So 
there is no reason to have complicated validation code when it can be done 
easier using parameter data types and runtime validation.  The easiest way 
is to validate $ensure is to use data types like Enum.  Check out the data 
type feature in the future parser which would negate the need to use the 
conditional logic in your original example.  Another way without using the 
future parser would be to use stdlib validate_XX functions.

https://docs.puppetlabs.com/puppet/4.3/reference/lang_data_abstract.html#enum

Example class
class foo(Enum['present', 'absent'] $ensure = 'present'){
   file{'/tmp/foo.txt':
 ensure => $ensure,
 content => 'bar'
   }
}


Corey
On Tuesday, November 24, 2015 at 3:03:04 PM UTC-5, Matthew Ceroni wrote:
>
> Working on migrating my manifests to work with Puppet 4.0. Currently on 
> 3.8 and have started to experiment with the future parser (probably not so 
> much future anymore).
>
> I am stuck on an error that is being reported.
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Evaluation Error: Error while evaluating a Function Call, ensure parameter 
> must be specified at 
> /etc/puppet/environments/sandbox/modules/sudo/manifests/init.pp:51:2 on 
> node op1227
>
> The code is a simple check and fail if not met
>
> if ! ($ensure in [ 'present', 'absent' ]) {
> fail("sudo 'ensure' parameter must be set to either 'absent' or 
> 'present'")
> }
>
> It isn't liking something about the function call fail. 
>
> Any help would be appreciated.
>
> Thanks
>
>

-- 
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/b00b1faf-13cb-46ff-83e4-b60205fe45e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to install r10k for puppet 2.7 on RHEL?

2015-10-26 Thread Corey Osman
puppet 2.7 was so two years ago.  The cool kids are using 4.x now.

You need to install the puppetlabs yum repo to get the latest.  Should be 
fairly simple on RHEL 5 since we now have the puppet AIO packages (ruby, 
puppet, and other stuff bundled).


Corey

On Monday, October 26, 2015 at 2:57:18 AM UTC-7, Wei Chen wrote:
>
> Hi,
>
> I use RHEL 5.6 PS. I've installed the puppet 2.7 via RedHat Satellite. 
> This could be the old bersion. I am not sure if there is r10K for this old 
> version. If yes, where to get it and install it?
>
> Sorry for my question. I am new to puppet. 
>
>
> Wei
>

-- 
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/e2f38c26-d94f-4dde-8507-65dda5beef38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Install Puppet as Docker CLI image

2015-10-20 Thread Corey Osman
I maintain some public docker images geared towards puppet development.   
They are based off of centos, and use gems to install puppet. 

I have packed the image just about every gem needed for development. 
(https://github.com/logicminds/docker-centos-puppetdev/blob/latest/scripts/puppet-bootstrap/Gemfile)

Images: https://hub.docker.com/r/logicminds/centos-puppetdev/

Blog Article on usage: 
http://logicminds.github.io/blog/2015/05/28/leveraging-docker-for-puppet-development/


Corey
On Monday, October 19, 2015 at 4:37:05 PM UTC-7, Justin Jackson wrote:
>
> Hi all, 
>
> I am trying to set up the standalone puppet as a docker image to be used 
> as a CLI. I am doing this so that my colleagues and I can share the same 
> "environment" for running puppet on our different platforms of choice. We 
> are using Mac, Linux (Ubuntu 14+) and Windows (8 and 10). We basically run 
> puppet apply .pp. My Dockerfile is pretty simple up till now:
>
> RUN \
>   sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
>   apt-get update && \
>   apt-get -y upgrade && \
>   apt-get install -y build-essential && \
>   apt-get install -y software-properties-common && \
>   apt-get install -y byobu curl git unzip wget && \
>   rm -rf /var/lib/apt/lists/*
>
> RUN apt-get -y install rubygems
> RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
> RUN gem install puppet librarian-puppet 
>
>
>  However, when we try to run puppet against our .pp files, we are seeing some 
> issues such as something to do with plist.. and we can't yet get our created 
> docker image to "apply" a simple test.pp. 
>
>
> Are there other libraries we would need to install perhaps? I would have 
> thought the librarian-puppet does the trick.. or maybe there is some 
> configuration we need to adjust?
>
>
> Thanks for any help.
>
>
>

-- 
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/185b4253-2eab-4905-9ab1-73d0480bc808%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] ANNOUNCE: puppet-retrospec -- automate your unit test creation and other cool stuff

2015-10-05 Thread Corey Osman
I'll be at the contributor summit and conference on thursday-friday. 

Whats the best way to get a hold of you?

Corey

On Friday, October 2, 2015 at 4:08:58 PM UTC-7, Henrik Lindberg wrote:
>
> On 2015-01-10 7:24, Corey Osman wrote: 
> > Last year I had an idea to create a tool to automate the buildout of 
> puppet unit tests by inspecting puppet code inside puppet manifests. Along 
> with this idea I also wanted to retrofit any puppet module with the latest 
> best practices, gems, rake commands and other stuff in development within 
> the community. So today I am releasing a revamped version of this tool in 
> the form of a retrospec plugin. 
> > 
> > I am happy to announce availability of this tool for mass consumption. I 
> have been using my own tool over the past few months almost every day and I 
> can no longer keep this tool a secret as I know it will save you hours of 
> time and frustration. 
> > 
> > The reason I built this tool is simply because unit testing is too 
> difficult for the average puppet coder. There are just too many blogs, ruby 
> versions, gems, and other tools to learn. When I first started unit 
> testing, 
> > I documented my problems and setup procedures and eventually committed 
> them to code to make them easily reproducible. I have reduced the typical 
> learning curve of several weeks down to a few simple key strokes. 
> > 
> > I’m confident that you will love this tool and use it everyday to assist 
> in the creation of your modules. 
> > 
> > To get started: 'gem install puppet-retrospec && retrospec puppet' 
> inside your favorite puppet module directory. 
> > 
> > https://github.com/nwops/puppet-retrospec  (puppet module unit test 
> generator plugin) 
> > 
> > https://github.com/nwops/retrospec  (file generator framework) 
> > 
> > 
> > Corey 
> > 
>
> Hi Corey, the tool looks really cool. If you are at Puppet Conf next 
> week, hit me up and I can help with getting this working for 4.x (and 
> future parser in 3.8). You should be able to support both just like 
> puppet does. 
>
> Regards 
> - 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/e139c89a-7db0-4548-81e1-63f7532e3319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] ANNOUNCE: puppet-retrospec -- automate your unit test creation and other cool stuff

2015-09-30 Thread Corey Osman
Last year I had an idea to create a tool to automate the buildout of puppet 
unit tests by inspecting puppet code inside puppet manifests. Along with this 
idea I also wanted to retrofit any puppet module with the latest best 
practices, gems, rake commands and other stuff in development within the 
community. So today I am releasing a revamped version of this tool in the form 
of a retrospec plugin. 

I am happy to announce availability of this tool for mass consumption. I have 
been using my own tool over the past few months almost every day and I can no 
longer keep this tool a secret as I know it will save you hours of time and 
frustration. 

The reason I built this tool is simply because unit testing is too difficult 
for the average puppet coder. There are just too many blogs, ruby versions, 
gems, and other tools to learn. When I first started unit testing, 
I documented my problems and setup procedures and eventually committed them to 
code to make them easily reproducible. I have reduced the typical learning 
curve of several weeks down to a few simple key strokes. 

I’m confident that you will love this tool and use it everyday to assist in the 
creation of your modules. 

To get started: 'gem install puppet-retrospec && retrospec puppet' inside your 
favorite puppet module directory. 

https://github.com/nwops/puppet-retrospec  (puppet module unit test generator 
plugin)  

https://github.com/nwops/retrospec  (file generator framework)


Corey

-- 
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/E05FECE0-341D-4EAD-A5D1-EE1D68BF271C%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME cryptographic signature


[Puppet Users] Re: Can we lookup hiera data object providing the file name

2015-09-23 Thread Corey Osman
You should be able to just use the normal hiera syntax.  example: 
hiera('nodes', 'default_value', 'nodes/host1234')

Documented here:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/functions/hiera.rb

Also, its bad practice to lookup hiera from within a template. Put the 
value in a puppet variable and then just use the variable in the template.
This way the next person will not have to troubleshoot your template.

Corey
On Tuesday, September 22, 2015 at 11:48:33 PM UTC-7, Malintha Adikari wrote:
>
> I am using hiera lookup as follows in my puppet template
>
> <%- nodeinfo = scope.function_hiera(['nodes']) -%>
>
> I have provided the .yaml file which includes above 'nodes' object in my 
> hiera.yaml file ( that is inside nodesfile.yaml file which is dynamically 
> loaded as follows)
>
> ---
> :backends:
>   - yaml
> :yaml:
>   :datadir: /etc/puppet/hieradata
> :hierarchy:
>   - "%{::nodes_file}
>   
>
> I have want to load another data object into my puppet template but the 
> problem is that data object is in a .yaml file which is not registered in 
> my hiera.yaml file. I cannot register that file in my hiera.yaml. 
>
> Is there anyway to load data object providing the file along with the 
> lookup method. I do know the .yaml file name that object is in ?
>

-- 
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/e55a62e7-b470-4e94-acdf-d53d57ae0fa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Digest for puppet-users@googlegroups.com - 2 updates in 1 topic

2015-09-14 Thread Corey Osman
I have actually used audit quite extensively at a previous client.
Although most of that requirement can be replaced with a custom type and
provider.  It was definitely good to use for triggering exec calls.
On Sep 14, 2015 4:15 AM,  wrote:

> puppet-users@googlegroups.com
> 
>  Google
> Groups
> 
> 
> Topic digest
> View all topics
> 
>
>- Do you use Audit attribute or "puppet inspect" ?
><#14fcb918cedbe472_group_thread_0> - 2 Updates
>
> Do you use Audit attribute or "puppet inspect" ?
> 
> Jo Rhett : Sep 14 02:01AM -0700
>
> I have numerous clients using the audit attribute to track changes to
> files not managed by Puppet. This provides tripwire-like functionality for
> observing changes to files not directly managed by Puppet. It also allows
> for backing up each version of the file to the file bucket.
>
> Therefore I was a bit shocked to find that they planned to drop support
> for this entirely, as per https://tickets.puppetlabs.com/browse/PUP-893 <
> https://tickets.puppetlabs.com/browse/PUP-893>
>
> If you make use of audit or “puppet inspect”, or would like to use the
> functionality provided for tripwire-like tracking of resource changes,
> please add your comments to this issue.
>
> If you have been unable to get “puppet inspect” working with recent Puppet
> 3 or Puppet 4 versions, you may want to track
> https://tickets.puppetlabs.com/browse/PUP-5233 <
> https://tickets.puppetlabs.com/browse/PUP-5233>
>
> --
> Jo Rhett
> Net Consonance : net philanthropy to improve open source and internet
> projects.
> Trevor Vaughan : Sep 14 05:45AM -0400
>
> Honestly, I don't know of anyone using the audit functionality. However, I
> have only really dealt with Operating Systems that have excellent real-time
> Audit subsystems built in.
>
> Also, using Puppet to audit large recursive directories is quite slow and
> will bloat your catalog to no end.
>
> Thanks,
>
> Trevor
>
>
> --
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
>
> -- This account not approved for unencrypted proprietary information --
> Back to top <#14fcb918cedbe472_digest_top>
> You received this digest because you're subscribed to updates for this
> group. You can change your settings on the group membership page
> 
> .
> To unsubscribe from this group and stop receiving emails from it send an
> email to puppet-users+unsubscr...@googlegroups.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/CAO19zWgvidm1pzfb89R2qZnXZFSb37p_5r5mKi7eFZUNMvETmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Is there a method for puppet to find all suid files?

2015-09-08 Thread Corey Osman
I am using a custom type called assert that flags the report if any of the 
facts did not pass. I would agree that these items should be captured 
in a monitoring platform, but I don't have access to the monitoring 
platform to make these changes and if it were that easy I am sure 
it would have been implemented in the monitoring system already.  However 
collecting 30 POIs per node on a proprietary, super expensive monitoring 
system would probably somehow cost an additional 30K (I have no factual 
data to back this claim up). 


Some of the benefits of using a fact are:

- A single interface to run all the scripts  (there is 30+ facts that I 
have)  ( so I can tell anybody to just run facter to get the results)
- Can use the fact value to make decisions in puppet code, although really 
we just use the assert type
- Can get the results of all these 30+  tests via mcollective facts instead 
of running each test individual  across many nodes.
- From an auditing standpoint its pretty handy to know when the facts 
changed values in the reports which are stored for 30+ days.
  and what helped make the change.
 

assert{'suid_test':
  condition => $suid_test == 'pass',
  message   => 'Suit test did not pass'
}


Sean,

To wrap all these discussions up.  You can do the following:

1. cache the result of find like I did in the script and not care how or 
when the script is run, nor maintain a cron job for it.
2. run a cron job and configure the script to run when you need it to, then 
write a fact around the value of the result
3. use a monitoring system to poll for these values, and configure which 
values are to be stored

On Tuesday, September 8, 2015 at 5:50:58 AM UTC-7, Trevor Vaughan wrote:
>
> Just out of curiosity, what's the benefit of making this a fact?
>
> I'm thinking that this would be better relegated to a monitoring system, 
> not a configuration management system.
>
> (Yes, you can use Puppet as a monitoring system but that's not really what 
> it is designed for and you'll end up slowing everything down over time.)
>
> Thanks,
>
> Trevor
>
> On Tue, Sep 8, 2015 at 12:15 AM, Corey Osman  > wrote:
>
>> As Trevor mentioned above this is something you want to control 
>> externally via cron and not puppet. I took a slightly different approach 
>> and used an external fact which allowed be to write a fact in bash.  There 
>> is no reason why you couldn't do this in a Ruby based fact but since all 
>> the original code was written in bash I used external facts simply to save 
>> time. 
>>
>> https://gist.github.com/logicminds/2389d980f00333dcb48d
>>
>> The key item is that this fact alone takes 37 seconds to run so I decided 
>> to cache the result for 12 hours which obviously speeds up fact values 
>> retrieval. 
>>
>> I wasn't crazy about having a bunch of random cron jobs to cache the 
>> value of 10+ facts so I built the control mechanism into the fact code 
>> itself so that it doesn't rely on cron or some other service.  
>>
>> Hit me up privately as I might have more code to share that could be 
>> useful to you. 
>>
>> Corey
>> On Sunday, September 6, 2015 at 7:22:28 AM UTC-7, Trevor Vaughan wrote:
>>>
>>> This rule will let you know when an SUID binary is *executed* 
>>> https://github.com/simp/pupmod-simp-auditd/blob/master/templates/base.erb#L50:L55
>>> .
>>>
>>> I would not run any filesystem searches from Puppet, I would relegate 
>>> those to cron+syslog so that you can better control the amount of I/O churn 
>>> on your system over time.
>>>
>>> Thanks,
>>>
>>> Trevor
>>>
>>> On Fri, Sep 4, 2015 at 2:54 PM, Sean  wrote:
>>>
>>>> Hi,
>>>>  
>>>> I'm using a module from the Forge to manage auditd rules, the module 
>>>> works quite well and managing rules is very easy.  The hard part is that 
>>>> there's a requirement to audit use SUID files on each system.  With out 
>>>> knowing exactly what files are SUID on every server in the field, since 
>>>> there are several linux flavors and versions, I'm finding myself thinking 
>>>> the only way to accomplish this is to write a custom fact to hold all the 
>>>> SUID files as an array, then pass the array to the resource creator.  I 
>>>> just don't relish the idea of running a find command from / every 30 
>>>> minutes.
>>>>
>>>> Might anyone have any better ideas?
>>>>
>>>> Thank you kindly!
>>>>
>>>> -

Re: [Puppet Users] Is there a method for puppet to find all suid files?

2015-09-07 Thread Corey Osman
As Trevor mentioned above this is something you want to control externally 
via cron and not puppet. I took a slightly different approach and used an 
external fact which allowed be to write a fact in bash.  There is no reason 
why you couldn't do this in a Ruby based fact but since all the original 
code was written in bash I used external facts simply to save time. 

https://gist.github.com/logicminds/2389d980f00333dcb48d

The key item is that this fact alone takes 37 seconds to run so I decided 
to cache the result for 12 hours which obviously speeds up fact values 
retrieval. 

I wasn't crazy about having a bunch of random cron jobs to cache the value 
of 10+ facts so I built the control mechanism into the fact code itself so 
that it doesn't rely on cron or some other service.  

Hit me up privately as I might have more code to share that could be useful 
to you. 

Corey
On Sunday, September 6, 2015 at 7:22:28 AM UTC-7, Trevor Vaughan wrote:
>
> This rule will let you know when an SUID binary is *executed* 
> https://github.com/simp/pupmod-simp-auditd/blob/master/templates/base.erb#L50:L55
> .
>
> I would not run any filesystem searches from Puppet, I would relegate 
> those to cron+syslog so that you can better control the amount of I/O churn 
> on your system over time.
>
> Thanks,
>
> Trevor
>
> On Fri, Sep 4, 2015 at 2:54 PM, Sean > 
> wrote:
>
>> Hi,
>>  
>> I'm using a module from the Forge to manage auditd rules, the module 
>> works quite well and managing rules is very easy.  The hard part is that 
>> there's a requirement to audit use SUID files on each system.  With out 
>> knowing exactly what files are SUID on every server in the field, since 
>> there are several linux flavors and versions, I'm finding myself thinking 
>> the only way to accomplish this is to write a custom fact to hold all the 
>> SUID files as an array, then pass the array to the resource creator.  I 
>> just don't relish the idea of running a find command from / every 30 
>> minutes.
>>
>> Might anyone have any better ideas?
>>
>> Thank you kindly!
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/e848e8ab-0a96-4934-9382-42f3b828d529%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
>
> -- This account not approved for unencrypted proprietary information --
>

-- 
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/b3f67609-2abb-431d-bd77-29860fc909ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to use multiple versions of same module

2015-07-05 Thread Corey Osman
So the end goal would be to use r10k.  However, in the midterm you need to 
do a few things.

1. Create a roles and profiles pattern for your business logic
2. version your modules inside your VCS.  So basically you can create a 
nginx_profile1_2, nginx_profile_1_3, ... as well as a nginx_1_1 and 
nginx_1_2 that way you can mix and match module versions with profile 
versions and then slowly remove the legacy code once all your nodes have 
been migrated off the legacy code.  You would still have a mono repo but at 
least you don't have to worry about backwards compatibility because each 
module is versioned inside your VCS.  Obviously this will create a lot more 
modules but it gives you some flexibility. 

Now you could put all these "versioned modules" inside R10K as well to give 
you even more flexibility but I think you would want to stick with one 
environment as having all these versioned modules will introduce unwanted 
complexity when you have multiple environments.

This used to be a good pattern before r10k and librarian-puppet came onto 
the market.


Corey

On Saturday, July 4, 2015 at 5:10:44 PM UTC-7, Eric Berg wrote:
>
> Seems like a problem that people run into all the time, but I haven't 
> found any info on this topic that is in the least satisfying.
>
> I have a monolithic puppet repo that is several years old, and which has 
> one main "module" with several dozen manifests along with files and 
> templates.  Currently, this code uses 3rd party/forge modules that are 
> pretty old, and I'd like to update the 3rd party modules (stuff like apt, 
> nginx, node, stdlib, etc...), but I need to do it selectively, since many 
> of our manifests may break in a major-version upgrade.
>
> As I create proper modules from the manifests that we have now, the 
> existing "module" should continue to use the versions they're currently 
> using and the new ones should be able to use the latest versions of these 
> modules.
>
> Simply installing modules, for example by using 'puppet module install' 
> updates the current version of the module, which resides in our git repo in 
> the modules subdir.
>
> Ultimately, it seems that we should move to librarian puppet, but I'm not 
> sure that that solves the basic problem, which is that I need to have 
> multiple versions of the same modules.
>
> How do I accomplish this?
>
> Thanks.
>
> Eric
>

-- 
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/8f6e5eb4-89d7-4163-8b66-a931c96855b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] A case for git (SVN vs Git)

2015-06-16 Thread Corey Osman


On Monday, June 15, 2015 at 7:31:08 AM UTC-7, Paul Seward wrote:
>
> On 12 June 2015 at 19:14, Ramin K > 
> wrote:
>
>>
>> Being somewhat in the middle of a similar conversation at $dayjob 
>> I believe it's a mistake to focus on the technology rather than the 
>> outcome. I would focus on workflow, integration, and tooling instead. 
>> Particularly the local branch per feature or ticket to review board to 
>> merge to release branch is flexible, powerful, and relatively easy to 
>> understand.
>>
>
> Having recently been through this (we used to use svn and have migrated to 
> git) - the workflow/tooling are definitely the thing to focus on when 
> describing it to management.
>
> Feature branch based workflow, with code reviewed merge requests (which 
> can also be queued pending review board approval if that's how you roll) 
> are an easy sell to management - and a world of pain to manage in svn.
>
> With git (and a supporting toolset like 
> github/bitbucket/gitlab/stash/whatever) that branch/merge based workflow is 
> super easy.
>
> "You'll find yourself about 900x more agile with git or the like" - 
>> Binford2k
>>
>
> branching/merging in git is really the killer feature for me.  Compared to 
> svn, branch/merge is almost so easy it's fun!
>
> Since moving from svn to git, our time-to-fix has gone down, changes are 
> easier to stage so are more predictable, and we're pushing around 3 times 
> as many changes through per week than we were able to before. Yet all those 
> changes are peer reviewed and discussed before they're merged to 
> production, in a level of detail which just wasn't possible before.
>
> It's made us more productive at a higher level of quality - and why 
> wouldn't a decision maker want that?
>
> Regarding the document linked to by the OP 
> https://github.com/logicminds/A-Case-For-Git.git - there are some claims 
> in there which stretch the truth a bit too far for my liking - eg all the 
> stuff about r10k not working with svn, or that you lock yourself out of 
> using 3rd party modules without a lot of effort.
>
>
Thanks Paul these points are awesome.  I'll be sure to update the doc.  To 
be honest I have never used SVN and R10k.  I suppose SVN wouldn't be that 
much different from a repo perspective when its listed in the Puppetfile. 
 My concern is what happens when you want to mirror all the publicly 
available modules hosted on github with only a SVN server.  Downloading 
tarballs from github/gitlab does not seem when you have 20+ modules to keep 
in sync.  Not to mention you lose all the commit history when converting 
from tarball to SVN.  I know there is a Git-SVN but I don't think there 
SVN-Git.
 

> I've never tried, but I can't see anything technologically that would stop 
> you from using svn for your local code control and still using r10k to 
> retrieve 3rd party modules via git - but the document reads like the sky 
> will fall in if I try.
>
> When I'm presenting options to management, I generally need an unbiased 
> assessment of the problem space, a description of what I'm trying to 
> achieve, and a clear, unbiased assessment of how each of the options 
> meets/misses those criteria.
>
> I would suggest starting by defining a desired workflow (eg, problem is 
> identified, development environment created, change made, change tested, 
> change queued for approval, fix merged to production) then evaluating how 
> svn and git meet those requirements in a fair unbiased manner.
>
> Obviously git will still win in any scenario which involves 
> branching/merging - but at least you'll have gone about it in a structured 
> way, and that's hard to argue against.
>
> -Paul
> -- 
> --
> Paul Seward, University of Bristol
> paul@bristol.ac.uk   +44 (0)117 39 41148GPG Key ID: 
> E24DA8A2
> GPG Fingerprint:7210 4E4A B5FC 7D9C 39F8  5C3C 6759 3937 E24D A8A2
>  

-- 
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/1566536b-5f3c-451d-b0de-930bec867a3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] A case for git (SVN vs Git)

2015-06-12 Thread Corey Osman
I have been tasked with an assignment to come up with a document for non 
technical decision makers to “chose Git over SVN”, since non technical people 
view VCS is all the same. With regards to Puppet I think its a horrible idea to 
use SVN but how do we prove it for decision makers that have no reference?.   
If you have given this argument before or want to add your advice, opinion, 
reasons, stories, feel free to clone this repo and merge your input. Spencer 
Krum has agreed to put this document into an official puppet community repo 
https://github.com/puppet-community once the document reaches a good state.   
The idea here is if you encounter this situation in the future there will be a 
document to hand to somebody to say “Here read this”.  So if you like BeerOps, 
check this out (literally).

https://github.com/logicminds/A-Case-For-Git.git


Corey

-- 
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/4CE0BADC-C41B-4427-A51A-8A82245A09BB%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] 8K node infrastructure and CA setup

2015-06-09 Thread Corey Osman
 In that diagram can you have a HA Master CA setup and HA Agent CA setup 
where there is a master and agent CA in each datacenter, but served by a 
VIP/Proxy/SRV record?  Not exactly sure how CAs work when it comes to 
redundancy. 

Corey

On Tuesday, June 9, 2015 at 12:07:17 AM UTC-4, Trevor Vaughan wrote:
>
> Hi Corey,
>
> That setup should work just fine and be even easier now that everything 
> has a solid set of certs that don't cross over at all.
>
> If you're using PE, be sure to properly generate your role certificates 
> that are used by the Console, ActiveMQ, etc...
>
> Trevor
>
> On Mon, Jun 8, 2015 at 10:25 PM, Corey Osman  > wrote:
>
>> Has anybody used this setup before?  Any caveats?
>>
>>
>> https://docs.puppetlabs.com/puppet/3.8/reference/config_ssl_external_ca.html#option-3-two-intermediate-cas-issued-by-one-root-ca
>>
>> Does this still apply when using puppet server 2.1?
>>
>>
>> Corey
>>
>> --
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/7E32D1B6-A700-4643-B210-BD0F28738B9C%40logicminds.biz
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
> tvau...@onyxpoint.com 
>
> -- This account not approved for unencrypted proprietary information --
>  

-- 
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/fb2bcf99-43ed-447d-8bc5-1f2b8db2e81f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] 8K node infrastructure and CA setup

2015-06-08 Thread Corey Osman
Has anybody used this setup before?  Any caveats? 

https://docs.puppetlabs.com/puppet/3.8/reference/config_ssl_external_ca.html#option-3-two-intermediate-cas-issued-by-one-root-ca

Does this still apply when using puppet server 2.1?


Corey

-- 
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/7E32D1B6-A700-4643-B210-BD0F28738B9C%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Multiple facts getting the same value

2015-05-15 Thread Corey Osman
I am not sure what your end goal is but it sounds like  you want to get 
information from the puppet node during catalog enforcement to use during 
the catalog compilation.  If this is the case I would recommend using a 
native type and provider to perform which executes directly on the puppet 
node where you can query in real time.  This seems like you might end up 
with thousands of facts in some cases which could cause other problems.


Corey

On Friday, May 8, 2015 at 8:42:03 AM UTC-7, James Oden wrote:
>
> I created a custom fact file to generate home_$user entries for all 
> users on the system containing their respective home directories: 
>
>require 'etc' 
>
>while pwEnt = Etc.getpwent do 
>name = pwEnt.name 
>home = pwEnt.dir 
>var  = "home_#{name}" 
>Facter.add(var) do 
>setcode do 
>home 
>end 
>   end 
>end 
>Etc.endpwent 
>
> When I use it though every home_$user entry has the same value (the 
> home directory of the last user it processed).  I can add print 
> statements and see that the loop is getting the right information. 
> What am I doing wrong or not understanding? 
>
> Thanks...James 
>

-- 
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/7e3fad09-4556-49c5-a170-ec13b1c32fe3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] create puppet module from software install

2015-05-15 Thread Corey Osman
I would agree with Branan.  You should avoid compiling source code on a 
puppet node (unless its a ruby gem).  But if you must know there is a tool 
called blueprint that will get you what you want although it may not 
capture everything or it might capture too much.  

https://github.com/devstructure/blueprint

Although I think your time would be better spent on learning fpm 
(https://github.com/jordansissel/fpm/wiki) or omnibus 
(https://github.com/chef/omnibus).  I would use omnibus since it does a lot 
more and has pre defined recipes 
(https://github.com/chef/omnibus-software/tree/master/config/software)

I would definitely go the omnibus although the learning curve is much more 
than FPM. 

Also using docker containers is a great way to compile software since you 
can put all your dependencies in a docker image.


Corey

On Thursday, May 14, 2015 at 10:39:41 AM UTC-7, Branan Purvine-Riley wrote:
>
> On Thu, May 14, 2015 at 10:11 AM, > wrote:
>
>> I have installed apache and tomcat from source in the /opt directory.  
>> Once I completed the install I modified the directory and file ownership 
>> and permissions.
>> I also modified the .conf and .xml files for both tomcat and apache.
>> Is there a way to capture a directory structure and the modifications and 
>> then create a puppet module from this info?
>> would I use puppet resource or do I need to entre the info by hand?
>> Thanks
>>
>
> I would recommend that you build a package, which you can then deploy with 
> Puppet. You may still wish to manage the configuration files separately 
> witha  module, and that's definitely find (and encouraged). Since it sounds 
> like you mostly just want to bundle up a directory, fpm[1] might be all you 
> need.
>
> Using a native package will make it much easier when you need to upgrade 
> (and you will, eventually). It will also allow easy auditing of which 
> version of the software is running on each system in your infrastructure.
>
> If for some reason you don't want to use a package (and I STRONGLY 
> recommend that you create a proper system package), you can also just make 
> a tarball and use the staging[2] or archive[3] modules to deploy it with 
> Puppet.
>
> [1] https://github.com/jordansissel/fpm
> [2] https://forge.puppetlabs.com/nanliu/staging
> [3] https://forge.puppetlabs.com/nanliu/archive
>
>
> Branan Riley
> Software Engineer, Puppet Labs
>

-- 
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/7bae71de-277a-4e8c-8e85-b23b68254215%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Anyone really using Postgres for a Hiera backend?

2015-05-14 Thread Corey Osman
What is the use case for a SQL hiera backend?  This seems like an oxymoron. 
 Do you have some sort of UI wrapped around it for data input? Also you 
could just create a data binding terminus for postgres.

example: https://github.com/domcleal/foreman_data_binding


Corey

On Wednesday, May 13, 2015 at 9:45:55 AM UTC-7, leam hall wrote:
>
> Just wondering. I found some options but don't see any under current 
> development. 
>
> Leam
>
>
> -- 
> Mind on a Mission 
>  

-- 
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/abf03f3f-f81c-4644-8563-9757be2eb585%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Open Source 4.0 version identifier vs. very different rpm and dpkg package versions

2015-04-29 Thread Corey Osman
I am glad I am not the only one who said WTF is Puppet Agent 1.0.  If in 
fact this is referring to the collection repo around running puppet agent 
AIO than it should be called Puppet Agent Collection AIO 1.0 or something 
similar.



Corey

On Monday, April 20, 2015 at 12:34:47 PM UTC-7, Vince Skahan wrote:
>
> I just set up a couple 4.0.0 virtual machines, trying to follow the 
> installation instructions as-written on the website, and found some 
> confusing things.
>
> First - can somebody explain why you're referring to the software in docs 
> with one version (4.0.0) and you have a very different versioning for the 
> rpm/deb packagesand then the --version strings of the various utilities 
> in /opt/puppetlabs/bin report something very different from either the 
> 4.0.0 version 'or' the rpm/deb package versions.
>
> Is there a reason you're not packaging for the various distros using the 
> same version identifiers your code and docs seem to use ?  Seems like a 
> gratuitous obfuscation to me.   Why would you possibly have their major 
> versions so different from what 'foo --version' reports ?
>
> #-- (on centos server)
>
> # rpm -qa|grep -i pup
> puppetlabs-release-pc1-0.9.2-1.el7.noarch
> puppet-agent-1.0.0-1.el7.x86_64
> puppetserver-2.0.0-1.el7.noarch
>
> # puppet --version
> 4.0.0
>
>  
>
> # cfacter --version
> 0.4.1 (commit e9333e184e57106f7ce3fb6b44b05656f417d245)
>
> # facter --version
> 2.4.3
>
>
> # hiera --version
> 2.0.1
>
>  
>
> # mco --version
> /opt/puppetlabs/bin/mco 2.8.1
>
> # puppetserver --version
> puppetserver version: 2.0.0 
>
>
> #---(on debian client)
>
> # dpkg -l | grep -i pup
> ii  puppet-agent   1.0.0-1wheezy amd64 
>The Puppet Agent package contains all of the elements needed to run 
> puppet, including ruby, facter, hiera and mcollective.
> ii  puppetlabs-release-pc1 0.9.2-1wheezy all   
>Release packages for the Puppet Labs PC1 repository
>
> # puppet --version
> 4.0.0
>
>
> # cfacter --version
> 0.4.1 (commit e9333e184e57106f7ce3fb6b44b05656f417d245)
>
> # facter --version
> 2.4.3
>
> # hiera --version
> 2.0.1
>
> # mco --version
> /opt/puppetlabs/bin/mco 2.8.1
>  
>
>
>
> Also your 4.0 docs have lots of pointers back to 3.7 info, which is also 
> pretty confusing, as well as having links that don't resolve.
>
>- 
>https://docs.puppetlabs.com/puppet/4.0/reference/system_requirements.html 
> (in the main body) 'pre-install tasks' doesn't resolve, but it does 
>resolve in the menu on the left
>- https://docs.puppetlabs.com/puppet/4.0/reference/install_linux.html 
>points to 3.7 docs for the bottom half-dozen links
>
> Lastly, when installing the agent system, it didn't register the cert 
> request with the master until I ran agent with --test and 'then' started 
> the agent with puppet itself.
>
>

-- 
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/3216ad5d-e179-44ce-94d1-f2180fc3bc34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] [Announce] Micro-puppet v0.0.2 now available with new code extinguisher feature

2015-04-01 Thread Corey Osman
On the heels of the previously announced tiny-puppet 
(https://github.com/example42/puppet-tp.git) now comes micro-puppet.  A 
shortened version of tiny-puppet for the keystroke impaired.  But with 
Micro-puppet there is so much more.  Version 0.0.2 now brings a new feature 
called code extinguisher that fixes all your puppet 2.7.x code depreciation 
warnings and automagically converts them to take advantage of the new parser 
found only in puppet 4.

To learn more about the advantages of using Micro puppet please visit the 
following repo:

https://github.com/logicminds/micro-puppet.git


Corey


-- 
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/FF719812-6866-4002-A876-9BF3C729A60C%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using gem from new puppetserver custom function?

2014-10-15 Thread Corey Osman
Piggybacking off the same topic.


I have a few parsers that use the JSON gem so require 'json' is at the top 
of my parser which requires the native C extensions.  Does the new puppet 
server come with a jrbuy version of the json gem that contains the 
functions?  How would I write a parser that can be used on the ruby puppet 
master and the new jruby puppet server if the gems are slightly different 
and have different method names?  

On Wednesday, October 15, 2014 2:40:45 PM UTC-7, Schofield wrote:
>
> Thanks for the reply.  That does indeed look to be the solution.  
>

-- 
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/51fd328c-a094-42d3-b8f5-f76d26de4034%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet facts uploading to PuppetDB

2014-10-15 Thread Corey Osman
I am using this in a puppet post run command to upload the facts that 
changed after the puppet run.

I have run into this problem on many occasions where I like to build a 
custom UI around displaying custom facts.

Because facts only get uploaded to puppetdb before the puppet agent runs so 
there has always been a delay of one puppet run in realizing what the 
environment actually looks like.

So to fix this we used the puppet facts upload functionality.  There are 
many custom facts that interact with the software that puppet was deploying.

So in a way we are using facts outside of puppet but we are using 
puppetdb's REST API to retrieve those facts and display to our developers.

Basically we use facts as infrastructure metadata that we can display to 
our developers and devops team to make informed decisions about what's 
deployed where 
and who broke the environment by showing latest git revisions of the 
deployed code.  

If you would like to talk further about this please reach out to me via 
email.


Corey
 
 
On Thursday, October 2, 2014 1:55:11 AM UTC-7, Ken Barber wrote:
>
> > We do this, but could probably live without it. But we do it using the 
> facts 
> > indirector and setting it up to cache to puppetdb. 
>
> So in both cases you use 'puppet facts upload'? 
>
> ken. 
>

-- 
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/65cdb9cb-197d-4fa5-aff4-c0832cd8485a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom Providers and Third Party Gems

2014-10-15 Thread Corey Osman
Just to add.

If you can remove any gem dependency by reimplementing that functionality 
inside your own provider or even create some helper code I would try that. 
 There is a section in Nan's book that details how to distribute external 
helper code inside the module for native types/providers.   Its some 
special folder called PUPPET_X or something (can't remember).  If your 
using open source puppet you could even augment the puppet gemspec to 
include new runtime dependencies.  However, you would also need to host 
this custom gem and ensure everyone downloads your custom gem instead of 
the puppet gem from puppet labs/rubygems.org.

I would also consider using omnibus and creating your own distributable 
packages that contain everything you need to run your puppet environment. 
 This way as long as your system has been bootstrapped with your 
"management" package you can ensure everything is there to run your custom 
native type/providers.  This would also make it easy to version your 
cocktail of management gems and packages.


Corey
On Thursday, October 2, 2014 10:54:06 AM UTC-7, Chris Pitman wrote:
>
> Hey everyone,
>
> I'm hoping someone can enlighten me here: Why is it so hard/complicated to 
> use third party gems when developing a custom provider? It seems to me that 
> pulling in gems should be priority #1, since it allows providers to 
> leverage a lot of development already done in the ruby community.
>
> However, right now it is complicated:
>
> 1. I have to get my users downstream to install gem dependencies before 
> using any resources related to the provider. There is no way for me to 
> annotate the module itself for these dependencies, and no support for 
> automatically pulling them down.
>
> 2. "Features" offer very limited capability (as far as I understand), and 
> are poorly documented. The only documentation is on how to link providers 
> and types using features, not on how to require ruby libraries. There is no 
> way for anything other than a type to specify requiring a feature. For 
> example, what if a provider requires a gem?
>
> 3. "Features" only protect part of the lifecycle. Even without a feature 
> present, puppet still attempts to resolve auto-require relationships. This 
> makes sense based on how things work, but what am I supposed to do if I 
> need a third party gem there?
>
> 4. Some gem dependencies need to be present on both the puppet master (in 
> the master's environment) and on the node. There is no way for me to 
> transparently take care of this for users.
>
> So, am I just missing something? Is there some secret hook in the puppet 
> source that makes dealing with gems better? Should I just start 
> distributing this provider as a package, and ignore "puppet module", r10k, 
> etc? Or are there any changes coming down the pipeline that will make this 
> work better?
>
> Thanks,
> Chris
>

-- 
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/9f2afba5-025c-4bee-ac67-8559de417dd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to transfer list of interfaces from hiera to class

2014-10-15 Thread Corey Osman
Your other option if using the future parser is to use the each function 
and iterate around the hash like you would in any other language.

$interfaces = hiera('network_interfaces')

# https://docs.puppetlabs.com/references/latest/function.html#each


$interfaces.each { |$interface|
  managed_interface { $interface['device']:
device  => $interface['name'],
ipaddr  => $interface['ipaddr'],
netmask => $interface['netmask'], 
  }
}


Corey

On Tuesday, October 14, 2014 2:29:35 AM UTC-7, Andreas Dvorak wrote:
>
> Hi,
>
> I would like to create network interfaces with puppet.
> I have
> define network_interface::managed_interface(
>   $device='',
>   $gateway='',
>   $hostname='',
>   $hwaddr='',
>   $ipaddr='',
>   $netmask='',
>   $network='',
>   $up=true,
> ){
>
> and
> class network_interface::create_interface (
>   $device = hiera()',
> ){
>   managed_interface { $device:
> device  => $device,
> ipaddr  => $ipaddr,
> netmask => $netmask, 
>   }
> }
>
> and hiera yaml file:
> network_interface:
>   eth0:
> ipaddr: 10.112.67.40
> netmask: 255.255.0.0
>   eth1:
> ipaddr: 10.15.67.40
> netmask: 255.255.0.0
>
> Now I don't know how to read the hiera values in the class 
> network_interface::create_interface. The interface names can be different.
> Can some please help me?
>
> Best regards
> Andreas
>

-- 
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/20d0e3e3-3b97-4276-a231-b2f1ce30a2b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to execute paths in a text file in puppet ruby

2014-10-08 Thread Corey Osman
Yea looks like the Facter readlines method doesn't exist.

http://ruby-doc.org/core-1.8.7/IO.html#method-c-readlines

You will need to use ruby's readlines and probably clean up the lines as 
well with chop.

Revised edition:  (untested, and probably full of syntax errors)

Facter.add(:java_versions1) do
 setcode do
file = '/home/suppalapati/java.txt'
if File.exists?('/home/suppalapati/java.txt')
   lines = File.readlines( file, "\n")
   if ! lines.nil?
 versions = lines.collect {|command| `#{command.chop}`}
   else
 versions = `java -version`.to_a
  end
  versions.join(",")
   else
 # poor mans debugger
 versions = "Can't find file: #{file}"
end
   
 end
end

Please read : https://docs.puppetlabs.com/facter/1.7/custom_facts.html

See section about loading custom facts. This will give you the chance to 
test on your machine.  

check syntax ruby -c  
On Wednesday, October 8, 2014 12:33:55 PM UTC-7, Spriya wrote:
>
> Hi,
>
> I used the same command which you provided me
>
> Here is the code:
>
> Facter.add(:java_versions1) do
>  setcode do
> log = Facter::Util::FileRead.readlines( 
> '/home/suppalapati/java.txt')
> if ! log.nil?
>versions = log.collect {|command| `#{command}`}
> else
>versions = `java -version`.to_a
> end
> versions.join(",")
>  end
> end
>
>
> Here is my txt file
> /usr/java/jre1.7.0_51/bin/java
> /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java
>
> /opt/CLM-Web-Tools/im/linux.gtk.x86_64/jre_6.0.0.sr9_20110208_03/jre/bin/java
> /opt/CLM-Web-Tools/im/linux.gtk.x86/jre_6.0.0.sr9_20110208_03/jre/bin/java
> /opt/IBM/TeamConcertBuild/jre/bin/java
> /opt/IBM/InstallationManager/eclipse/jre_6.0.0.sr9_20110208_03/jre/bin/java
>
> /opt/IBM/InstallationManager_old/InstallationManager_old/eclipse/jre_6.0.0.sr9_20110208_03/jre/bin/java
> /opt/IBM/TeamConcertBuild_old/jre/bin/java
> /opt/itm/v6.2.2/JRE/lx8266/bin/java
> /var/lib/alternatives/java
> /u01/app/oracle/product/jdk1.7.0_25/jre/bin/java
> /u01/app/oracle/product/jdk1.7.0_25/bin/java
>
> The fact is not returning anything.
>
> Let me know
>
> On Wednesday, October 8, 2014 3:22:22 PM UTC-4, Corey Osman wrote:
>>
>>
>>
>> *I would probably do something like this where we store all the java 
>> versions in a comma separated string.Although if using facter >= 2.0 you 
>> can probably remove the join statement and store as an array.I also want to 
>> point out that java -version returns about 3 lines of text which may not be 
>> desirable. I am also not sure if Facter has a readlines  method (guessing 
>> it does), so you might have to swap out with ruby's file reading code.*
>>
>> Facter.add(:java_versions) do
>>  setcode do
>> log = 
>> Facter::Util::FileRead.readlines( '/home/weblogic/java.txt')
>>
>> *if ! log.nil?   versions = log.collect {|command| 
>> `#{command}`}else   versions = `java -version`.to_a*
>> *end versions.join(",") end*
>> end
>>
>>
>> Corey
>>
>> On Tuesday, October 7, 2014 10:31:12 AM UTC-7, Spriya wrote:
>>>
>>> Hi,
>>>
>>> I have a text file where i get all the java version.
>>>
>>> *cat java.txt*
>>> */usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java -version*
>>> */usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java -version*
>>> */opt/oracle/agent12c/core/12.1.0.4.0/jdk/bin/java -version*
>>> */opt/oracle/agent12c/core/12.1.0.4.0/jdk/jre/bin/java -version*
>>> */var/lib/alternatives/java -version*
>>> */u01/java/jdk1.7.0_65/jre/bin/java -version*
>>> */u01/java/jdk1.7.0_65/bin/java -version*
>>>
>>>
>>> Now i want to run commands in each line and place it in facts.
>>>
>>> How can i do that.
>>>
>>> I have just started doing the code*.*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *logfile = '/home/weblogic/java.txt'line_num=0log = 
>>> Facter::Util::FileRead.read(logfile)unless log.nil?  log.each_line do 
>>> |line|  output =  Facter::Util::Resoloution.execHow can i can continue 
>>> thatPlease help me*
>>>
>>

-- 
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/cdb1ce6b-7e38-4c19-887e-66fc6a34db8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to execute paths in a text file in puppet ruby

2014-10-08 Thread Corey Osman



*I would probably do something like this where we store all the java 
versions in a comma separated string.Although if using facter >= 2.0 you 
can probably remove the join statement and store as an array.I also want to 
point out that java -version returns about 3 lines of text which may not be 
desirable. I am also not sure if Facter has a readlines  method (guessing 
it does), so you might have to swap out with ruby's file reading code.*

Facter.add(:java_versions) do
 setcode do
log = Facter::Util::FileRead.readlines( '/home/weblogic/java.txt')

*if ! log.nil?   versions = log.collect {|command| 
`#{command}`}else   versions = `java -version`.to_a*
*end versions.join(",") end*
end


Corey

On Tuesday, October 7, 2014 10:31:12 AM UTC-7, Spriya wrote:
>
> Hi,
>
> I have a text file where i get all the java version.
>
> *cat java.txt*
> */usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java -version*
> */usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java -version*
> */opt/oracle/agent12c/core/12.1.0.4.0/jdk/bin/java -version*
> */opt/oracle/agent12c/core/12.1.0.4.0/jdk/jre/bin/java -version*
> */var/lib/alternatives/java -version*
> */u01/java/jdk1.7.0_65/jre/bin/java -version*
> */u01/java/jdk1.7.0_65/bin/java -version*
>
>
> Now i want to run commands in each line and place it in facts.
>
> How can i do that.
>
> I have just started doing the code*.*
>
>
>
>
>
>
>
> *logfile = '/home/weblogic/java.txt'line_num=0log = 
> Facter::Util::FileRead.read(logfile)unless log.nil?  log.each_line do 
> |line|  output =  Facter::Util::Resoloution.execHow can i can continue 
> thatPlease help me*
>

-- 
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/05330e16-7286-42a6-a94c-b595c028659c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Need help with simple hiera example

2014-10-08 Thread Corey Osman
Seems like  your clientcert is different during the puppet run than the 
command line since your explicitly passing in the clientcert.  I would 
change clientcert in your hiera config to fqdn.  You are not guaranteed to 
have a client cert, but all hosts will have a fqdn.  You can also use the 
hiera function in your puppet code so it makes that "automatic" lookup 
easier to understand since you control the lookup key.  Although, I don't 
recommend this since automated lookups are preferred as two lookups would 
actually occur if myfoo::bar doesn't exist.   If you run your puppet master 
in debug mode, it will actually detail when it can't find a lookup key, so 
have a look at the logs.

- hosts/%{fqdn}


ie. 

class foo(
$bar = hiera('myfoo::bar', 'defaultvalue')
# if the hiera function I specified as the default value for foo 
returns nil, the puppet automated lookup will occur and use 'foo::bar' 
lookup key
}

Hiera is pretty easy once you know the rules and I bet that your puppet 
agent clientcert must be different than what you have in your hiera 
datastore.





On Wednesday, October 8, 2014 6:44:56 AM UTC-7, Stack Kororā wrote:
>
> Greetings, 
>
>  I don't know why, but I am having a rough time trying to get hiera to 
> work. It seems to me that all the examples I see online are either absurdly 
> complex or so stupidly simple that they are absolutely useless. Either way 
> I have found the documentation for hiera completely lacking (it doesn't 
> help that there is a lot of bad information pertaining old puppet releases 
> that is no longer the correct way to do things...at least according to 
> other sources which may or may not be the correct way either...bleck...). 
> Of all the documentation/blogs/examples/ect I have been pouring over the 
> last 2 hours, not one has given me a useful hint at getting this working. 
>
>
>  *deep breath in an attempt to control my frustration so I can 
> communicate on a somewhat intelligent level* 
>
> Whew... 
>
>  OK. Lets start. 
>
>
>  $ puppet -V 
>
> 3.7.1 
>
> $ hiera -V 
>
> 1.3.4 
>
> $ hostname 
>
> puppet.test.vm 
>
> $ sudo puppet cert list --all 
>
> + "puppet.test.vm"  
>
>
>  This is as simple as I can make it. 
>
>
>  $ cd /etc/puppet 
>
> $ find . -type f 
>
> ./modules/testhiera/manifests/init.pp 
>
> ./manifests/site.pp 
>
> ./puppet.conf <- did not touch after test vm install 
>
> ./auth.conf <- did not touch after test vm install 
>
> $ cat manifests/site.pp 
>
> node 'puppet.test.vm' { 
>
> class { 'testhiera': } 
>
> } 
>
> $ cat modules/testhiera/manifests/init.pp 
>
> class testhiera ( $test="blah") { 
>
> file { "/tmp/$test" : ensure => present} 
>
> } 
>
> $ puppet agent -t 
>
> Info: Retrieving pluginfacts 
>
> Info: Retrieving plugin 
>
> Info: Caching catalog for puppet.test.vm 
>
> Info: Applying configuration version '1412771807' 
>
> Notice: /Stage[main]/Testhiera/File[/tmp/blah]/ensure: created 
>
> Notice: Finished catalog run in 0.04 seconds 
>
> $ rm /tmp/blah 
>
>   
> Hooray! That works. Can't get much simpler then that, right? OK, lets add 
> in hiera. Should be simple right? Ha!
>
>  
> $ sudo ln -s /etc/puppet/hiera.yaml /etc/hiera.yaml 
>
> $ find . -type f 
>
> ./hiera.yaml 
>
> ./hosts/puppet.test.vm.yaml 
>
> ./modules/testhiera/manifests/init.pp 
>
> ./manifests/site.pp 
>
> ./puppet.conf 
>
> ./auth.conf 
>
> # Only added these two files below; made no other changes 
>
> $ cat hiera.yaml 
>
> --- 
>
> :hierarchy: 
>
> - hosts/%{clientcert} 
>
> :backends: 
>
> - yaml 
>
> :yaml: 
>
> :datadir: '/etc/puppet/' 
>
> $ cat hosts/puppet.test.vm.yaml 
>
> --- 
>
> hieratest::test: yadda 
>
> $ hiera hieratest::test clientcert=puppet.test.vm 
>
> yadda 
>
> # Hiera on the command line works. I must be making progress!!
>
>
> $ sudo puppet agent -t 
>
> Info: Retrieving pluginfacts 
>
> Info: Retrieving plugin 
>
> Info: Caching catalog for puppet.test.vm 
>
> Info: Applying configuration version '1412771807' 
>
> Notice: /Stage[main]/Testhiera/File[/tmp/blah]/ensure: created 
>
> Notice: Finished catalog run in 0.03 seconds 
>
>  
> What??? That is absolutely contrary to the documentation! It should have 
> created /tmp/yadda! I am looking at the official docs right now on using a 
> hiera variable with a default variable and I don't see how my example is 
> any different in the slightest! Blah should have only been used as a 
> default if the host wasn't found. Clearly either puppet can't find hiera 
> and used default, or it simply ignored the hiera data. 
>
>
>   Fine. We will take out the default blah and force it to use something 
> from hiera. 
>
>
> $ rm /tmp/blah 
>
> $ cat modules/testhiera/manifests/init.pp 
>
> class testhiera ( ) { 
>
> file { "/tmp/$test" : ensure => present} 
>
> } 
>
> $ sudo puppet agent -t 
>
> Info: Retrieving pluginfacts 
>
> Info: Retrieving plugin 
>
> Info: Caching catalog for puppet.test.vm 
>
> Info: Applying configuration version '1412773578' 
>
> Notice: Finished catalog 

[Puppet Users] How to unit test your site.pp file

2014-10-07 Thread Corey Osman
Hi,

I created a example repository and README documentation around how to unit test 
your site.pp file.  Most puppet unit testing documents seem to only cover 
module testing and I felt like site.pp was left out.   I have not had a chance 
to share a lot of my knowledge until recently and here it is.  Whats nice about 
this convention is that the test code is portable via a puppet module. If you 
currently do not unit test I highly recommend you set this up.  It takes less 
than 10 minutes to set up. 

If you find this useful, let me know and I can put this module in puppet forge. 

https://github.com/logicminds/site_test


enjoy,

Corey Osman

-- 
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/9F35ACCB-27CF-4667-8036-C764351CAE0D%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] hiera hash to create_resources bombing - looking for how to troubleshoot

2014-09-26 Thread Corey Osman
I created a puppet function to help with debugging things the contents of 
variables.  I am going to see if this can be added to std lib.  However for 
now, just put this in your module code under lib/puppet/parser/functions. 
 You will want to have at least one rspec unit test for speedy results, 
otherwise you will need to search a bunch of logs for the value during your 
puppet run.

I can't say enough how useful this is when used with a unit test 
(rspec-puppet)

usage:  dump_args($somevar1, $somevar2, $somevar3, ...)  (anywhere in your 
puppet code for debugging only)

https://gist.github.com/logicminds/9d73b1a9cdb8f37f8556

I see that you already solved it, but keep this in mind for later as 
knowing which variables are not being populated correctly is extremely 
useful since variable contents are difficult to see.

Corey
On Thursday, May 29, 2014 5:37:29 AM UTC-7, Ygor wrote:
>
> Found it !
> A stray case change in an exec resource ( command --> Command )
>
> Many thanks.
>
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.”  (Bill Waterson: 
> Calvin & Hobbes)
>
>
> On May 29, 2014, at 03:05 AM, Spencer Krum  > wrote:
>
> I would do it in a .pp file. Removing as many variables as possible is a 
> good thing.
>
>
> On Wed, May 28, 2014 at 6:03 PM, Dan White  > wrote:
>
>> Thanks, gentlemen, for the suggestions.
>> I will try both tomorrow.
>>
>> For the single instance, should I do it explicitly in the dot-pp file or 
>> should I do it thru hiera ?  If I do not get a response in time, I will try 
>> both ways.
>>
>> Looking forward to Puppet Camp in DC next week.
>>
>> On May 28, 2014, at 7:55 PM, Spencer Krum > > wrote:
>>
>> Creating a single instance of the defined type using the puppet syntax 
>> should help you see the errors.
>>
>>
>> On Wed, May 28, 2014 at 3:56 PM, Clayton O'Neill > > wrote:
>>
>>> I've run into this a few times and I've found that looking at the server 
>>> logs, or running the puppet master with --trace usually gives me enough 
>>> information to work out where the error is being generated.
>>>
>>>
>>> On Wed, May 28, 2014 at 3:23 PM, Dan White >> > wrote:
>>>
 I found this reported bug:
 https://tickets.puppetlabs.com/browse/PUP-1100

 Any clue how to debug it ?
 This hit me when moving from Puppet 3.5.1 on RHEL 5 to Puppet 3.6.0 on 
 RHEL 6
 The defined type that it is barfing on is moderately complicated.

 “Sometimes I think the surest sign that intelligent life exists elsewhere 
 in the universe is that none of it has tried to contact us.”  (Bill 
 Waterson: Calvin & Hobbes)


 -- 
 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...@googlegroups.com .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/1a3da45c-307a-473f-9b6d-d3652eefef01%40me.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/puppet-users/CADg-rOWLTjY-Uf1mnmivV97CrJj1QwY-jMyxDwkU6D7J-nKQjw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Spencer Krum
>> (619)-980-7820
>>  
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/CADt6FWPBC8r96KMk9XUgAN%3DUe1D8Y%3Dbr1Le2Gk4QancBOYn6zQ%40mail.gmail.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> “Sometimes I think the surest sign that intelligent life exists elsewhere 
>> in the universe is that none of it has tried to contact us.” 
>> Bill Waterson (Calvin & Hobbes)
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and

[Puppet Users] Re: How to handle java home in module?

2014-09-01 Thread Corey Osman
Basically you should be creating an init script for each java application 
that you start.  It should be the responsibility of that init script to set 
the JAVA_HOME/JAVA_BIN variables.  With this in mind you shouldn't need to 
worry about facts or different JAVA_HOME variables since the init script 
will set this explicitly for each java application you run.  You would want 
to have a java_home or java_bin puppet parameter in your class/define so 
that you can change java versions in hiera for a specific 
node/environment/datacenter.   If you want a "default" version that is the 
only reason I would see for setting JAVA_HOME in your bash_profile.
Have a look at java service wrappers to help automate that init script 
creation.  (This is what jenkins, puppetdb, and many others use).



Corey  

On Wednesday, July 2, 2014 3:06:46 AM UTC-7, Gavin Williams wrote:
>
> Morning all
>
> I'm currently working on a module[1] to support installation and 
> configuration of Apache Karaf[2], a Java OSGi container... 
>
> I've got most of the installation piece sorted, and am starting to work on 
> the configuration side of things. 
> Unfortunately I've hit a bit of a blocker which I'm not sure of the best 
> way to work-around. 
>
> As part of the service installation process, a Java wrapper config file is 
> created. 
> This config file needs to be modified to specify the 'JAVA_HOME' value. 
> However I'm not sure of the best way to calculate this JAVA_HOME value, due 
> to the variable nature of both Java variants (Java 6 vs 7, Oracle vs 
> OpenJDK, release version) and the fact that Java might not be installed at 
> the start of the Puppet run. 
> The intention is to use a template for the config file, so it's modifiable 
> by Puppet. 
>
> Options I can think of: 
>
>1. Use a fact to provide JAVA_HOME. This fails if Java isn't installed 
>at the start of the agent run, which is a valid scenario if this module is 
>also installing Java... 
>2. Hard code the value based on a pre-determined file path based on 
>chosen Java distro and version. Not very clean/configurable...
>3. Update wrapper config file to pull in system env for JAVA_HOME. 
>However this fails if the system version isn't the one that the app should 
>use... 
>
> Am I missing a trick somewhere along the lines, or is hoping to achieve 
> all this - Install Java, Install Karaf, configure Karaf service - in one 
> run asking too much? 
>
> Thoughts/ideas welcome. 
>
> Cheers
> Gavin
>
> [1] https://github.com/fatmcgav/fatmcgav-karaf/tree/develop
> [2] http://karaf.apache.org/index.html
>

-- 
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/9ae083e2-7e5e-47c1-ab99-7f21a114f750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet unscheduling many service refreshes

2014-08-05 Thread Corey Osman
I am already using java service wrapper and having another wrapper around 
the jsw wrapper sounds super hack.  Although it would fix the issue.  I 
have gone as far as spreading the applications across more roles to reduce 
possible configuration load.  Do we know for a fact that puppet is 
purposely unscheduling these service refreshes due to high load.  Is this 
feature/bug documented anywhere?  Where would the code be that implements 
this "smart unschedule"?


than

On Thursday, June 19, 2014 6:00:33 PM UTC-7, Trevor Vaughan wrote:
>
> A fact probably won't help in this case since it seems to be something 
> that's happening as the service get restarted during the Puppet run and a 
> fact will only tell you what's happening at the start of the run.
>
> What you may need to do is to change the timeout and restart values of 
> your service statements to account for these anomalies. Your restart 
> statements could call a wrapper script that restarts the service but waits 
> in the background until enough resources are free and your timeout could be 
> set sufficiently high that the service resource would have time to execute.
>
> If you happen to not have anything dependent on this service restarting 
> (which is usually the case), you could even fire the service statement off 
> into the background with your wrapper script and allow the Puppet run to 
> continue unabated.
>
> This is one of those extremely sticky issues that seems to be particularly 
> rife in Java-land.
>
> Thanks,
>
> Trevor
>
>
> On Thu, Jun 19, 2014 at 6:56 PM, Pete Brown  > wrote:
>
>> You could write a fact that checks the system load and base your
>> service restarts on that.
>> I thought there was one but there only seems to be uptime and swapfree.
>>
>> Here's a ruby gem that might help get you started.
>> https://github.com/nethacker/usagewatch
>>
>>
>> On 20 June 2014 04:45, Corey Osman > 
>> wrote:
>> > Is there any "back off" algorithm in puppet that would unscheduled a 
>> service refresh when the CPU load is too high.  Is there a timeout 
>> associated with refreshing services?
>> >
>> > My CPU load peaks as high as 18(one min)(6 Processor Count) during 
>> puppet runs  .  I have about 20-30 java processes that need restarting 
>> almost every time so its quite a chore for puppet to restart all these 
>> services.
>> >
>> >
>> > My puppet runs last about 8-9 minutes for a full 
>> configuration/deployment.
>> >
>> >
>> >
>> > Corey
>> >
>> > --
>> > 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...@googlegroups.com .
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/D0CE60BA-B66D-4CAB-8B41-86E8CF75C31D%40logicminds.biz
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/CAJ8DPF71uaVqpS_Ap_NtH1xG8p0dohfKa-5GUiWZ%3D3zh6t3t5Q%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
> tvau...@onyxpoint.com 
>
> -- This account not approved for unencrypted proprietary information -- 
>

-- 
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/aded3733-a4ef-4257-9a5c-0741ded9faf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet unscheduling many service refreshes

2014-06-19 Thread Corey Osman
Is there any "back off" algorithm in puppet that would unscheduled a service 
refresh when the CPU load is too high.  Is there a timeout associated with 
refreshing services?

My CPU load peaks as high as 18(one min)(6 Processor Count) during puppet runs  
.  I have about 20-30 java processes that need restarting almost every time so 
its quite a chore for puppet to restart all these services.


My puppet runs last about 8-9 minutes for a full configuration/deployment.



Corey

-- 
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/D0CE60BA-B66D-4CAB-8B41-86E8CF75C31D%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet facts upload not working

2014-03-17 Thread Corey Osman
Hi,

I am trying to use puppet facts to push the latest facts to my puppetmaster 
after a puppet run but the command doesn't seem to work.

#bash: puppet facts upload
Error: execution expired
Error: Try 'puppet help facts upload' for usage

It appears like the command is timing out, but I don't know why. 

My puppet master's auth.conf file has:

Assuming this config is setup to only allows authenticated clients that have a 
valid cert to access the /facts endpoint.

path /facts
method save
auth yes
allow *



What am I missing


ref: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/face/facts.rb
ref: http://synforge.com/puppet-agent-facter/ 



Corey

-- 
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/DF465B93-C26A-45AB-AD83-ED708B5A66DF%40logicminds.biz.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] postgres issue with puppetdb unexpected EOF on client connection

2014-01-08 Thread Corey Osman
Hi,

Hoping someone can help with this error.  Check your puppetdb logs and you 
might see the same error.  This doesn’t seem to cause any harm but I have seen 
occasional crashes with puppetdb.

This error is littering my postgres log files.  The puppetdb must be closing 
the connection incorrectly and causing this error.  Anybody else running into 
this?  Is this a known error?

Running:

Centos 6.4
postgres (PostgreSQL) 8.4.13
puppetdb 1.5.0
puppet 3.2.4

LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection

-- 
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/4A9D8184-9086-4572-A026-BEA92CF47305%40logicminds.biz.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] fix for running puppet as nonroot

2013-11-05 Thread Corey Osman
Hi,

For those of you running puppet as non root and are using puppet to manage 
itself via service, exec or want to use the moo puppet command I have found a 
fix and submitted a pull request to fix this problem in puppet core.  This 
problem is only unique to non root installations. 


See  http://projects.puppetlabs.com/issues/23053


Example usage in puppet.
 
  # Due to this bug we cannot control puppet with puppet
  service{"puppet":
ensure => “running",
provider => "init",
hasstatus  => true,
hasrestart => true,
path   => $initd_dir,
  }

Example usage in mcollective:

mco puppet …

Just thought I would share as I am sure others are running into this issue.



Corey


-- 
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/EDF8B2D2-4E98-4518-94AD-DD474EC346FB%40logicminds.biz.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: rspec-puppet require syntax

2013-09-19 Thread Corey Osman
Have you tried:

*"Class[ssl],Class[pcre3],Staging::Extract[nginx-1.4.1.tar.gz]"*

or 

*"Class[ssl],Class[pcre3],Staging__Extract[nginx-1.4.1.tar.gz]"


Corey
*
On Tuesday, September 17, 2013 10:05:26 AM UTC-7, Guy Knights wrote:
>
> Can someone tell me the correct way to specify the following require 
> statement in an rspec-puppet test?
>
> *require => 
> [Class['ssl'],Class['pcre3'],Staging::Extract["nginx-${version}.tar.gz"]]*
>
> I tried this: *'require' => 
> "[Class['ssl'],Class['pcre3'],Staging::Extract['nginx-1.4.1.tar.gz']]"*but 
> got the following error:
>
> *Failure/Error: )
> *
> *expected that the catalogue would contain Exec[install_nginx] with 
> require set to 
> `"[Class['ssl'],Class['pcre3'],Staging::Extract['nginx-1.4.1.tar.gz']]"` 
> but it is set to `[Class[Ssl]{:name=>"Ssl"}, Class[Pcre3]{:name=>"Pcre3"}, 
> Staging::Extract[nginx-1.4.1.tar.gz]{:name=>"nginx-1.4.1.tar.gz"}]` in the 
> catalogue*
>
> I've tried every combination of different quotes, removing the inner 
> quotes, capitalising the resource titles, and even just copying and pasting 
> what the error above says the catalogue is reporting, but it just doesn't 
> work. I thought I had the syntax for requires figured out, but apparently 
> not.
>
> Thanks,
> Guy
>

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] questions about verifying template paths and variables with rspec

2013-09-18 Thread Corey Osman
Hi,

How can I verify the template exists in the given path?  Example,

Given the following in my manifest:

if $somevar == 'true' {
$templatefile='mymodule/mytemplate.xml.erb'
}
else {
$templatefile='mymodule/mytemplate2.xml.erb'
}
file{"somefile.txt":
ensure => present,
content => template($templatefile)
}


How can I test that the template file exists in the given module path?

File.exists?("../../../#{templatefile}").should be_true ???

Additionally can I test if the variable $templatefile or $somevar is correct 
and my logic is sane.  Is there a way to retrieve the manifest variables within 
spec tests?

example:

$somevar.should eq('true') ???



Corey


-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Pre-commit hooks for your modules?

2013-06-03 Thread Corey Osman
Here is what I have:

Essentially I use the command line tools instead of ruby functions.  

This tells me exactly where the problem is down to the line number.

+1 for checking the erb files, I'll have to add that to my script.

I have the json check for my hieradata since I keep hiera in JSON format.

https://gist.github.com/logicminds/5700014

On Monday, December 10, 2012 2:27:26 PM UTC-8, Jakov Sosic wrote:
>
> Hi. 
>
> I was wondering what kind of precommit hooks are you guys using? 
>
> Here's what I've come up to in last hour: 
>
> $ cat .hg/hgrc | grep -A 1 hooks 
> [hooks] 
> pretxncommit.puppet = .hg/check_puppet.rb 
>
> $ cat .hg/check_puppet.rb 
>
> #!/usr/bin/ruby 
> def puppet_parser_validate(file) 
> if !system('puppet parser validate ' + file + ' > /dev/null 2>&1') 
> print('Syntax error in file: ' + file + "\n") 
> system('puppet parser validate ' + file) 
> exit(1) 
> end 
> end 
>
> def puppet_lint(file) 
> if !system('puppet-lint --no-80chars-check ' + file + ' > /dev/null 
> 2>&1') 
> print('Coding style error in file: ' + file + "\n") 
> system('puppet-lint --no-80chars-check ' + file) 
> exit(1) 
> end 
> end 
>
> def puppet_erb_check(file) 
> if !system('erb -x -T \'-\' ' + file + ' | ruby -c > /dev/null 2>&1') 
> print('Syntax error in erb template: ' + file + "\n") 
> system('erb -x -T \'-\' ' + file + ' | ruby -c') 
> exit(1) 
> end 
> end 
>
> # go through list of files, and call adequate checks 
> IO.popen('hg status').readlines.each { |file| 
> file.sub!(/^\w (.*)\n/,'\1') 
> if file.match('.pp$') 
> puppet_parser_validate file 
> puppet_lint file 
> elsif file.match('.erb$') 
> puppet_erb_check file 
> end 
> } 
>
>
>
>
> These are very basic checks, but I would like to implement also 
> something like checking if file from 'source =>' is present in module's 
> files/ or if template from manifest is present in templates/ and things 
> like that. 
>
> Do you have any other ideas? 
>
>
>
>
> -- 
> Jakov Sosic 
> www.srce.unizg.hr 
>

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] custom type and provider testing

2013-05-27 Thread Corey Osman
Hi,

I am writing a custom native type/ provider and want to perform some rspec 
testing but I can't seem to find any documentation on how to test native types 
and providers.  Can someone point me in the right direction.  



Corey

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: hiera not using non-root user custom fact

2013-05-09 Thread Corey Osman
I was able to solve this.  The facts were being communicated correctly, 
however the custom facts had a additional newline at the end.  So I just 
needed to clean up the whitespace.

 fact.last.strip

Once the fact was cleaned, hiera lookups started to work again.




On Monday, May 6, 2013 7:22:40 PM UTC-7, Corey Osman wrote:
>
> Hi,
>
> Before I begin, my environment consists of a standard master/client config 
> with the exception that all my clients run under a non-root user.  I have 
> to use non-root so I can't simply restart under root to fix the problem.
>
> Master -> 3.1.1
> Client  -> 2.7.17
>
> using mostly the hiera() function in my classes.
>
> problem:
>
> I have run into an issue today where my custom fact is not being passed to 
> hiera in order to determine which hiera file to use (see hierarchy).  The 
> custom fact is definitely defined what it should be but its almost as if it 
> has a differently scope then say a root level custom fact.  Because of this 
> hiera data is coming up undefined which causes my classes to fail.
>
> $myvar = hiera('var-name')   --> should use custom_env and custom_release 
> to help determine where the variable is defined in hiera.
>
> Are custom facts from non root users simply not relayed to hiera?
>
> :hierarchy:
>   - nodes/%{::fqdn}
>   - releases/%{custom_release}
>   - env/%{custom_env}
>   - common
>
>
>
> I have put a bandaid fix in for now which sets these variables via top 
> scope assignment in one of my classes and allows me to control everything 
> from hiera instead of using custom facts.  However, I am not sure if this 
> follows good puppet coding practices when using hiera, since I am using 
> hiera to feed hiera.  I don't want to have to define these variables for 
> every node.
>
> bandaid fix:
> # this is a top scope variable that is currently a hack to fix an unknown 
> bug with hiera and local puppet facts
> $custom_env = hiera('custom_env')  --> defined under nodes/nodename
> $custom_release = hiera('custom_release')   --> defined under 
> nodes/nodename
> class roles::specialapp(
>
>   )
>
> {
> include specialapp_profile
>
> }
>
>
> If this is a new bug, I'll be happen to file a ticket.
>
> Thanks,
>
> Corey Osman
> co...@logicminds.biz
>
>
>
>
>
>
>  
>

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] hiera not using non-root user custom fact

2013-05-06 Thread Corey Osman
Hi,

Before I begin, my environment consists of a standard master/client config with 
the exception that all my clients run under a non-root user.  I have to use 
non-root so I can't simply restart under root to fix the problem.

Master -> 3.1.1
Client  -> 2.7.17

using mostly the hiera() function in my classes.

problem:

I have run into an issue today where my custom fact is not being passed to 
hiera in order to determine which hiera file to use (see hierarchy).  The 
custom fact is definitely defined what it should be but its almost as if it has 
a differently scope then say a root level custom fact.  Because of this hiera 
data is coming up undefined which causes my classes to fail.

$myvar = hiera('var-name')   --> should use custom_env and custom_release to 
help determine where the variable is defined in hiera.

Are custom facts from non root users simply not relayed to hiera?

:hierarchy:
  - nodes/%{::fqdn}
  - releases/%{custom_release}
  - env/%{custom_env}
  - common



I have put a bandaid fix in for now which sets these variables via top scope 
assignment in one of my classes and allows me to control everything from hiera 
instead of using custom facts.  However, I am not sure if this follows good 
puppet coding practices when using hiera, since I am using hiera to feed hiera. 
 I don't want to have to define these variables for every node.

bandaid fix:
# this is a top scope variable that is currently a hack to fix an unknown bug 
with hiera and local puppet facts
$custom_env = hiera('custom_env')  --> defined under nodes/nodename
$custom_release = hiera('custom_release')   --> defined under nodes/nodename
class roles::specialapp(

  )

{
include specialapp_profile

}


If this is a new bug, I'll be happen to file a ticket.

Thanks,

Corey Osman
co...@logicminds.biz







-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] use of parameterized classes

2013-03-05 Thread Corey Osman
Hi,


I have been following this new type of style, using parameterized classes but I 
have a question.



Say I have the following:


class java-app-profile {
  class {'java-app': 
app-name  => "my_first_app1",
app-dir => '/opt/company/my_first_app1',
  }
  class {'java-app': 
app-name  => "my_first_app2",
app-dir => '/opt/company/my_first_app1',
  }
  class {'java-app': 
app-name  => "my_first_app3",
app-dir => '/opt/company/my_first_app1',
  } 
}

Can I declare multiple parameterized classes of the same type within a single 
class? 


Reference: http://docs.puppetlabs.com/guides/parameterized_classes.html



Thanks,

Corey Osman
co...@logicminds.biz

Green IT and Data Center Automation Specialist






-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: expect like behavior function?

2013-03-01 Thread Corey Osman
Wow, I have never even heard of true or yes programs. Echo "Y" is also a 
good solution.

My friend also noted there was a quite mode available. 

If your curious here are all the suggestions I and the forum came up with:

1. Look for a quiet mode
2. Look for a "answer file" option
3. Modify the installer to accept 1 and 2
4. Echo "Y"
5. Use /bin/true or /bin/yes

I think the most "dump" installers can be automated using these solutions 
before reverting to expect.  

On Wednesday, February 27, 2013 11:23:59 AM UTC-8, Corey Osman wrote:
>
> A friend of mine ask me this question and I stated puppet was only good 
> for sending commands and not interacting with the command line.  I told him 
> to look for answer file support or a quite mode. 
> However, I suppose he could also run a expect script that could answer the 
> installer questions but this would be kinda complex for a beginner and not 
> the right approach in my opinion.
>
> Is there a puppet resource or function that could automate this solution? 
>  Does puppet provide any expect like behavior?
>
> Question:
>
> I want to run and installer through an exec resource in Puppet. The 
> problem is that the installer prompts you for a yes or no to choose the 
> default path:
>
> Default directory for installation of products - /opt/ibm/db2/V10.1
>
> ***
> Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no] 
>
> If I run this command through puppet, puppet never sends a yes and the 
> prompt ends up in a loop and never runs the installer. You know how to make 
> the exec resource send "yes" to the command line?
>
>
> Thanks,
>
> Corey Osman
> co...@logicminds.biz
>
> Green IT and Data Center Automation Specialist
>
>
>
>
>
>  
>

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] expect like behavior function?

2013-02-27 Thread Corey Osman
A friend of mine ask me this question and I stated puppet was only good for 
sending commands and not interacting with the command line.  I told him to look 
for answer file support or a quite mode. 
However, I suppose he could also run a expect script that could answer the 
installer questions but this would be kinda complex for a beginner and not the 
right approach in my opinion.

Is there a puppet resource or function that could automate this solution?  Does 
puppet provide any expect like behavior?

Question:

I want to run and installer through an exec resource in Puppet. The problem is 
that the installer prompts you for a yes or no to choose the default path:

Default directory for installation of products - /opt/ibm/db2/V10.1

***
Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no] 

If I run this command through puppet, puppet never sends a yes and the prompt 
ends up in a loop and never runs the installer. You know how to make the exec 
resource send "yes" to the command line?


Thanks,

Corey Osman
co...@logicminds.biz

Green IT and Data Center Automation Specialist






-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Disable Cron Script using puppet resource

2013-01-26 Thread Corey Osman
How can I disable / enable a cron job using puppet resource cron?




Thanks,

Corey Osman
co...@logicminds.biz
Green IT and Data Center Automation Specialist






-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] help with creating self.instances for puppetlabs-lvm providers

2012-10-29 Thread Corey Osman

Hi,

I have been adding support for the puppetlabs-lvm module so that I can use 
puppet resource .

I have most of the coding done but can't seem to get certain parameters in the 
output.


https://github.com/logicminds/puppetlabs-lvm/commit/deb258231f5a4dc6da7c0d65a7153846b8766b3e


example:

def self.instances
  filesystems.map { | fs |
 new(:name => fs[0], :fs_type => fs[1], :options => fs[2], 
:ensure => :present ) }
end



[root@puppet2 logical_volume]# puppet resource filesystem

filesystem { '/dev/mapper/vg_puppet2-lv_root':
  ensure => 'present',
}
filesystem { '/dev/sda1':
  ensure => 'present',
}



The output should detail the fstype and options but I don't know why it doesn't 
output these details.  I have similar issues with other types so I must be 
missing something in my code.

Should look like this:

filesystem { '/dev/sda1':
  ensure => 'present',
  options => "-b 4096",
  fs_type => "ext4",
}


One other thing I found is that its necessary to reference @property_hash in 
order for puppet resource logical_volume to work since the default @resource is 
missing certain keys.

 rname ||= @resource[:name] || @property_hash[:name]

Not sure why I need to reference @property_hash?


Also,

How do I add tests for puppet resource?  Any examples?


BTW, I am adding this code so that I can validate that puppet did what it was 
supposed to do without writing custom parsers and formatters (Thats what puppet 
is for".  



Thanks,

Corey Osman
co...@logicminds.biz
Green IT and Data Center Automation Specialist






-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Setting up Java on Windows

2012-10-16 Thread Corey Osman
I wasn't aware that you could use the package resource for exe files since 
it looked like it was limited to msi files.
 
I ended up crafting up this solution using exec resource
 
exec{"jdkinstaller":
  command => "${::installer_dir}/jdk-6u30-windows-i586.exe /s 
ADDLOCAL=\"ToolsFeature,DemosFeature,SourceFeature\" ",
  creates => 'C:\Program Files\Java\jdk1.6.0_30\bin\javac.exe',
  logoutput => 'true',
 }
 
Still struggling to set the Global PATH variable in a nice way.
 
Corey
On Monday, October 15, 2012 11:45:25 PM UTC-5, wukong wrote:

> Hi guys,
> I have been trying to bootstrap a windows machine with puppet. I need to 
> install java and setup the JAVA_HOME and add bin to the path variable of 
> windows. 
> I have tried using the package resource with the jdk setup but everytime I 
> run the manifest puppet opens the setup wizard and waits for me to do 
> something. 
> Am I doing something wrong or is this the right behavior? Also is there a 
> way to do this as silent install? 
>
> Here is my manifest. 
>
> package {"java" :
> ensure => installed,
> provider => "windows",
> source => "C:/Manifests/installables/jdk-6u35-windows-i586.exe",
> }
>
> Thank you.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/IJlOOM-dRZUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] puppet windows importing manifests twice when using puppet apply

2012-10-16 Thread Corey Osman
I am trying to create a masterless local windows installer and I have run 
into an issue where puppet is importing my manfiests multiple times 
creating multiple declaration errors.
 
You may notice the importing occurs twice but with different directory 
layouts.  One import is via puppet while the other has something to do with 
the modulepath I declared.
 
 
Any ideas?
 
Corey
Here is what I am doing (somewhat abbreviated):
 
 ruby -S -- puppet apply -v --debug --noop --modulepath="dir/puppetmodules" 
-e "include myclass"
 
debug: importing 'C:\devops\trunk/puppetmodules/myclass/manifests/init.pp' 
in environment production
debug: importing 'C:/devops/trunk/puppetmodules/myclass/manifests/init.pp' 
in environment production
debug: Automatically imported myclass from myclass into production
debug: importing 'C:\devops\trunk/puppetmodules/jdk/manifests/init.pp' in 
environment production
debug: importing 'C:/devops/trunk/puppetmodules/jdk/manifests/init.pp' in 
environment production
debug: Automatically imported jdk from jdk into production
Duplicate declaration: Exec[create_java_home] is already declared in file 
C:\devops\trunk/puppetmodules/jdk/manifests/init.pp at line 18; cannot
 redeclare at C:/devops/trunk/puppetmodules/jdk/manifests/init.pp:18 on 
node hostname_hidden
 
Here is the myclass (changed name for this email)
class myclass {
 class {"myclass::install": }
 
 # Now try and use maven to run the build
 class {"maven::command":
  build_dir => "c:/${mvn_repo_name}",
  command => "verify -Ptests",
  require => [Exec["checksvnrepo"],Class["myclass::install"]],
 }
 
}
 
class myclass::install{
if $::operatingsystem == "windows" {
  class {"jdk": }
  class {"svn": }
  # since springsource comes with maven lets use the builtin maven package
  if $::install_sts == "true" {
   class {"sts": 
require => Class["jdk"]
   }
   $mvn_dir='C:\Program Files\springsource\apache-maven-3.0.3'
   class {"maven::setup":
mvn_home => "$mvn_dir"
   }
  }
  else{
   # Install and Setup Maven
   class {"maven": }
  }
   } 
}
Here is the jdk class being called since its the first class 
 
class jdk{
 
 class {"jdk::setup":
  require => Class["jdk::install"],
  java_home => 'C:/Program Files/Java/jdk1.6.0_30',
  java_bin => '%JAVA_HOME%/bin',
 }
 
}
class jdk::setup($java_home, $java_bin){
 # set the user environment variable for java_home
 exec{"create_java_home":
  command => "setx JAVA_HOME \"${java_home}\" /M ",
  path => 'C:\Windows\System32',
  # The unless should really just check if the variable is set for the 
specific path
  unless => "where javac",
  
 }
 
 # set the user environment variable for java_bin
 exec{"create_java_bin":
  command => "setx JAVA_BIN \"${java_bin}\" /M ",
  path => 'C:\Windows\System32',
  unless => "where javac",
 }
}
class jdk::install{
 exec{"jdkinstaller":
  command => "${::installer_dir}/jdk-6u30-windows-i586.exe /s 
ADDLOCAL=\"ToolsFeature,DemosFeature,SourceFeature\" ",
  creates => 'C:\Program Files\Java\jdk1.6.0_30\bin\javac.exe',
  logoutput => 'true',
 }

}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/CuB0G1TQ9SkJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Set a windows environment variable from manifest

2012-10-10 Thread Corey Osman
I want to setup java jdk and maven and need to set some environment
variables that stick around after reboot.  I also need to add to values to
the path variable so I can call via the command line.  What's the best way
to set permanent environment variables for windows via the manifest?

Is there a custom type for this?

Corey

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Announce: RemoteAdmin 0.6 ( Foreman / Puppet Mobile App ) Now in appstores

2012-07-22 Thread Corey Osman
I am proud to release the next version of Remote Admin version 0.6.   The first 
mobile app for your puppet environment.
What is RemoteAdmin you ask?  RemoteAdmin is a mobile (Android / iOS) and 
desktop (Win / Mac) app written in Flex that controls your puppet 
infrastructure via foreman. 

For more information visit:  http://www.remoteadmin.co

Full Feature List

HostGroups  (Similar to Roles in puppet)
  -- Create Host Groups
  -- Assign and remove hosts to hostgroups
  -- Assign and remove puppet modules from hostgroups
Facts
  -- Fact viewer for entire environment
  -- Dynamic graphs based on any fact
  -- Sort facts by hostgroup(s)
  -- Email facts
Certificate Management (Coming back in 0.7)
  -- Validate certificate requests
  -- Revoke certificates
  -- View revoked certificates
  -- Search for certificates
Reports
  -- View Latest Puppet Generated Reports
  -- View report metrics as charts
  -- Drill down into individual report logs to find issues with puppet runs
  -- Sort reports by recent, eventful and failed categories
Hosts
  -- View Individual Host puppet reports
  -- Assign or remove puppet modules from host
  -- View facts for each host
Misc
  -- Create multiple profiles for different datacenters or foreman hosts
  -- SSL Support (Recommended)
  -- User Authentication Support (Recommended)
  -- Clickable Quickview Dashboard


Whats New in 0.6:
-- Communication Subsystem (native notifications, alerts)
-- Support for Ipad 3
-- iOS inspired Theme
-- Clickable Dashboard Graph and Fact Graph
-- Swipe to view legend (FactViewer)
-- Now Open source! (GPLv3)
-- Test Client (if you don't have a foreman host yet)

Whats Fixed:
-- Too many to list

Whats Removed:
-- Certificates (Will add back in version 0.7)


Future Releases (See http://www.remoteadmin.co) for full roadmap:
-- Certificates
-- Bookmark integration with entire app (Bookmark and group filters)
-- Horizontal (large screen) layouts for tablets and Desktop
-- IPMI and Mcollective integration
-- More Share Buttons (CSV, Screenshot, ...)
-- Badge Integration and Notifications when app is in background

Note: Remote Admin Version 0.6 only works with the Foreman  1.0 or latest 
develop branch.

Look in the appstores for RemoteAdmin or click the links below
--
iOS  Version: http://bit.ly/MojULg

Android Version: http://bit.ly/NkRR3M

Desktop App: http://www.remoteadmin.co/desktop (Install via Web)  OSX and 
Windows Only

For more information please visit http://www.remoteadmin.co





Corey Osman
co...@logicminds.biz
Green IT and Datacenter Automation Specialist




-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] script to find non-puppet systems

2011-12-20 Thread Corey Osman
Hi,

Just curious if anybody had written a script to find systems that don't have 
puppet installed by doing a port scan or something else.
I would like to have my puppetmaster send an email when it finds a system that 
doesn't have puppet installed and possibly take action by installing it.


Does anybody have some good ideas how a system can be detected as a non-puppet 
system? 


One idea would be to use net-snmp to query the list of installed packages.  But 
this requires net-snmp to be running


snmpwalk -v 2c -c public hostname 1.3.6.1.2.1.25.6.3.1.2 | grep puppet



Corey Osman
co...@logicminds.biz

Green I.T and Datacenter Automation Specialist



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] time issue with puppet

2011-12-14 Thread Corey Osman
Hi,

I have the following manifest that basically syncs the time for nodes really 
out of sync and ntpd can't drift the time back fast enough.

The problem is that when puppet executes the catalog,  and puppet changes the 
time, puppet never finishes because it can't calculate the "run time" since 
puppet changed the time during the puppet run.

Is this a bug?  Should I do something different?

For example:

1. puppet starts at 3:53 pm
2. tmesync module alters the time accordingly back 10 minutes to 3:43
3. puppet is done, but never reports that it finished and appears hung since it 
probably cant output a negative number anyways.
4.  a restart of puppet seems to fix the issue until the time changes again.

# Class: timesync
#
# This module is a bandaid to keep virtual machines in sync with the time 
server.
# This will basically sync the time whenver the time drifts out further than xx 
seconds. 
#
# Parameters:
#
# Actions: syncs the time with the timeserver
#
# Requires: timeoffset fact (esentially ntpdate -q ntpserver)
#
# Sample Usage:
#
class timesync {

# time in seconds that the clock needs to be out of sync before calling 
ntpdate
$seconds=60

$timeserver="0.pool.ntp.org"


# only run max of six times per day
schedule { timecheck:
 period => daily,
 repeat => 6,
}
# only execute if time is out of sync by specified seconds
if ( $timeoffset > $seconds ){
exec{"synctime":
path => ["/bin", "/usr/bin/", "/sbin", "/usr/sbin/"],
#   schedule => timecheck,
command => "ntpdate $timeserver",

    }

alert("Puppet had to sync the time as it was out of sync")
}


}


Corey Osman
co...@logicminds.biz
Green I.T and Datacenter Automation Specialist



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Could not render to b64_zlib_yaml after 2.6.12 upgrade

2011-11-08 Thread Corey Osman
Hi,

I just reinstalled puppet to version 2.6.12 to patch the security bug. Now all 
of my RHEL4 clients are getting this error:
Puppet master is running 2.7.6
Clients are running 2.6.12


puppet-agent[11444]: Starting Puppet client version 2.6.12
slcdbnops1 puppet-agent[11444]: Could not run Puppet configuration client: 
Could not render to b64_zlib_yaml: uninitialized constant Base64


Any ideas?  Is this a ruby problem?

Corey Osman
co...@logicminds.biz

Green I.T and Datacenter Automation Specialist



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] root pass encryption type

2011-11-03 Thread Corey Osman
How do I add a new root password?  What should I encrypt the password with that 
foreman accepts?  MD5, SHA1?


Corey Osman
co...@logicminds.biz
678-348-0582 Pacific Time

Green I.T and Datacenter Automation Specialist



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] puppet-foreman

2011-10-18 Thread Corey Osman
Hi,

I created a centOS6 EC2 instance last night and ran the foreman puppet module 
but it came back with a few years.  Was hoping somebody could help me 
understand these errors.

[root@ip-10-170-77-129 config]# echo include foreman | puppet --modulepath 
/root/puppet-foreman/
err: 
/Stage[main]/Foreman::Config::Enc/File[/var/lib/puppet/yaml/foreman]/ensure: 
change from absent to directory failed: Cannot create 
/var/lib/puppet/yaml/foreman; parent directory /var/lib/puppet/yaml does not 
exist

[root@ip-10-170-77-129 config]# mkdir /var/lib/puppet/
clientbucket/ client_data/  client_yaml/  facts/lib/  ssl/  
state/

Should the foreman puppet module be altered to say client_yaml instead of yaml? 
 Was the foreman module was created with an older puppet version in mind?


Or is this because I didn't start my puppetmaster before using the foreman 
module.



Corey Osman
co...@logicminds.biz

Green I.T and Datacenter Automation Specialist



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Setting file level ACL

2011-09-27 Thread Corey Osman
How do I go about using puppet to set an ACL on a file.  I did not see ACL 
support under the file type.

Has anybody done this before without using exec?

Example:

# Set ACL on directory
setfacl -R -d -m mask:007 /directory



Corey Osman




-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] help using unless in exec for postgres database creation

2011-08-15 Thread Corey Osman
Hi,

I have the following exec type:

exec{"createdb":
path => "/usr/bin:/usr/sbin:/bin",
command => "sudo -u postgres createdb -U postgres -E UNICODE opennms",
unless => "sudo -u postgres psql -l | grep opennms > /dev/null",
require => Service["postgresql"],
 }

Where this basically says, if the database exists don't run the create database 
command.  However, the unless statement doesn't behave like it should and 
puppet apply seems to execute the exec command regardless of what the unless 
statement returns.
Below is the error I receive.


err: /Stage[main]/Opennms/Exec[createdb]/returns: change from notrun to 0 
failed: sudo -u postgres createdb -U postgres -E UNICODE opennms returned 1 
instead of one of [0] at 
/etc/puppetlabs/puppet/modules/opennms/manifests/init.pp:87.  

So my question is why is exec ignoring the unless statement?  Also is there a 
better way of handling database creation than using exec?



Corey


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Help with retrieving a user's environment variable

2011-08-09 Thread Corey Osman
Good suggestions.  How about this:

Create a fact that parses /etc/oratab for the SID.  For multiple SIDS
defined in oratab, is it possible to define an array in facter?   If
not I think comma separated values would do just fine which I would
then use sid.split(',') in the puppet manifest to get each SID.

# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME::
proddb1:/oracle/product/10.2.0/db:N
proddb2:/oracle/product/10.2.0/db:N


Corey
On Aug 9, 6:19 am, Daniel Pittman  wrote:
> On Tue, Aug 9, 2011 at 06:02, Matthias Saou
> 
> wrote:
>
> > Corey Osman wrote :
>
> >> I need to get the environment variable ORACLE_SID from the OS.  I know 
> >> this can be done with the following:
>
> >> $blah = env("PATH")
>
> >> However, the ORACLE_SID variable is only set under the oracle user 
> >> account.  So I would need a way to login as the oracle account first to 
> >> retrieve the ORACLE_SID variable.  Is there anyway to get the environment 
> >> variable from a user's account instead of the default account puppet runs 
> >> under?
>
> Only horrible ways, I fear: you would need to run something that
> extracts the data.  There are two obvious ways, one is to `su` or
> equivalent into the Oracle account, then run something to extract the
> value.  The other is to extract it from the appropriate configuration
> file, ala `grep ORACLE_SID /path/to/oracle/.bashrc`.
>
> The best way is to define that value out of Puppet, or some external
> data store, and extract it in both places, exactly as Matthias
> suggests:
>
>
>
>
>
>
>
>
>
> > I'm sorry to not actually be of much help regarding your original
> > question... The thing is that puppet is usually used the other way
> > around, hence this way I use to pre-configure RHEL servers for our
> > bash-using Oracle DBAs :
>
> >  # Oracle profile sourced file
> >  file { '/etc/profile.d/oracle.sh':
> >      mode    => '0755',
> >      content => template('/path/to/oracle.sh.erb'),
> >  }
>
> > And the template contains the following :
>
> > export ORACLE_BASE=/u01/app/oracle
> > export ORACLE_HOME=/u01/app/oracle/oracle/product/<%= version %>/<%=
> > title %><%= oracle_home_suffix %>
> > export ORACLE_SID=<%= oracle_sid %>
> > export TNS_ADMIN=$ORACLE_HOME/network/admin
>
> > if [ `/usr/bin/id -un` == "oracle" ]; then
> >        export PATH=$PATH:$ORACLE_HOME/bin
> > fi
>
> Daniel
> --
> ⎋ Puppet Labs Developer –http://puppetlabs.com
> ♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Help with retrieving a user's environment variable

2011-08-08 Thread Corey Osman
Hi,

I need to get the environment variable ORACLE_SID from the OS.  I know this can 
be done with the following:

$blah = env("PATH")

However, the ORACLE_SID variable is only set under the oracle user account.  So 
I would need a way to login as the oracle account first to retrieve the 
ORACLE_SID variable.  Is there anyway to get the environment variable from a 
user's account instead of the default account puppet runs under?


Corey

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet HP iLO module -- don't waste your time with the ilo web interface

2011-08-04 Thread Corey Osman
I just finished this module and thought I would share with the rest of the 
puppet community.
You can get the module by following the link below.

https://github.com/logicminds/devops/tree/master/puppet-modules/hpilo


enjoy,

Corey Osman

--README File from hpilo Module-
This module will configure your hp ilo card automatically without 
the use of a password that is phsycially printed on the server.

This module is very useful for when you don't have physical access
to the server and can't get the ilo admin password or you have many
servers to configure and the web interface just takes to long. 
Fear not, there is now a puppet module to help you out.

This is the hpilo module. Please see manifests/base.pp for more info.
You will need to make changes to the base.pp file to suit your environment.

If you have suggestions on how to improve this module please send me an email.


Usage:
1. Configure the manifests/base.pp file to suit your environment
2. Assign hpilo::dhcp or hpilo::static class to your system(s).

hpilo::dhcp = uses your dhcp server to assign the IP to the ilo
hpilo::static = assigns a static ip to the ilo
hpilo::base = the base class for hpilo::dhcp and hpilo::static

Requirements:
1. You must have the proliant support pack installed, specifically the hponcfg 
utility in /sbin

How it works:
1. A ilo configuration file is automatically created via the iloconfig.erb 
template
   and your variables in manifests/base.pp
2. The ilo config file is placed in /ilosettings.xml on the node
3. if /sbin/hponcfg exists, puppet will then configure the ilo interface with 
this ilosettings.xml file
4. Your ilo card will reset after the settings have been applied with the new 
values defined in ilosettings.xml


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: [foreman-users] Foreman 0.3 released

2011-06-07 Thread Corey Osman
Horray!

Sent from my iPhone

On Jun 7, 2011, at 1:15 AM, Ohad Levy  wrote:

> I'm pleased to announce the release of Foreman 0.3
> 
> Download from:
> 
> Source: http://theforeman.org/attachments/download/237/foreman-0.3.tar.bz2
> RPM: http://yum.theforeman.org/stable/RPMS/foreman-0.3-1.noarch.rpm
> 
> It is recommended to upgrade your foreman smart proxy to the latest version 
> as well.
> 
> Highlights of this release include:
> 
> Searching
> 
> An extensive rewrite of the search system was performed.
> Foreman now has a searchbar that prompts for possible search fields and 
> values.
> Searches can consist of multiple clauses with complex logic operations.
> Previous searches can be saved as a bookmark and made public for others to 
> use.
> Many more search conditions, among them:
> Host can be found by their parameters
> Host can be found by their classes (direct associations or though host 
> groups).
> Host can be found by all valid combinations (e.g. multiple facts, report 
> status, time stamps etc)
> Audits search target have been greatly enhanced
> All Search conditions could be used via the API as well
> Search can apply on pages such as the dashboard (e.g. show only hosts in 
> environment != development)
> Authorization
> 
> A user is always granted access to their own account information. This also 
> allows Internal users to change their password even if they do not have edit 
> rights on User.
> Additional permission groups have been added to control access to nearly all 
> of Foreman's feature.
> Charting
> 
> The graphing libraries have been replaced with the Highchart system.
> Internet access is no longer required to view charts.
> They look way better :p
> Virtualization
> 
> The hypervisor pages now show more information about their guests.
> Virtual clients can now be deleted/stopped/started etc.
> Smart-proxy extensions
> 
> Puppet certificates can now be displayed, signed and revoked from within 
> Foreman.
> Autosign entries can be managed from within Foreman.
> API
> 
> Many more operations that are available from the Web interface have been 
> exposed via the API. These are just a few:-
> 
> Classes per host
> Host's last report
> Statistics can be retrieved
> Complex search queries could be performed via the API as well using the same 
> search syntax as in the UI
> Information for developers
> 
> The Backend Prototype Javascript library has been replaced with jQuery, thus 
> providing a much richer set of graphical browser components
> Misc.
> All communication between smart-proxies and Foreman could be encrypted over 
> HTTPS channels.
> Support for Scientific Linux has been added.
> Most operations now refer to the host by its name rather than its id in the 
> URL.
> Selected hosts tickbox works across multiple pages.
> Foreman handles unreachable proxies gracefully.
> Hosts which report skipped operations are no longer considered as being in 
> error state.
> When creating or editing a host the provisioning templates that will be used 
> are displayed.
> 
> The complete changes list can be found here: 
> http://theforeman.org/versions/show/4
> 
> As Usual, many thanks to all contributors and users!!!
> 
> Have fun,
> Ohad
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Foreman users" group.
> To post to this group, send email to foreman-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> foreman-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/foreman-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Getting information from puppet modules

2011-06-01 Thread Corey Osman
Hi,

I have created a few modules with the puppet-module generate function and I 
wanted to know how I can use some of the module's json features to get metadata 
information from the module.  

Is there an api to get this module info?

"puppet-module generate cosman-test" creates the following directory contents:


-rw-r--r--  1 cosman2001  cosman2001  223 Jun  1 11:17 Modulefile
-rw-r--r--  1 cosman2001  cosman2001   31 Jun  1 11:17 README
drwxr-xr-x  3 cosman2001  cosman2001  102 Jun  1 11:17 files
drwxr-xr-x  4 cosman2001  cosman2001  136 Jun  1 11:17 lib
drwxr-xr-x  4 cosman2001  cosman2001  136 Jun  1 11:17 manifests
-rw-r--r--  1 cosman2001  cosman2001  602 Jun  1 11:17 metadata.json
drwxr-xr-x  6 cosman2001  cosman2001  204 Jun  1 11:17 spec
drwxr-xr-x  3 cosman2001  cosman2001  102 Jun  1 11:17 templates
drwxr-xr-x  3 cosman2001  cosman2001  102 Jun  1 11:17 tests

Inside the Modulefile:

powerbeast:cosman-test cosman2001$ cat Modulefile 
name'cosman-test'
version '0.0.1'
source 'UNKNOWN'
author 'cosman'
license 'UNKNOWN'
summary 'UNKNOWN'
description 'UNKNOWN'
project_page 'UNKNOWN'

## Add dependencies, if any:
# dependency 'username/name', '>= 1.2.0'



Inside the metadata.json file:
powerbeast:cosman-test cosman2001$ more metadata.json 
/*
+---+
|   |
|==> DO NOT EDIT THIS FILE! <== |
|   |
|   You should edit the `Modulefile` and run `puppet-module build`  |
|   to generate the `metadata.json` file for your releases. |
|   |
+---+
*/

{}

After "building" the module (puppet-module build modulepath)

metadata.json now looks like this:

powerbeast:cosman-test-0.0.1 cosman2001$ more metadata.json 
{
  "description": "UNKNOWN",
  "types": [

  ],
  "summary": "UNKNOWN",
  "license": "UNKNOWN",
  "checksums": {
"spec/spec_helper.rb": "ca19ec4f451ebc7fdb035b52eae6e909",
"lib/puppet/type/README.markdown": "34b8c80ba8683afca99f2d28ca7e70b2",
"spec/unit/puppet/provider/README.markdown": 
"e52668944ee6af2fb5d5b9e798342645",
"files/README.markdown": "3d44458cc68d8513b51e3b56c604eec4",
"lib/puppet/provider/README.markdown": "3835801d7626dd8d541c4fdf7ca9f3e4",
"lib/puppet/parser/functions/README.markdown": 
"e596ce938864a80fd1e51640cca7f612",
"README": "dee827ceab754b7617701b18a795db1e",
"manifests/README.markdown": "b9970454391883e36b55137328792a55",
"tests/init.pp": "f9b848a7b81e872ff915cf7beb236ec1",
"templates/README.markdown": "aada0a1952329e46b98695349dba6203",
"spec/README.markdown": "32a1fc0121c28aff554ef5d422b8b51e",
"lib/facter/README.markdown": "145e26334b4d80e48e9e55ba78800579",
"spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c",
"metadata.json": "d34d0b70aba36510fbc2df4e667479ef",
"spec/unit/puppet/type/README.markdown": "de26a7643813abd6c2e7e28071b1ef94",
"Modulefile": "176fcfdeda0b1c5f60043671520d91b1",
"manifests/init.pp": "4fdf6c37a67ef6473529390df3c66cbf"
  },
  "source": "UNKNOWN",
  "version": "0.0.1",
  "dependencies": [

  ],
  "name": "cosman-test",
  "author": "cosman",
  "project_page": "UNKNOWN"
}


Now how would I get this wonderful metadata?  Does an API exist or do I need to 
create something?







-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] report for schedule items

2011-05-20 Thread Corey Osman
Hi,

Currently when a resource is scheduled, that resource doesn't run until its 
supposed to.  However, the puppet report currently doesn't show if a resource 
is schedule as it just marks it as skipped.  Is there a way to separate out 
skipped from scheduled in puppet reports?


Corey



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] puppet resource for group

2011-05-13 Thread Corey Osman
Hi,

Why doesn't puppet resource group tell me who belongs to the group?

Given the group such as:
mg_team:x:501:smruph, cosman, msmith, mhankey

With the command:
puppet resource group mg_team

only returns:

group { 'mg_team':
gid => '501',
ensure => 'present'
}

I was expecting:

group { 'mg_team':
gid => '501',
ensure => 'present'
members => ['smruph', 'cosman', 'msmith', 'mhankey'],
}


Am I missing a parameter or something?


Corey

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] variables inside a template for my hp ilo device

2011-05-04 Thread Corey Osman
I am writing a hp ilo module to automatically assign a static ip that is 
derived from the IP of the system which is fed in via facter.  I basically just 
need to change the network the ilo is connected to.

The ruby code works great inside the irb console.  However, puppet doesn't seem 
to be able to use the variable I have derived from the ipaddress.  This is my 
first template so I am not exactly sure if I can use ruby syntax inside a 
template.  

Any ideas on how I can accomplish this?





# Define the two variables which will be used to determin which network the ilo 
will go on
ilonet = '21'
gwbit = '240'
dns = '10.0.1.19'
netmask = '255.255.255.0'

iparray = ipaddress.split('.')
iloip = iparray[0] + '.' + iparray[1] + '.' + iparray[2] + '.' + ilonet
gwarray = iloip.split('.')
gateway = gwarray[0] + '.' + gwarray[1] + '.' + gwarray[2] + '.' + gwbit



  



  









  
  
  

  
  
  
  
  

  
  


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: ssh_authorized_key fails when home directory doesn't exist

2011-04-22 Thread Corey Osman
For anybody interested I found a feature request already created.
Please vote on it and make it visable for Puppetlabs to include in the
next release.


http://projects.puppetlabs.com/issues/651




On Apr 22, 10:50 am, Corey Osman  wrote:
> Yes but if I am understanding you correctly I can't just let puppet
> own the required resources.  The directories are created automatically
> via PAM config upon initial login.  I can't define a user type or a
> file type as I don't know the UID.
>
> ssh_authorized_key{ "billys key":
>                     ensure => present,
>                     key => 'billys sshkey',
>                     name => "super duper key",
>                     type => ssh-rsa,
>                     user =>"billy",
>                     onlyif => "test -d /home/${user}"
>                     }
> I am assuming that I can refer to the user with ${user} and that
> onlyif is a valid parameter.
>
> Does every defined type have onlyif parameter built in?
>
> On Apr 21, 4:00 pm, Jeff McCune  wrote:
>
>
>
> > On Thu, Apr 21, 2011 at 3:41 PM, Corey Osman  wrote:
> > > Here is my situation:
>
> > > 1. We use Active directory (LDAP) to store all user info which is 
> > > retrieved from linux
> > > 2.  A home directory is not created until the first time the user logs 
> > > into the linux system
>
> > > I am using the ssh_authorized_key type to push out my ssh keys to every 
> > > system.  However, because I haven't logged into every system at least 
> > > once.  Puppet errors out due to a missing home directory when trying to 
> > > create the authorized_keys file.  The simple remedy is to login to the 
> > > box and have the home directory created (su - username).  However, I  
> > > would like the ssh_authorized_key type to not fail but just give a 
> > > notice.  (home directory does not exist, skipping) therefore the reports 
> > > don't show errors and give misleading errors in the reports.
>
> > > ssh_authorized_key{ "billys key":
> > >                    ensure => present,
> > >                    key => 'billys sshkey',
> > >                    name => "super duper key",
> > >                    type => ssh-rsa,
> > >                    user =>"billy",
> > >                    onlyif => "test -d /home/${user}"
> > >                    }
>
> > > I am assuming that I can refer to the user with ${user} and that onlyif 
> > > is a valid parameter.
>
> > > Is this possible?
>
> > Wouldn't it be better to make sure the home directory does exist, as
> > well as the ~/.ssh directory?
>
> > This is often accomplished by creating a defined resource type to
> > contain all of the resources you need to manage to give you access to
> > the system.
>
> > --
> > Jeff McCune
> > Professional Services, Puppet Labs
> > @0xEFF

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: ssh_authorized_key fails when home directory doesn't exist

2011-04-22 Thread Corey Osman
Yes but if I am understanding you correctly I can't just let puppet
own the required resources.  The directories are created automatically
via PAM config upon initial login.  I can't define a user type or a
file type as I don't know the UID.

ssh_authorized_key{ "billys key":
ensure => present,
key => 'billys sshkey',
name => "super duper key",
type => ssh-rsa,
user =>"billy",
onlyif => "test -d /home/${user}"
}
I am assuming that I can refer to the user with ${user} and that
onlyif is a valid parameter.

Does every defined type have onlyif parameter built in?

On Apr 21, 4:00 pm, Jeff McCune  wrote:
> On Thu, Apr 21, 2011 at 3:41 PM, Corey Osman  wrote:
> > Here is my situation:
>
> > 1. We use Active directory (LDAP) to store all user info which is retrieved 
> > from linux
> > 2.  A home directory is not created until the first time the user logs into 
> > the linux system
>
> > I am using the ssh_authorized_key type to push out my ssh keys to every 
> > system.  However, because I haven't logged into every system at least once. 
> >  Puppet errors out due to a missing home directory when trying to create 
> > the authorized_keys file.  The simple remedy is to login to the box and 
> > have the home directory created (su - username).  However, I  would like 
> > the ssh_authorized_key type to not fail but just give a notice.  (home 
> > directory does not exist, skipping) therefore the reports don't show errors 
> > and give misleading errors in the reports.
>
> > ssh_authorized_key{ "billys key":
> >                    ensure => present,
> >                    key => 'billys sshkey',
> >                    name => "super duper key",
> >                    type => ssh-rsa,
> >                    user =>"billy",
> >                    onlyif => "test -d /home/${user}"
> >                    }
>
> > I am assuming that I can refer to the user with ${user} and that onlyif is 
> > a valid parameter.
>
> > Is this possible?
>
> Wouldn't it be better to make sure the home directory does exist, as
> well as the ~/.ssh directory?
>
> This is often accomplished by creating a defined resource type to
> contain all of the resources you need to manage to give you access to
> the system.
>
> --
> Jeff McCune
> Professional Services, Puppet Labs
> @0xEFF

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] ssh_authorized_key fails when home directory doesn't exist

2011-04-21 Thread Corey Osman
Here is my situation: 

1. We use Active directory (LDAP) to store all user info which is retrieved 
from linux
2.  A home directory is not created until the first time the user logs into the 
linux system


I am using the ssh_authorized_key type to push out my ssh keys to every system. 
 However, because I haven't logged into every system at least once.  Puppet 
errors out due to a missing home directory when trying to create the 
authorized_keys file.  The simple remedy is to login to the box and have the 
home directory created (su - username).  However, I  would like the 
ssh_authorized_key type to not fail but just give a notice.  (home directory 
does not exist, skipping) therefore the reports don't show errors and give 
misleading errors in the reports.  

ssh_authorized_key{ "billys key":
ensure => present,
key => 'billys sshkey',
name => "super duper key",
type => ssh-rsa,
user =>"billy",
onlyif => "test -d /home/${user}"
}

I am assuming that I can refer to the user with ${user} and that onlyif is a 
valid parameter.

Is this possible?



Corey

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Script to find potential puppet clients

2011-04-19 Thread Corey Osman
Has anybody written a script that will scan the network to find systems not 
running puppet and ultimately send an email with the findings?




I was thinking I can do this by just scanning for port 8141 or is it 8139?  
This would assume listen=true is setup on all the existing clients though.  I 
could then filter out any of the candidates by ensuring the ssh port is open 
(this might tell me its a unix system).  

Anybody interested in such a script run via a cron job?


Corey

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: ssh_authorized_key type not working

2011-04-08 Thread Corey Osman
Ben,

What do you mean change encryption to type?  Do you mean change type
=> "ssh-rsa"  to encryption=> "ssh-rsa"?

On Apr 7, 5:18 pm, Ben Hughes  wrote:
> On Thu, Apr 07, 2011 at 10:51:04AM -0700, Corey Osman wrote:
> > puppet resource ssh_authorized_key  (this returns nothing)
>
> > puppet resource ssh_authorized_key username  (this returns the following)
>
> Hmm, yes, the ssh_authorized_key key parameter isn't the username. Though
> that is not a very optimal error message.
>
> If you change encryption to type, I had that working for me.
>
> ssh_authorized_key{ "macbook-root":
>                         ensure => present,
>                         key => 
> "B3NzaC1yc2EBIwAAAQEAxsDSms5CWF1iKlyCFLaPfs0It4dDXwhH1W2REzz7K/b5pXsOJyOzCHEO6odcHda039GHMc36rrkO6qOOQlU/6J6wZhqTc02P9OkkCcTT9404SCC5TMgXV+obdgMjNzIE5R46fC8buUO/sYcew31KBRhmvcahyvvqeHOXkj8jHYUw3IjI2+Yn+OczXjS23NMwGTc5dhEw+BLBeoIzNZ1+2bvzKZTtuadEF6WJcBDld7CoC65UFwiyO9Vls8O4PNrusObbgzD2RXp3UyX06tPQa/HACbhvPt3kqin061vvmXSW64GK47P6Pkvk5aS8YB2J4qLemKH3NjPx05gPWQ==",
>                         name => "macbook pro key",
>                         type => "ssh-rsa",
>                         user =>"corey",
>                 }
>
> --
> Ben Hughes ||http://www.puppetlabs.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] ssh_authorized_key type not working

2011-04-07 Thread Corey Osman
I can't seem to get the authorized_key type to work at all on my systems.  
Below is my configuration that I used.  I could have something missing but the 
examples I see make it difficult to compare.  Additionally if I try and do the 
reverse using puppet resource nothing comes up:

puppet resource ssh_authorized_key  (this returns nothing)

puppet resource ssh_authorized_key username  (this returns the following)

/usr/lib/ruby/site_ruby/1.8/puppet/type/ssh_authorized_key.rb:89:in `validate': 
undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1738:in `initialize'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector/resource/ral.rb:5:in 
`new'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector/resource/ral.rb:5:in 
`find'
from 
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:193:in `find'
from /usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/resource.rb:79:in 
`main'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:295:in 
`run_command'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in 
`exit_on_fail'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in 
`execute'
from /usr/bin/puppet:4






My module's init.pp

http://pastebin.com/4aBYjJQq


Does anybody else have this working in their environment?



Corey Osman

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] duplicate entries in classes.txt

2011-04-04 Thread Corey Osman
I am not sure why I am getting duplicate entries in my classes.txt file under 
/var/lib/puppet. 
 I am using puppet 2.6.4 version.  I am also using foreman as my external node 
classifer.  

This is on the client:

bash#more classes.txt 
ad2ldap
base_services
baseapps
sudo
tier3_keys
settings
ad2ldap
baseapps
sudo

Classes according to the node classifier from the puppet master server:

bash# /etc/foreman/external_node.rb pong.mydomain.corp
--- 
  parameters: 
puppetmaster: puppetprod
  classes: 
- ad2ldap
- base_services
- baseapps
- sudo
- tier3_keys
  environment: production



Any idea why the two examples are not equal?


Corey


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Pycon 2011

2011-03-11 Thread Corey Osman
Hi,  someone is giving a talk about puppet at pycon.  Are there any other 
puppet users at pycon?

Sent from my iPhone

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Help with Oracle Installer manifest

2011-01-14 Thread Corey Osman
Well based on all the feedback, I have decided to go the RPM route.  I
had thought about it earlier and it sounded silly to package a 1.8GB
gz file into an rpm.
However, below is what I have decided to do:

1. Install oracle with patches
2. Tar+gzip entire /opt/oracle directory  (954MB) vs 1.8GB install
files
3. Create an rpm spec file using the following script
http://www.mindtwist.de/main/linux/3-linux-tipps/32-how-to-convert-tar-gz-archive-to-rpm-.html
4. Require oracle-validated (currently using already )
5. Install via yum provider in puppet

The spec file is 1.4mb and has about 20K lines of code due to 19,500
files being put on disk on install.
The only improvement I could make on this is to split the big rpm into
four smaller rpms that require all the smaller rpms.
Is there a better way?

I found this script that will turn a tar.gz into an rpm spec file.
http://www.mindtwist.de/main/linux/3-linux-tipps/32-how-to-convert-tar-gz-archive-to-rpm-.html

On Jan 14, 1:39 am, Sven Sporer  wrote:
> > How can I tell if oracle is install or any program when its install without 
> > rpm?
> > How can I tell when the untar command is finished?  
> > What happens when it takes a while to transfer 1.8GB file?  
> > Does the "user => oracle" give me the environment of the user like su - 
> > oracle would?
> > Is there a provider for patching oracle?  Is there a patch type?
> > Is it bad to have lots of exec statements?
>
> Hi, I have a similar use case. I like the idea of installing via RPM,
> where the RPM is only a meta package which contains the install
> routine, but not the install media. The steps in the manifest are:
>
> 1) check if Oracle is not installed (ex: unless => "rpm -q
> oracle_database"; Facter fact)
> 2) if not installed, Mount[oracle_sources]
> 3) ensure Package[oracle_database] is installed
> 4a) in RPM: start runInstaller
> 4b) alternatively, you could place a script (containing the
> runInstaller command) with the software sources, and the RPM only
> calls "/sources/mount/oracle_install.cmd"
>
> What do you think?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Help with Oracle Installer manifest

2011-01-13 Thread Corey Osman


On Jan 13, 7:19 pm, Patrick  wrote:
> On Jan 13, 2011, at 6:26 PM, Corey Osman wrote:
>
> > What happens when it takes a while to transfer 1.8GB file?  
>
> Just a quick warning before I leave, don't even think of copying this using 
> puppet if you have version 0.25.x or below.  Those version load the whole 
> file into RAM before copying.  This might be fixed in 2.6.x.

Yikes!  Thanks for the quick notice
How does it transfer the file?  Https?  ssh? rsync?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Help with Oracle Installer manifest

2011-01-13 Thread Corey Osman
Hi,

I am somewhat new to puppet and I wanted to show a demo that automated the 
install of oracle to my DBA in hopes to entice him to start automating his 
procedures.



I have linked my manifest code below for review.  In the code I have attempted 
to automate a complete oracle install by following the instructions provided by 
my DBA.  Its very rough code as I am not an expert yet. 

http://pastebin.com/Qw39iP7z

The code assumes that the oracle pre-install checklist has been completed via 
another class called oraclebase.  I am using oracle generated response files to 
automate the actual oracle install.  However since oracle doesn't come inside 
an rpm I don't know of a good way to check if oracle is installed.  Using du is 
probably the worst way since after an install it will take too long to 
determine if the size is bigger than 5 (line 16).  

I thought about using NFS to install which would change my cwd to 
/net/nfsserver/oracle_install/database which would save bandwidth but there may 
be times when NFS is unavailable or slow WAN links.

How can I tell if oracle is install or any program when its install without rpm?
How can I tell when the untar command is finished?  
What happens when it takes a while to transfer 1.8GB file?  
Does the "user => oracle" give me the environment of the user like su - oracle 
would?
Is there a provider for patching oracle?  Is there a patch type?
Is it bad to have lots of exec statements?


Let me know if you have any insight or possibly interested in this code.  I 
would eventually like to turn this into a module.


thanks,


Corey



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.