2.2 Puppet Policy

The Puppet policy lets you apply the Linux configuration on the Linux devices. This section includes information about:

2.2.1 Installing the puppet-agent Package on the Managed Devices

For the Puppet policy to be effective on ZENworks 2020 Update 2 and later, Linux managed devices, you need to ensure that the puppet-agent package is installed on the devices.

The Puppet policy was tested with puppet-agent package version 6.10. It should work with higher versions of the puppet-agent package. In case it does not, please contact Micro Focus Customer Center.

NOTE:The Puppet policy will continue to work, as before, on the older managed devices (ZENworks 2020 Update 1 and earlier).

To install the puppet-agent package on the ZENworks 2020 Update 2 and later, Linux managed devices:

  • Download and install the puppet-agent package directly on the Linux managed devices: Based on the operating system, download and install the relevant version of the puppet-agent package on the Linux managed devices, from the http://yum.puppet.com/ location. For information on installing the package on the device, refer to the Puppet documentation.

    OR

  • Download the puppet-agent package and install it on the Linux devices by using the Bundles feature: Based on the operating system, download the relevant version of the puppet-agent package to the ZENworks server, from the http://yum.puppet.com/ location. After downloading the package, use the Bundles feature to install the package on the Linux managed devices. For information on installing the package using a bundle, refer to the Creating Linux Bundles section in the ZENworks Software Distribution Reference.

2.2.2 Creating the Puppet Policy

  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/microfocus/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 with Arguments field displays the puppet command that will be run on the managed device. The following command is displayed by default. However, this command can be edited:

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

      Details about the parameters used in this command are listed in the following table. For more parameter options, refer to the Puppet documentation.

      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/microfocus/log/zenworks/puppet.log.

      --confdir

      Is the Puppet Configuration Directory.

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

      Example 1:

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

      -dv --detailed-exit codes  --confdir /etc/opt/microfocus/zenworks/puppet  -l  /tmp/puppet.log

      Example 2:

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

      --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.