Displaying 20 results from an estimated 30 matches for "newparam".
2007 Sep 24
3
Custom type
Hi.
I have a small problem with the custom type I am working on. I define
method ''evaluate'' which is called after all data is been collected. Here
it is:
module Puppet
newtype(:test) do
newparam(:name) do
end
newparam(:listen) do
defaultto "silent"
end
def evaluate
puts "evaluating..."
return super.evaluate
end
end
end
The problem is that when running puppet I get:
err: //default/testz/Test[1]: Failed to retrieve current state...
2012 Nov 07
2
Custom Type & Invalid Parameter...
...> desc "Netapp Volume resource state. Valid values are: present, absent."
>
> defaultto(:present)
>
> newvalue(:present) do
> provider.create
> end
>
> newvalue(:absent) do
> provider.destroy
> end
> end
>
> newparam(:name) do
> desc "The volume name."
> isnamevar
> end
>
> newparam(:initsize) do
> desc "The initial volume size."
> defaultto "1g"
> end
>
> newparam(:aggregate) do
> desc "The aggregate this volume sho...
2009 Sep 10
1
trouble with custom type on 0.24.8
...init.pp for zypper module:
class zypper {
}
zypper_repo.rb:
module Puppet
newtype(:zypper_repo) do
@doc = "Ensure that the given repo is defined on the system,
and add it if not present."
ensurable
newparam(:name) do
desc "The name of the repository"
isnamevar
end
newparam(:enabled) do
desc "Enabled status of the repository"
newvalues(:yes, :no)...
2011 Jan 21
6
help writing types/provider
...ly
seems to fire if the parameter is there;
it doesn''t get checked if the parameter is absent.
=======================================================
# cat lib/puppet/type/rabbitmq_user.rb
Puppet::Type.newtype(:rabbitmq_user) do
@doc = "Manage RabbitMQ users"
ensurable
newparam(:name) do
desc "The name of the user"
validate do |n|
raise ArgumentError, "cannot be empty" if n.empty?
raise ArgumentError, "can''t contain spaces" if ( n =~ %r(\s+) )
resource[:provider] = :rabbitmq_user
end
isnamevar
en...
2012 Sep 05
4
Custom type obligatory field?
...6_64'',
isolink =>
''http://mi.mirror.garr.it/mirrors/CentOS/6.3/isos/x86_64/CentOS-6.3-x86_64-bin-DVD1.iso'',
}
This rule would ensure that the kernel swappiness setting be set to ''20''"
desc "The cobbler distro type"
ensurable
newparam(:name) do
isnamevar
desc "The name of the distro, that will create subdir in $distro"
end
newparam(:arch) do
desc "The architecture of distro (x86_64 or i386)."
newvalues(:x86_64, :i386)
munge do |value| # fix values
case value
when :amd64...
2010 Feb 15
3
My first type/provider - does nothing...
...ider that should create logical
volumes. Seems like i''m missing something as i get nothing when i use
it: No errors and no logical volume :-(
type/logicalvolume.rb:
=================
Puppet::Type.newtype(:logicalvolume) do
@doc = "Manage logical volumes"
ensurable
newparam(:lvname) do
desc "The logcal volume''s name"
validate do |value|
unless value =~ /^[a-z0-9]+/
raise ArgumentError , "%s is not a valid lv name" %
value
end
end
isnamevar
end
newparam(:siz...
2006 Aug 05
2
PATCH: provide replace parameter for sourced files
...ases in which it is
desired to distribute initial "bootstrap" files and ensure future
existence, yet allow them to be modified on the node.
RTS
--- pfile.rb~ Wed Aug 2 04:47:05 2006
+++ pfile.rb Sat Aug 5 04:59:11 2006
@@ -113,6 +113,12 @@
end
end
+ newparam(:replace) do
+ desc "Whether or not to replace a file that is
+ sourced but exists"
+ defaultto true
+ end
+
newparam(:ignore) do
desc "A parameter which omits action on files matching
specified patte...
2010 May 17
3
Writing a properly-formed custom type (configxml)
...and convert the array to hash
updates = Hash[*value(:attributes).split(/,/).map { |s| s.split(/=/) }.flatten]
# Update this element''s attributes
updates.each { |k, v| attrs[k] = v }
# Write the changes back
doc.write(File.open(value(:name), ''w''))
end
newparam(:name) do
desc "Full path of the XML document."
end
newparam(:xpath) do
desc "XPath expression selecting target elements; the first of which whose attributes will be set."
end
newparam(:attributes) do
desc "An array of strings, each containing ''k...
2012 Jul 31
3
Access @resouce in custom type
Is it possible to access @resource variables inside a type?
I would like to make some decisions on parameters based on other parameters
that may have already been set.
For example,
---
newparam(:param1) do
Puppet.debug "Found drivesperarray parameter"
desc "parameter 1"
validate do |value|
if resource[:otherparam] then
#dosomething
else
resource[:param1] = 0
end
end
Puppet.debug "Parameter 1 is: #{@resource[:pa...
2017 Jun 15
4
CloneFunctionInto produces invalid debug info
...: true, scopeLine: 1, flags: DIFlagArtificial |
DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !47,
variables: !2)
and the cloned function:
; Function Attrs: noinline nounwind uwtable
define linkonce_odr void @_ZN12MyFunnyClassC2EvCloned(%struct.MyFunnyClass*
%this, { [6 x i8*] }* %newparam) unnamed_addr #4 align 2 !dbg !73 {
entry:
%this.addr = alloca %struct.MyFunnyClass*, align 8
store %struct.MyFunnyClass* %this, %struct.MyFunnyClass** %this.addr,
align 8
call void @llvm.dbg.declare(metadata %struct.MyFunnyClass** %this.addr,
metadata !89, metadata !31), !dbg !91
... rest o...
2008 Jan 31
0
Realtime device update weirdness
...#39;
Why update to 0.0.0.0 is executed? It makes devices unreachable. When device reregisters - it becomes available for short time - then again - update to 0.0.0.0. Why it is happening?
For temporaly solution i had to patch res_config_mysql.c at line 342, added such lines:
if ((!strcmp(newparam, "ipaddr")) && (!strcmp(buf, "0.0.0.0"))){
ast_log(LOG_DEBUG,"MySQL RealTime: Avoided to update %s to %s !!!\n", newparam, buf);
ast_mutex_unlock(&mysql_lock);
return -1;
}
Regards/Pagarbiai,
Mindaugas Kezys
htt...
2010 Aug 23
4
Trouble making a pure ruby puppet type
...making a cups manager type and I''m having trouble figuring out where I should parameters and where I should use properties. The file is at http://github.com/kc7zzv/puppet-cups_printer/blob/master/lib/puppet/type/cups_printer.rb .
I was accidentally using "newproperty" and "newparameter" interchangeably, and I''d really like to know which I should be using.
Second, the documentation says to define "ensure" as a parameter, but the example I saw seems to do what I''m doing in that file. Which is right?
--
You received this message because you...
2010 Sep 16
2
Accumulating values
Greetings
I''m searching for an elegant way to contribute lines to an SNMP configuration file from resources scattered throughout a given system''s catalog, such that from anywhere, the SNMP configuration file can be arbitrarily extended like this:
$snmp::lines += "proxy -m ${mib_file} -v 2c -c ${snmp_community} localhost:1161 .1.3.6.1.4.1.42.2.145"
Forgive me if
2017 Jun 15
2
CloneFunctionInto produces invalid debug info
...ial |
> DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !47,
> variables: !2)
>
>
> and the cloned function:
>
> ; Function Attrs: noinline nounwind uwtable
> define linkonce_odr void @_ZN12MyFunnyClassC2EvCloned(%struct.MyFunnyClass*
> %this, { [6 x i8*] }* %newparam) unnamed_addr #4 align 2 !dbg !73 {
> entry:
> %this.addr = alloca %struct.MyFunnyClass*, align 8
> store %struct.MyFunnyClass* %this, %struct.MyFunnyClass** %this.addr,
> align 8
> call void @llvm.dbg.declare(metadata %struct.MyFunnyClass** %this.addr,
> metadata !89, metad...
2017 Jun 15
3
CloneFunctionInto produces invalid debug info
...zed: false, unit: !0, declaration: !47, variables: !2)
>>>
>>> and the cloned function:
>>>
>>>> ; Function Attrs: noinline nounwind uwtable
>>>> define linkonce_odr void @_ZN12MyFunnyClassC2EvCloned(%struct.MyFunnyClass* %this, { [6 x i8*] }* %newparam) unnamed_addr #4 align 2 !dbg !73 {
>>>> entry:
>>>> %this.addr = alloca %struct.MyFunnyClass*, align 8
>>>> store %struct.MyFunnyClass* %this, %struct.MyFunnyClass** %this.addr, align 8
>>>> call void @llvm.dbg.declare(metadata %struct.MyFunnyC...
2013 Jul 13
10
username/password combo for custom provider (couchbase)
Hi,
I''m trying to program custom type for managing Couchbase buckets.
Problem is that every RW operation to Couchbase cluster (creating,
deleting, resizing bucket) requires admin privileges (username/password).
Do you have any suggestion how should I pass the username/password to
provider? If I make it a param, then every resource of type
''couchbucket'' will need to
2008 Sep 10
2
Bug#490409: xen-3: diff for NMU version 3.2.1-2.1
...off blktap sub-type prefix to %s (drv '%s')\n", params, drv);
+ }
+ /* Prefix with /dev/ if needed */
+ if (!strcmp(drv, "phy") && params[0] != '/') {
+@@ -191,6 +201,7 @@ void xenstore_parse_domain_config(int do
+ sprintf(newparams, "/dev/%s", params);
+ free(params);
+ params = newparams;
++ format = &bdrv_raw;
+ }
+
+ /*
+@@ -227,9 +238,25 @@ void xenstore_parse_domain_config(int do
+
+ /* open device now if media present */
+ if (params[0]) {
+-...
2006 Apr 25
0
SQL update failing/long fullcontact
...ny ideas how to stop this? Most of the time it's harmless but some make
the SQL queries so long they overflows sql in res_config.c:
static struct ast_variable *realtime_mysql(..) {
char sql[256];
..
snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s '%s'", table,
newparam, op, newval);
..
}
then:
Apr 25 11:29:46 DEBUG[1480] res_config_mysql.c: MySQL RealTime: Update
SQL: UPDATE sip SET ipaddr = 'yyy.yy.yyy.yyy', port = '25766', regseconds
= '1145963986', username = '1st Floor Scanner - 137 <sip:xxxxxxxx',
fullcontact = ...
2010 Jun 23
0
Custom Type & Provider - param not working
I have created a custom type and provider. I wanted to go back and
add in a little more functionality so I wanted to give it a new
parameter. So where I declare the type I added
newparam(:recurse) do
newvalues(:true, :false)
defaultto :false
end
No matter what I set the param to in my pp file accessing this param
using @resource[:recurse] it is always nil. I have tried not doing
any value validation and it is still nil. I have tried not putting a
default value and it is s...
2010 Nov 16
0
Plugin dependencies
...all those parts
that have changed, and found that the use of plugins we are doing is
probably not the best approach hoping you can help me with comments
regarding this use case.
In our working 0.24.x environment we had to make use of plugins to add an
attribute in the package.rb, something like:
*newparam(:ignoredeps)*
Then on the rpm.rb a flag to add "--nodeps" was added.
* flags = []*
* if @resource[:ignoredeps]*
* flags << "--nodeps"*
* end*
* flags << "-e"*
* rpm flags, nvr*
All this because we needed to remo...