Hot answers tagged template
4
You should use a define or a parametrized class, that way you can get name to what you like (IMHO, should be a define):
define filename($template = "mytemplate.erb") {
file { $name:
content => template($template)
}
}
node 'host' {
filename { "/tmp/file1": }
filename { "/tmp/file2": }
}
And correct your template to:
Jack
John
James
<% ...
3
puppet can use local information.. If you write a facter script that sets a fact.. you can reference that value from inside puppet.
Example
$ facter puppetversion
2.6.4
I can use $puppetversion in my template or pp file to get 2.6.4. Writing a facter script is pretty easy and you can use puppet to distribute the facter script to place it in the correct ...
3
Perhaps you should do this with a define?
class bootstrap {
define conf ( $israid= undef ) {
$loc = $name
file {
"$loc":
content => template(blah.erb);
}
}
}
then call it with
include bootstrap
bootstrap::conf {
"/loc":
israid => '-r yes \';
}
bootstrap::conf {
"/otherloc":
israid => '-r no \';
}
...
3
You could manually create your basic "template" and clone from it, but you should remember to remove "unique" data. For example:
configure the template for DHCP networking, you'll assign static IPs after the cloning
configure an hostname like "template01" and remember to change it after cloning
delete SSH host key files just before shutting down the ...
3
The easiest way is to get a tool like SharePoint Manager. Go into the site you are looking at, and find the WebTemplateId property. You can then match it up to a list of known template types.
There is another way to do it, but it is much more manual (and ugly) so I won't outline it here.
As far as a page template goes - this only works on pages within a ...
3
I do this now to add new nodes to my puppet master. For example, I grab the private IP of the puppet master instance in the UserData section of my new node:
"echo ", { "Fn::GetAtt" : [ "MasterOfPuppets", "PrivateIp" ] }, " ",
{ "Fn::GetAtt" : [ "MasterOfPuppets", "PrivateDnsName" ] } ," puppet
>> /etc/hosts\n","\n",
See page 119 of ...
3
The easiest way to do this is to look at the scope.tags variable, and check for a member with the name of the class you're interested in. By default, a resource is tagged with it's type (like 'class' or 'type'), as well as the name of the defining resource (like 'sensor', or 'snuffler'). In my quick test I did something like this:
class other {
file { ...
3
The "scope" variable refers to the Puppet::Parser::Scope class, which also seems to keep track of the source. You can refer to it with scope.source.name:
class classname::foo {
notice(inline_template("scope='<%= scope.source.name %>'"))
}
prints
notice: Scope(Class[Classname::Foo]): scope='classname::foo'
2
Ubuntu uses adduser from Debian, and that program just does a straight up file copy from /etc/skel, so you're out of luck there. However, it does support hook scripts (look in adduser(8) for adduser.local), and you could write a little hook script that did a sed -i over some or all of the files in the newly-created home directory to do your text ...
2
However I cannot see where to specify
that my instance requires 64-bit
architecture in the template file.
Assuming you are addressing the example template downloadable via Create a Load-Balanced Apache Website, the instance type and architecture mappings are wired via these two tables:
"Mappings" : {
"AWSInstanceType2Arch" : {
...
2
Actually, I figured this out.
I had followed up with an answer to this on the AWS Cloudformation forum but I forgot (sorry) that this thread was also active.
The issue is that the ELB template example is incomplete - so when I copied it, my example was also incomplete: you need to specify an instance type (t1.micro for example, or m1.large) explicitly, or ...
2
To get Name of the existing site template {Name of the Site Template} follow the below steps
Save a Site as a Template.
Go to Site settings –> sites & workspaces –> create.
IE Tools > Developer Tools > Find > Select Element By Click > View > Source > DOM (Element) > Highlight and copy the section
test . The one in bold will be your site template name.
...
2
In your case you can simple copy already installed web server virtual machine files or create base instalation configure it and then copy to another location. After copy you simple add copied machine to ESXi inventory start make all needed changes (host name ip etc) and that's all.
Here is simple tutorial how to clone wm in ESXi ...
2
You can convert VMs into a template or clone a VM. If you convert to a template you can not edit or power on the machine, the VM is marked as template and you can only deploy a new machine from the template.
Power off your machine, right-click it and select Template > Convert to Template, that's it. You can then right-click the template and Deploy ...
2
Do you really need to fiddle with prefix? If you need two (or more) apaches with different configurations, you can just point apache to different config files and server roots using command-line options:
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
1
Your code will be executed in the context of a node, so your Ruby code (Dir.foreach) will need to examine the node's local cache. In my Chef installation, the local cache path is required for my chef-client configuration template, so I have this attribute: node[:chef][:cache_path].
So:
...
1
On Salaudeen Rajack`s blog www.sharepointdiary.com there is a tutorial with explained 6 ways to determine a SharePoint Site Template. The link can be found here.
Cited:
Use SharePoint Manager, Navigate through the site, and look for "Web Template".
Stsadm:
stsadm.exe -o enumallwebs -databasename > Template.txt
Now, Open the template.txt file and check for ...
1
Variables aren't parsed inside single quotes. Use double quotes when you need to interpolate $variables.
http://docs.puppetlabs.com/guides/language_guide.html#variable-interpolation-with-quotes
Only top voted, non community-wiki answers of a minimum length are eligible