Difference between revisions of "How to install Cumin"

From ppwiki
Jump to navigation Jump to search
Line 24: Line 24:
  
 
=Installation=
 
=Installation=
 +
One of the required package for Cumin 3.0.2 is python3-clustershell. Debian Stretch doesn't have that package so you will to download it and install it.
 +
ppaul@cumin1001:~$ sudo apt-get install python3-clustershell
 +
Reading package lists... Done
 +
Building dependency tree     
 +
Reading state information... Done
 +
E: Unable to locate package python3-clustershell
 +
 
==cumin Class==
 
==cumin Class==
 
On your puppetmaster create the cumin class
 
On your puppetmaster create the cumin class

Revision as of 18:46, 5 October 2019

Cumin is open Source program written in Python that allows you to execute multiple commands on multiple hosts in parallel. For more information on Cumin please see the references section.

Prerequisites

For this tutorial, you need:

- pupetmaster node

- puppetdb node

- cumin node

- some nodes for testing

Environment

Nodes names

All nodes in this tutorial are running Debian Stretch with Puppet 6

- Puppetmaster1002 : Puppet master node

- Puppetdb1002 : PuppetDb node

- cumin1001 : Running cumin

- lab1001: Test node

Installation

One of the required package for Cumin 3.0.2 is python3-clustershell. Debian Stretch doesn't have that package so you will to download it and install it.

ppaul@cumin1001:~$ sudo apt-get install python3-clustershell
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-clustershell

cumin Class

On your puppetmaster create the cumin class

cd /etc/puppetlabs/code/environments/production/modules
sudo mkdir cumin
cd cumin
sudo mkdir manifests
sudo mkdir templates
cd manifests

Create the master.pp file, copy and paste the content below

class profile::cumin::master (
   $puppetdb_host  = hiera('puppetdb_host'),
) {
   $cumin_log_path = '/var/log/cumin'
   # Ensure to add FQDN of the current host also the first time the role is applied
    $cumin_masters = unique(concat(query_nodes('Class[Role::Cumin::Master]'), [$::fqdn]))
  require_package([
       'python3-dnspython',
       'python3-colorama',
       'python3-pyparsing',
       'python3-tqdm',
       'python3-requests',
       'python3-yaml',
   ])
   package { 'cumin':
     ensure     => installed,
     provider   => dpkg,
     source     => '/srv/cumin_3.0.2-1_amd64.deb',
  }
   file { $cumin_log_path:
       ensure => directory,
       owner  => 'root',
       group  => 'root',
       mode   => '0750',
   } 
file { '/etc/cumin':
       ensure => directory,
       owner  => 'root',
       group  => 'root',
       mode   => '0755',
   }
  file { '/etc/cumin/config.yaml':
       ensure  => present,
       owner   => 'root',
       group   => 'root',
       mode    => '0640',
       content => template('profile/cumin/config.yaml.erb'),
       require => File['/etc/cumin'],
   }
   file { '/etc/cumin/config-installer.yaml':
       ensure  => present,
       owner   => 'root',
       group   => 'root',
       mode    => '0640',
       content => template('profile/cumin/config-installer.yaml.erb'),
       require => File['/etc/cumin'],
   }
   file { '/etc/cumin/aliases.yaml':
       ensure  => present,
       owner   => 'root',
       group   => 'root',
       mode    => '0644',
       content => template('profile/cumin/aliases.yaml.erb'),
       require => File['/etc/cumin'],
   }
if os_version('debian == stretch') {
       $python_version = '3.5'
   } else {
       $python_version = '3.6'
   }
}

master.pp content

Configuration

Testing

References