GithubHelp home page GithubHelp logo

kividiot / puppet-module-cron Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ericsson/puppet-module-cron

0.0 2.0 0.0 104 KB

Puppet module to manage cron

License: Apache License 2.0

Ruby 70.49% Puppet 22.27% HTML 7.18% Pascal 0.06%

puppet-module-cron's Introduction

puppet-module-cron

Manage the cron configuration files :

  • /etc/crontab
  • /etc/cron.allow
  • /etc/cron.deny
  • /etc/cron.d/
  • /etc/cron.daily
  • /etc/cron.weekly
  • /etc/cron.monthly
  • /etc/cron.yearly

===

Compatibility

This module has been tested to work on the following systems with Puppet v3 and Ruby versions 1.8.7, 1.9.3 and 2.0.0.

  • EL 5
  • EL 6
  • SLES 10
  • SLES 11
  • Ubuntu 12
  • Debian 7

===

Parameters

A value of 'undef' will use the defaults specified by the module.

enable_cron

Boolean to enable the service cron. Valid values are true, false

  • Default: true

package_ensure

What state the package should be in. Valid values are 'present', 'absent', 'purged', 'held' and 'latest'.

  • Default: 'present'

ensure_state

What state the cron service should be in. Valid values are 'running' and 'stopped'.

  • Default: 'running'

crontab_path

crontab's path.

  • Default: '/etc/crontab'

cron_allow

If the file cron.allow exists, only users listed in it are allowed to use cron, and the cron.deny file is ignored. Valid values are 'present' and 'absent'.

  • Default: 'absent'

cron_deny

If cron.allow does not exist, users listed in cron.deny are not allowed to use cron. Valid values are 'present' and 'absent'.

  • Default: 'absent'

cron_allow_path

Path of cron.allow.

  • Default: '/etc/cron.allow'

cron_deny_path

Path of cron.deny.

  • Default: '/etc/cron.deny'

crontab_vars

Defines the crontab variables SHELL, PATH, MAILTO, HOME. if this variable is undef the module will use the values defined in crontab template which are SHELL=/bin/bash, PATH=/sbin:/bin:/usr/sbin:/usr/bin, MAILTO=root, HOME=/, valid value is hash.

  • Default: undef

crontab_tasks

Define crontab tasks. valid value is hash.

  • Default: undef

Sample usage:

Define crontab variables

cron::crontab_vars:
  SHELL: /bin/bash
  PATH: /sbin:/bin:/usr/sbin:/usr/bin
  MAILTO: root
  HOME: /root

Create /etc/cron.daily/daily_task

cron::cron_files:
     'daily_task':
       ensure_cron: 'present'
       type: "daily"
       cron_content: |-
            #!/bin/bash
            # This File is managed by puppet
            script
            .
            EOF

Manage /etc/cron.allow

cron::cron_allow: 'true'
cron::cron_allow_users:
     - user1

Manage /etc/cron.deny

cron::cron_deny: 'present'
cron::cron_deny_users:
     - user1

Manage /etc/crontab

cron::crontab_tasks:
   'task1':
    - "* 12 * * 7 username echo 'Hello World'"
    - "2 2 * * 6 username echo 'tes'"
   'task2':
    - "* 6 * * 7 root echo 'test'"

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.