Displaying 20 results from an estimated 30000 matches similar to: "Ruby DSL: create_resource with exec"
2010 Dec 10
3
Re: [Puppet-dev] Converting to Ruby DSL
On Dec 8, 2010, at 11:09 AM, Ken Barber wrote:
> (cross posting here as I originally posted in puppet-users - I figure the question is more of a dev one then for puppet-users)
>
> Hi everyone,
>
> I''m experimenting with converting some of my live puppet content to
> Ruby DSL and have found a few gaps I wouldn''t mind some advice on. I''m
> not sure
2011 Aug 11
6
need urgent help with including Ruby DSL class from puppet manifests
Hi,
I have a Ruby class in "nagios" module - it''s located in nagios/
manifests/ssa_nagios_checks.rb
and looks like this
hostclass :ssa_nagios_checks do
...
end
In nagios/manifests/init.pp I have
class nagios::server {
...
include ssa_nagios_checks
...
}
And I get the following error
....
debug: importing ''/etc/puppet/modules/nagios/manifests/
2011 Mar 23
1
way of importing .pp file or some string that contain class definition in ruby dsl
I''m finding the way to import a file or a class stored in string in
ruby manifest.
I have tried following code to parse the class having packages and
services.
pp = Puppet::Parser::Parser.new("development")
pp.string = "class webhttpd{package { ''httpd'': ensure => installed, }
service { ''httpd'': ensure => running, enable =>
2012 Feb 08
11
define hostclass with special characters
Hi,
I need to define the hostclass with special character for ex:
"swift::proxy-ring"
I have tried following ways but not worked:
1) hostclass :swift::proxy-ring do
2) hostclass ''swift::proxy-ring'' do
3) hostclass "swift::proxy-ring" do
When I am using the 2 and 3 options it is giving following erroe:
undefined method `[]'' for Class:Class at
2012 Jul 05
1
Ruby DSL parameterized classes and defaults
I''ve been reading the Docs on this, and its not very clear.
I want to have a parameterized class that takes arrays and objects as
parameters.
I''m using puppet 2.6.16.
I define a hostclass like this:
hostclass :test, :arguments => { :param1 => "blah" } do
end
I call from Puppet DSL:
class {"test":
}
I get this as an error:
err: Could not
2010 Dec 09
1
Calling class defines in pure ruby DSL
Let''s say I have a define in class ''foo'' called ''foo::bar'':
define foo::bar ($var1, $var2) {
...
}
Then I have a ruby hostclass
hostclass :foo do
...
}
I see I can successfully set the parameters by doing:
environment.known_resource_types.definitions[''foo::bar''].set_arguments :var1 => ''val1'', :var2 =>
2012 Aug 17
5
Hiera, Hashes, and Create_resources
Howdy:
I need some help please to get hiera configuration data derived
from YAML, thru puppet. I have studied Internet search results and
puppet documentation on create_resources and custom defines but
need a little help along. I can print out the YAML from variables,
arrays, and, finally, hashes too from a puppet manifest.
One thing that is stumping me is how to access from the custom
define
2011 Jun 07
2
Changes on master applied only on second run on nodes
Hi!
If I change manifest on master and then immediately run "puppet agent
--no-daemonize --report --pluginsync --onetime" then it still uses old
version of manifest. When I run it second time it sees changes and
applies them.
Why is it like that? Is it intended to be so?
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To
2011 Aug 17
3
Using back-ported create_resources in 2.6.x
Does anyone have some examples of using this create_resources
function, https://github.com/puppetlabs/puppetlabs-create_resources,
? Based on the README example I can''t figure out exactly how to
change from using defines to using this function. Maybe I
misunderstand the purpose of create_resources...is it to replace
defines, or is it to allow ENCs (for example) to use a define?
Below
2012 Mar 30
2
Does create_resources support virtual resources?
Hi all,
I''m interested pushing my user list out of my users manifest and into
Hiera. Unfortunately I haven''t been able to get it to work the way I
thought it would. The error suggests that perhaps create_resources
cannot create virtual resources, but the docs I''ve read so far don''t
address it.
The class (in init.pp):
class users {
$system_users =
2012 May 22
0
How to define class inheritance with Puppet Ruby DSL
I have a module "Ruby":
# init.pp
class ruby {
package { ''libldap-ruby1.8'':
ensure => ''installed''
}
}
Then I have a manifest written with Ruby-DSL, which should inherit this
module:
# ldap.rb
hostclass ''ruby::ldap'' do
(...)
end
How do I define that *ruby::ldap* inherits *ruby*?
--
You received this message because
2010 Jul 22
9
First Foray into Parameterized Classes.... not so good
I have this:
class foo::foobar ($version) {
}
which is called like this:
class facility::sanjose inherits facility::common {
class { foo::foobar: version => "1.3.13" }
}
puppet complains with this on the client:
Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find parent resource type ''facility::sanjose'' of type
hostclass in
2013 Mar 08
5
hiera / create_resources / define
I''m trying to use create_resources to create a series of files with
semi-custom content based on a template.
This is what I have:
foo.conf.erb:
Name "<%= name %>"
WorkingDir "<%= working_dir %>"
... a bunch of static entries
YAML:
configs:
config1:
Name: app1
WorkingDir: /var/app1
config2:
Name: app2
WorkingDir: /var/app2
2011 Jan 10
2
Problem with multiple requires in Ruby DSL
I''m loving playing around with the DSL. There are some problems (ie
5237), but now that it''s Ruby, I can fix them! woo!
However, I''m stumped on this one, which may or may not be related to
the DSL. When trying to have a resource have a simple dependency on
two things at once, it simply fails, and I''m stumped as to why. The
error message is:
Parameter
2013 Jun 12
2
Executing a script after creating vhosts with create_resources
Hello
I''d love a bit of advice in terms of how I should best go about this.
I am creating a bunch of vhosts, their definitions are stored in json (I''m using heira) that json file will be generated from data held on another server. I''m just using the puppetlabs apache module and create_resources to then generate all the vhosts and their directories etc. I''m
2006 Jul 26
15
Pupppet Ruby DSL
I constantly get told I should just create a DSL in Ruby, instead of
having a separate, custom language. This has, unsurprisingly, come
up multiple times here at OSCON.
So, I decided I''d see if I could hack something up and see how it
looked. This is the first thing I could come up with in terms of the
basic functionality:
#!/usr/bin/ruby
class Base
file "/etc/passwd",
2013 Jul 30
2
Failed to parse template, wrong number of arguments (create_resources)
I''m having some issues trying to track down a problem I''m having parsing a
simple template, using create_resources and Hiera. Here''s my setup
(abridged):
../hieradata/settings.yaml:
*global:*
* variables:*
* env: foo*
*
*
*appSpecific:*
* serverName: someServer*
../modules/test/manifests/init.pp:
*class test {*
* create_resources(test::variables,
2013 Apr 03
1
Using single hiera hash for two create_resources, and mounting filesystems
I am trying to use the same hiera hash to create the mount point and
mounts. (Would be nice if mount could create the mount points using 3.1.1)
My plan was to define create_mount_points and use create_resources with the
same hash, and just though away what I dont use.... maybe there is a
better means?
Here is the mount class:
class fstab::mounts ( $config = undef ) {
$defaults = {
2012 Jul 20
2
rspec-puppet and create_resources
Using rspec-puppet should I be able to check for resources created as a
result of a create_resources call within a class?
Regards,
Mark
--
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/-/bUD_CitDYCAJ.
To post to this group, send email to
2012 Jul 18
1
create_resources function and puppet enc
Hi,
I am trying to create multiple users using puppet. I have created a ENC and
trying to use class wrapped defined types with create_resources function.
For some reason things are falling apart. I would really appreciate some
help on these
Here are the details about my classes and configuration
http://serverfault.com/questions/409001/create-resources-function-and-puppet-enc
--
You