OpenVox

repository·main·Indexed 41 days ago

https://github.com/openvoxproject/openvox

A community-maintained implementation of Puppet providing automated administrative capabilities for Linux, Unix, and Windows systems via centralized specifications.

Tokens
136.7K
Snippets
469
Records
672
Agent score
49%

What's inside OpenVox

  1. Overview of OpenVox

    main
    OpenVox is a community implementation of Puppet, an automated administrative engine for Linux, Unix, and Windows systems. It is designed to perform administrative tasks—such as adding users, installing packages, and updating server configurations—based on a centralized specification.
  2. Overview of OpenVox command line tools

    main

    OpenVox's command line interface is provided via a single puppet binary that utilizes a subcommand architecture. The tools are categorized by their frequency of use and intended workflow:

    • Core Tools: Essential subcommands for daily operations (agent, apply, lookup, module, resource).
    • Secondary subcommands: Tools used for configuration, inspection, and specific tasks (config, describe, device, doc, epp, generate, help, node, parser, plugin, script, ssl).
    • Niche subcommands: Interfaces for internal subsystems or specialized workflows (catalog, facts, filebucket, report).

    Note on Certificate Management: If you are using Puppet version 6.0 or later, do not use puppet cert. Instead, use the puppetserver cert command.

  3. What is the OpenVox All-In-One (AIO) Agent?

    main

    The OpenVox All-In-One (AIO) agent (also known as openvox-agent) is a collection of software required for OpenVox and its dependencies to run. It bundles core components like openvox and openfact along with vendored dependencies such as Ruby, curl, and openssl.

    This repository provides the configuration to build the openvox-agent AIO package and the openfact gem for all Puppet-supported platforms using vanagon, a packaging utility.

  4. Configure Node Data Plugins (node_terminus)

    main

    The node_terminus setting determines which plugin is used to compile node catalogs. A node data plugin provides a list of classes, the environment, and top-scope variables for a node.

    Supported values:

    • plain: Returns no data; the main manifest controls all node configuration. (Default)
    • exec: Uses an External Node Classifier (ENC) configured via the external_nodes setting. This allows pulling classes from external systems via a script that returns YAML.
    • json: (Used in conjunction with node_cache_terminus).
  5. Decide which branch to patch (master vs stable)

    main

    Use the following logic to determine which base branch a change set belongs to:

    • master branch: Use this for new functionality that is not a bug fix. This is the branch for major and minor (feature) releases.
    • stable branch: Use this for bug fixes against the latest release or release candidate. This branch does not receive new functionality.
    • Patching Policy: Only the latest minor release of a major release should be patched.
      • If the change contains new functionality: Merge into master only.
      • If the change fixes a critical bug: Merge into both stable and master.
  6. Implement 'Decent Precedence' in grammar

    main

    Instead of relying solely on a precedence table, you can structure your grammar to mimic a recursive descent parser. This involves grouping expressions into hierarchical rules based on their precedence levels.

    Example pattern:

    expr
      : mulexp
      | expr PLUS mulexp
      | expr MINUS mulexp
    
    mulexp
      : primary
      | mulexp TIMES primary
      | mulexp DIV primary
    
    primary
      : NUMBER

    This approach makes the precedence explicit in the grammar structure itself.

  7. Manage packages with the `package` resource

    main

    The package resource type is used to manage software packages on a target system. OpenVox automatically detects the appropriate packaging format based on the platform, but you can manually specify a provider to override this behavior.

    Key Concepts

    • Providers: Different backends (e.g., yum, apt, gem, rpm) handle package management. Some providers can retrieve files themselves, while others require a source file.
    • Titles vs Names: You must use the title of the resource to create references (e.g., Package['my_title']). The name attribute is the actual internal name used by the packaging system, which may differ from the title.
    • Autorequires: If you use adminfile, responsefile, or source to manage files, the package resource will automatically create a dependency on those files.
    package { 'my_package_title':
      name    => 'actual_package_name',
      ensure => installed,
      provider => 'apt',
    }
  8. Understand the OpenVox testing hierarchy

    main

    OpenVox uses three distinct types of tests to ensure system stability:

    1. Unit Tests: Test individual components in isolation. They use canned information to hide system implementation and must never affect the running system's state. Located in the spec/ directory.
    2. Integration Tests: Test different units of code together to ensure subsystems interact correctly. Located in the spec/ directory.
    3. Acceptance Tests: Test high-level behaviors by changing system state and verifying the outcome. These can be destructive and should only be run on throwaway systems. Located in the acceptance/tests/ directory.
  9. Recursively manage directories with `recurse` and `purge`

    main

    When ensure => directory is set, you can manage the contents of the directory.

    recurse options

    • false (default): Contents are not managed.
    • remote: If source is set, OpenVox manages the contents of the source directory to match the target. This disables purge and is faster than true.
    • true: Manages contents from the source directory and enables the purge attribute.

    purge

    If purge => true is set, unmanaged files in the directory will be deleted.

    • If a filebucket is configured, purged files are uploaded to the bucket.
    • If no filebucket is configured, data is destroyed.
    • Purging will not delete directories unless force => true is set.

    recurselimit

    Limits how deep OpenVox descends into subdirectories.

    • 0: Same as recurse => false.
    • 1: Manages files/directories directly inside the target, but not their contents.
    • 2: Manages direct contents and the first level of subdirectories.
  10. How namevars and titles work in resource declarations

    main

    Every resource type has a namevar, which is the attribute used to uniquely identify that resource on the target system.

    If you do not explicitly provide a value for the namevar, it defaults to the resource's title.

    Example: Using Title as Default Namevar

    In the following example, the file type's namevar is path. Since path is not specified, it defaults to the title '/etc/passwd'.

    file { '/etc/passwd':
      owner => 'root',
      group => 'root',
      mode  => '0644',
    }

    Example: Explicitly Setting a Namevar

    You can provide a namevar explicitly to decouple the resource's identity from its title:

    file { 'passwords':
      path  => '/etc/passwd',
      owner => 'root',
      group => 'root',
      mode  => '0644',
    }

    In this case, the resource is still identified as File['/etc/passwd'] for relationship management.

  11. How the 'links' parameter affects metadata results

    main

    The links parameter changes how symbolic links are represented in the JSON response:

    When links=manage (Default)

    • The type is link.
    • The destination field contains the path the link points to.
    • The mode, owner, and group fields reflect the values of the link itself.

    When links=follow

    • The type is file (the type of the target).
    • The destination field is null.
    • The mode, owner, and group fields reflect the values of the target file.
    • The checksum reflects the target file.
    # Example of 'follow' behavior for a link
    {
        "destination": null,
        "group": 20,
        "links": "follow",
        "mode": 420,
        "owner": 501,
        "path": "/etc/puppetlabs/code/modules/example/files/link_to_file.txt",
        "relative_path": null,
        "type": "file"
    }