Giter VIP home page Giter VIP logo

mcollective-plugins's Introduction

mcollective agents and applications for things I need

I just started learning/using mcollective, so please vet all code you use from here yourself. If you find anything remiss please open an issue.

These are only tested against 1.3.2, so if you are using 1.2.1 (the latest stable release, YMMV)

First, about the Yum agent:

I made liberal use of the code contained in the main mcollective repo:

https://github.com/puppetlabs/mcollective-plugins/tree/master/agent/package/agent

However, I wanted it to be yum-centric for my environment.

Usage Yum agent:

Install a package on all hosts:

 sudo mco rpc yum install xclock

Upgrade a package on all hosts:

 sudo mco rpc yum upgrade xclock

Reinstall a package on all hosts:

 sudo mco rpc yum reinstall xclock

Check for available updates:

 sudo mco rpc yum check-update

Patch all hosts to the latest patch level (either by repo, rhn or satellite sync):

 sudo mco rpc yum update # note this is the same thing as concurrently running `yum update -y` on ALL hosts 

Stage all available patches on servers (that have the downloadonly plugin)

 sudo mco rpc yum downloadonly

Stage a specfic package on servers (that have the downloadonly plugin)

 sudo mco rpc yum downloadonly package=xclock

Clean various caches // Note: I borrowed this code from the main mcollective plugins repo:

 sudo mco rpc yum clean # This defaults to all if package.yum_clean_mode set
 sudo mco rpc yum clean mode=all
 sudo mco rpc yum clean mode=headers
 sudo mco rpc yum clean mode=packages
 sudo mco rpc yum clean mode=metadata
 sudo mco rpc yum clean mode=dbcache
 sudo mco rpc yum clean mode=plugins
 sudo mco rpc yum clean mode=expire-cache

Usage Shellout agent:

The Shellout agent allows concurrent remote execution of arbitrary shell commands. I hope that sounds as scary as I mean it to sound. You need to make sure you give due diligence to security on the clients that have access to this agent.

Example usage 1 (outputs STDOUT):

 sudo mco rpc shellout cmd cmd='for i in $(seq 1 10);do echo $i;done'

Example usage 2 (outputs STDERR):

 sudo mco rpc shellout cmd cmd='ls -l /home/jbeiber/awesome-songs.txt'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.