Forge Home

runyer

Automagically create mco/Live Management tasks for *nix or Windows machines.

10,565 downloads

9,682 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.2 (latest)
  • 1.0.1
  • 1.0.0
released Feb 7th 2015
This version is compatible with:
  • Puppet Enterprise >= 3.2.0
  • , , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'jpadams-runyer', '1.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jpadams-runyer
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jpadams-runyer --version 1.0.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

jpadams/runyer — version 1.0.2 Feb 7th 2015

runyer

For PE 3.2.x and above

Automagically create mco/Live Management tasks for *nix or Windows machines.

Make modules (for example see my 'acts' module's linux.pp and win.pp below) with your desired actions. Classify master and agents. A Windows node will skip a *nix action and vice versa.

No spaces allowed in $actionname param (defaults to resource $title) to keep filename and mco/LM sane. Best to use [a-z] and '' (underscore). For now anyway.

# a simple class with two actions. apply to master and linux agents.
class notwords {
  include runyer

  runyer::nix_command { 'ls':
    command => 'ls -al',
  }

  runyer::nix_command { 'du':
    command => 'du -k',
  }
}

A more complicated example (repo https://github.com/jpadams/acts):

# init.pp for defaults
class acts {
  # use runyer's defaults
  #include runyer

  # or set your param defaults here
  class { 'runyer':
    author_name  => 'Jeremy Adams',
    author_email => 'jeremy@puppetlabs.com',
    license      => 'Apache v2',
    version      => '1.0',
    project_url  => 'http://www.puppetlabs.com',
    timeout      => 25,
  }
}
# master.pp for the master
class acts::master {
  include acts::linux
  include acts::win
}
# linux.pp for the linux nodes
class acts::linux {
  include acts

  runyer::nix_command { 'ls':
    command => 'ls -al',
  }

  runyer::nix_command { 'du':
    command => 'du -k',
  }

  runyer::nix_command { 'slow':
    command     => '/usr/bin/factor 9892342110982745983029479822398472392821222222223333333333333333333333',
    author_name => 'Leonhard Euler',
    # these two params will come from the defaults set in init.pp of acts
    # author_email => 'jeremy@puppetlabs.com',
    # license      => 'Apache-2.0',
    version     => '0.0.1',
    project_url => 'http://www.projecteuler.net',
    timeout     => 200,
  }
}
# win.pp for the windows nodes
class acts::win {
  include acts

  runyer::windows_command { 'stuff':
    command => 'mkdir c:\foobar',
  }

  runyer::windows_command { 'stuff and nonsense':
    command     => 'mkdir c:\jaberwocky',
    action_name => 's_and_n',
  }

  runyer::windows_command { 'gone':
    ensure  => 'absent',
    command => 'mkdir c:\you_later',
  }
}

After you run puppet agent, your nodes (including the master, if you listened to me above) will have the necessary ddl and rb files. Just browse to the Live Management tab and go! Alternatively, use the mco command line.

# su - peadmin

$ mco rpc stuff run -I mywindowsnode