2.2 Puppet Policy

The Puppet policy lets you apply the Linux configuration on the Linux devices.

  1. In ZENworks Control Center, click the Policies tab.

  2. In the Policies list, click New, then click Policy.

    or

    In the Policy Tasks, click New Policy.

    The Select Platform page is displayed.

  3. Select Linux, then click Next.

    The Select Policy Category page is displayed.

  4. Select Linux Configuration Policies, then click Next.

  5. Select Puppet Policy as the Policy Type, then click Next.

  6. In the Define Details page fill in the following fields:

    Policy Name: Provide a name for the policy. The policy name must be different from the name of any other item (group, folder, and so forth) that resides in the same folder. The name you provide displays in ZENworks Control Center.

    Folder: Type the name or browse for and select the ZENworks Control Center folder where you want the policy to reside. The default is /Policies, but you can create additional folders to organize your policies.

    Administrator Notes: Provide a short description of the policy’s content. This description displays in ZENworks Control Center.

  7. Click Next to display the Puppet Policy page. You can create a puppet policy to run scripts as either Manifest or Module.

    The following options lets you run puppet scripts on a managed device, upload the script file, and specify if a dry run on the script should be performed.

    • Run Script As: You can create a policy to run script as either Manifest or Module.

    • FileName: Depending on your selection to run the script as Manifest or Module, browse for and upload the script file in the following formats:

      Manifest: Upload a .pp file.

      Module: Upload a .zip, .tar, .tar.gz, .tar.bz2, .tgz, or .tbz2 file.

      NOTE:After creating either Manifest or Module on a Windows operating system, run the dos2unix command on the puppet script file, to avoid parsing errors on the managed device.

    • Dry Run: Select this option to have ZENworks Configuration Management perform a test to determine if the Puppet policy can be successfully enforced on a managed device.

      If there are any issues that could prevent the policy from being enforced, you can view the issues in the log file created to troubleshoot the policy creation process. The log file is located at /var/opt/novell/log/zenworks/puppet.log. A successful dry run ensures that the policy can be successfully enforced on the managed device.

    • Advanced Options: Select this option to specify the Puppet Command Options.

      The Run Puppet Command As field displays the puppet command that will be run on the managed device. The command consists of the following two parts:

      Part 1:

      Includes the non-editable part of the command as follow:

      /opt/novell/zenworks/bin/puppet script_name --noop

      /opt/novell/zenworks/bin/puppet is the portion of the command that is displayed by default. Based on your choice to run the script as a manifest or a module, the script_name parameter is replaced by the name of the manifest file or the module name. If the Dry Run option is enabled, then --noop string gets appended to the command.

      Part 2:

      Includes the editable part of the command. The following portion of the command is displayed by default:

      -dv --detailed-exitcodes --confdir /etc/opt/novell/zenworks/puppet -l /var/opt/novell/log/zenworks/puppet.log

      For information on the parameters used in the command, see the following table:

      Parameter

      Description

      d

      Enables full debugging.

      v

      Prints extra information.

      detailed-exitcodes

      Provides transaction information through exit codes.

      l

      Creates a log file.

      log_file_path

      Path of the log file, the default path is

      /var/opt/novell/log/zenworks/puppet.log.

      --confdir

      Is the Puppet Configuration Directory.

      You can choose to edit this portion of the command as in the following examples.

      Example 1:

      The default log path is /var/opt/novell/log/zenworks/puppet.log. However, you can choose to specify a different log file such as a /tmp/puppet.log using the following command.

      /opt/novell/zenworks/bin/puppet script_name --noop -dv --detailed-exit codes  --confdir /etc/opt/novell/zenworks/puppet  -l  /tmp/puppet.log

      Example 2:

      The default puppet configuration file is /etc/opt/novell/zenworks/puppet/puppet.conf. However, you can choose to specify a different configuration file as follows:

      /opt/novell/zenworks/bin/puppet script_name --noop --config=/tmp/mypuppet.conf -l /tmp/puppet.log

      The availability of the supported parameters is dependent on the version of the puppet installed on the managed device.

  8. Review the information on the Summary page and, if necessary, use the Back button to make changes to the information on the Summary page. In the Summary page the Module file content displays the list of files that are packaged as either Module or Manifest.

  9. (Conditional) Select Create as Sandbox, if you want to create the sandbox version of the policy.

  10. Select the check box for Define Additional Properties.

  11. Click Finish to create the new Puppet policy.

  12. Click Relationships and assign the newly created Puppet policy to a test device and a non-test device.