Ask Your Question

what is the exact location of sysidcfg.erb template file for creating solaris zones with puppet

asked 2015-04-08 14:03:48 -0600

crpeck gravatar image

I'm attempting to defines zones in Puppet under Solaris 11.2, according to the docs that I can find i can create a template for the sysidcfg file and reference it. However, I cannot figure out where the template file goes, does it do in the Puppet master or the client, I've tried both. Can you give me a full path and which system to place this file on? Thanks From puppet describe zone:

- **sysidcfg**
The text to go into the `sysidcfg` file when the zone is first
booted.  The best way is to use a template:
# $confdir/modules/site/templates/sysidcfg.erb
    root_password=<%= password %>
    name_service=DNS {domain_name=<%= domain %> name_server=<%=
nameserver %>}
    network_interface=primary {hostname=<%= realhostname %>
      ip_address=<%= ip %>
      netmask=<%= netmask %>
      default_route=<%= defaultroute %>}

And then call that:
zone { myzone:
      ip           => "bge0:",
      sysidcfg     => template("site/sysidcfg.erb"),
      path         => "/opt/zones/myzone",
      realhostname => ""

The `sysidcfg` only matters on the first booting of the zone,
so Puppet only checks for it at that time.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-04-08 21:25:46 -0600

GregLarkin gravatar image

updated 2015-04-08 21:26:43 -0600

The template file (.erb) goes into the templates/ subdirectory of a module that you create. You can read about how the module directories are structured here:

Puppet code always lives on the Puppet master, not on any Puppet agent node.

In order to use the zone resource in a module named zonemanager, it might look like this:

# This class lives in <moduledir>/zonemanager/manifests/init.pp
class zonemanager {
  zone { 'zone 1':
    ensure => running,
    autoboot => true,
    ... other attributes ...
    # The template file lives in <moduledir>/zonemanager/templates/sysidcfg.erb
    sysidcfg => template('zonemanager/sysidcfg.erb'),

As the zone resource documentation shows, the sysidcfg.erb file can contain several variables that will be evaluated as the file is configured and used to boot the zone.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-04-08 14:03:48 -0600

Seen: 358 times

Last updated: Apr 08 '15