GithubHelp home page GithubHelp logo

voxpupuli / puppet-rclocal Goto Github PK

View Code? Open in Web Editor NEW
3.0 41.0 19.0 116 KB

Puppet module to manage rc.local

License: Apache License 2.0

Ruby 51.04% Puppet 35.78% Shell 4.88% Dockerfile 8.29%
hacktoberfest centos-puppet-module debian-puppet-module linux-puppet-module oraclelinux-puppet-module puppet redhat-puppet-module scientific-puppet-module sles-puppet-module ubuntu-puppet-module

puppet-rclocal's Introduction

Puppet rclocal module

Build Status

Table of Contents

  1. Module Description
  2. Setup
  3. Usage
  4. Parameters
  5. Development
  6. Author

Module description

This module manages rc.local entries in /etc/rc.local file directory.

Setup

This module uses Data Types from puppetlabs-stdlib!

Systemd based systems will need puppet/systemd.

Usage

To only manage the content of rc.local file:

class { 'rclocal':
  # config_file - OS specific, set via hiera data in module
  # config_dir  - OS specific, set via hiera data in module
  # template    - name a template to fill rc.local file, defaults to module template
  # scripts     - a hash of rc.local.d snippets to add
}

or include rclocal

Main usage is via a defined resource tye:

rclocal::script { 'name':
  ensure   => 'present',
  content  => "content for rc_local snippet\n",
  priority => '44',
  autoexec => true,
}

Or by defining hiera data for main class scripts parameter:

---
rclocal::scripts:
  'name':
    'ensure': 'present'
    'content': "content for rc_local snippet\n"
    'priority': '44'
    'autoexec': true

and then consume the data in your profile:

lookup('rclocal::scripts').each |$key, $params| {
  rclocal::script { $key:
    * => $params,
  }
}

Parameters

  • ensure: set to 'present' or 'absent'
  • content: the content you want to add
  • priority: manages the order where the content appears
  • autoexec: true or false - should puppet execute the code snippet from content - if set to false code will get executed on next reboot

Development

If you encounter problems, please open an issue, if you miss functionality, we are happy to review Pull Requests

Author

This module was maintained and created by example42 GmbH (c) 2012-2021 Module is transferred to Vox Pupuli on Nov 11th 2021.

puppet-rclocal's People

Contributors

alvagante avatar bastelfreak avatar blackikeeagle avatar buzzdeee avatar davids avatar martijndegouw avatar maxadamo avatar mburger avatar rainopik avatar smortex avatar treydock avatar tuxmea avatar zilchms avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-rclocal's Issues

Module does not run on puppet version 5.x

Expected Behavior

Successful run on puppet version 5.x

Actual Behavior

Errors like:
Resource type not found: RedHat at [..]modules/rclocal/manifests/params.pp:12:5
and
Error while evaluating a Function Call, hiera() can only be called using the 4.x function API

Steps to Reproduce the Problem

  1. run code on puppet version 5.x

Example?

Hey this looks like it's exactly what I need, but I don't know how to use it. What's an example?

I want to add the git-awareness to the users shell with this:

export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
PS1='[\u@\h \W]$(__git_ps1 " (%s)")$ '

Thanks!

SysVStartPriority= has been removed and it is ignored

Upstream systemd change seems to have broken the rc-local service running on CentOS Linux release 7.8.2003 (Core).

Expected Behavior

rc-local service start without error

Actual Behavior

Error: Systemd start for rc-local failed!
journalctl log for rc-local:
-- Logs begin at Fri 2020-08-28 10:55:18 CDT, end at Fri 2020-08-28 13:49:46 CDT. --
Aug 28 13:49:46 cbizfile2 systemd[1]: [/etc/systemd/system/rc-local.service:11] Support for option SysVStartPriority has been removed and it is ignored
Aug 28 13:49:46 file2 systemd[1]: Starting rc.local Compatibility...
Aug 28 13:49:46 file2 systemd[11961]: Failed at step STDOUT spawning /etc/rc.d/rc.local: Inappropriate ioctl for device
Aug 28 13:49:46 file2 systemd[1]: rc-local.service: control process exited, code=exited status=209
Aug 28 13:49:46 file2 systemd[1]: Failed to start rc.local Compatibility.
Aug 28 13:49:46 file2 systemd[1]: Unit rc-local.service entered failed state.
Aug 28 13:49:46 file2 systemd[1]: rc-local.service failed.

Error: /Stage[main]/Rclocal/Service[rc-local]/ensure: change from 'stopped' to 'running' failed: Systemd start for rc-local failed!
journalctl log for rc-local:
-- Logs begin at Fri 2020-08-28 10:55:18 CDT, end at Fri 2020-08-28 13:49:46 CDT. --
Aug 28 13:49:46 file2 systemd[1]: [/etc/systemd/system/rc-local.service:11] Support for option SysVStartPriority= has been removed and it is ignored
Aug 28 13:49:46 file2 systemd[1]: Starting rc.local Compatibility...
Aug 28 13:49:46 file2 systemd[11961]: Failed at step STDOUT spawning /etc/rc.d/rc.local: Inappropriate ioctl for device
Aug 28 13:49:46 file2 systemd[1]: rc-local.service: control process exited, code=exited status=209
Aug 28 13:49:46 file2 systemd[1]: Failed to start rc.local Compatibility.
Aug 28 13:49:46 file2 systemd[1]: Unit rc-local.service entered failed state.
Aug 28 13:49:46 file2 systemd[1]: rc-local.service failed.
(corrective)

Cannot guidelines on how to use this module?

Thanks for writing the module but i have problem on using this module works in my settings.

i have download and save the puppet-rclocal inside /etc/puppet/modules. Then in the one of my custom module i added

class custome::test {
  include rclocal
  rclocal::script { "my_script":
    priority => "10",
    content => "#just a comment",
  }
}

but when i try to apply the manifest, it throws the following error.
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class rclocal

Thanks for your help.

Kit

metadata.json permissions changed between v2.0.5 and v2.0.7

I'm upgrading the modules in our site's Puppetfile and was upgrading this module from v2.0.5 to v2.0.7. It caused the following error:
Error: /File[/var/opt/lib/pe-puppet/facts.d]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Permission denied - /etc/puppetlabs/puppet/environments/feature_PUP439_tecontrol/modules/rclocal/metadata.json
Error: /File[/var/opt/lib/pe-puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet://puppetsandbox.tycoelectronics.net/pluginfacts: Error 400 on SERVER: Permission denied - /etc/puppetlabs/puppet/environments/feature_PUP439_tecontrol/modules/rclocal/metadata.json

Comparing the file permissions of metadata.json for the two releases:
v2.0.5:
-r--r--r-- 1 root root 931 Oct 25 2013 metadata.json
v2.0.7:
-r-------- 1 root root 521 Aug 18 09:45 metadata.json

The change in metadata.json file permissions is causing this issue.

I would put in a PR to change this, but you haven't included metadata.json in this repo. You must be adding it when publishing the module to the Forge.

Thanks.

Incompatibility issue with Puppet v5

This PR should fix it..
#11

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Resource type not found: RedHat (file: /etc/puppetlabs/code/environments/production/modules/rclocal/manifests/params.pp, line: 12, column: 5) (file: /etc/puppetlabs/code/environments/production/manifests/xx.pp, line: 1062) on xyz

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.