On Thu, Aug 2, 2012 at 11:02 AM, Kyle Sexton <ks@mocker.org>
wrote:> Is razor only really useful for configuring mass numbers of hosts?
I''ve
> been playing with it and one thing I''m not grasping is how to set
a hostname
> if I''m only building one host, say wiki01.foo.com. For each
server like
> that would I need a separate policy, or is there some other way people are
> using to pre-populate specific host information to be passed to servers?
Yes, you need separate model per system. We have a pending pull
request to make this as simple as a puppet manifests that you can
apply:
rz_image { ''precise_image'':
ensure => present,
type => ''os'',
version => ''12.04'',
source => ''/mnt/nfs/ubuntu-12.04-server-amd64.iso'',
}
rz_model { ''wiki_model'':
ensure => present,
image => ''precise_image'',
metadata => {''domainname'' =>
''foo.com'', ''hostname_prefix'' =>
''wiki'', ''root_password'' =>
''puppet''},
template => ''ubuntu_precise'',
}
rz_policy { ''wiki'':
ensure => ''present'',
broker => ''none'',
model => ''wiki_model'',
enabled => ''true'',
tags => [''virtual''],
template => ''linux_deploy'',
maximum => 1,
}
So you can definitely write a define resource type to wrap the puppet
resource above to create one off systems:
define system (
$rz_tags
) {
# parse hostname/domainname.
rz_model { $name:
ensure => present,
image => ''precise_image'',
metadata => {''domainname'' => $rz_domain,
''hostname_prefix'' =>
$rz_hostname, ''root_password'' =>
''puppet''},
template => ''ubuntu_precise'',
}
rz_policy { $name:
ensure => ''present'',
broker => ''none'',
model => $name,
enabled => ''true'',
tags => $rz_tags,
template => ''linux_deploy'',
maximum => 1,
}
}
Now it should simply be:
system { ''wiki01.foo.com'':
rz_tags => [''virtual''],
}
Would this help?
Nan
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.