GithubHelp home page GithubHelp logo

voxpupuli / puppet-boolean Goto Github PK

View Code? Open in Web Editor NEW
7.0 44.0 21.0 137 KB

An actual Boolean property for Puppet

Home Page: https://forge.puppet.com/puppet/boolean

License: Apache License 2.0

Ruby 92.44% Dockerfile 7.56%
linux-puppet-module puppet hacktoberfest centos-puppet-module debian-puppet-module redhat-puppet-module scientific-puppet-module ubuntu-puppet-module

puppet-boolean's Introduction

puppet-boolean

This module is archived! Do not use it anymore

The discussion happened in #34

Define actual boolean parameters and properties for puppet types.

Synopsis

Puppet has loosely defined internal types which can make normalizing boolean values in types and providers difficult. This custom parameter and property will handle that normalization in one place by defining actual boolean states.

Example

Type implementation:

require 'puppet/property/boolean'

Puppet::Type.newtype(:awesome) do

  newparam(:name, :namevar => true)

  newparam(:more_explosions, :parent => Puppet::Parameter::Boolean) do
    desc "Indicate that more explosions are necessary"
    defaultto true # When it doubt, we want more explosions
  end

  newproperty(:better_than_sliced_bread, :parent => Puppet::Property::Boolean) do
    desc "Determine if the thing is more awesome than sliced bread"
    defaultto true # It's not hard to be more awesome than sliced bread
  end

  newproperty(:better_than_rocket_boots, :parent => Puppet::Property::Boolean) do
    desc "Determine if the thing is more often than rocket boots"
    defaultto false # Rocket boots are pretty hard to beat
  end

  newproperty(:will_get_you_eaten_by_sharks, :parent => Puppet::Property::Boolean) do
    desc "Determine if this is so awesome that it'll get you eaten by sharks"
    defaultto :false # Use a symbol for the default value and it'll still be false
  end

  newproperty(:suitable_for_human_consumption, :parent => Puppet::Property::Boolean) do
    desc "Determine if the thing is both awesome and edible"
    defaultto :false # The are more non-edible things than edible things
  end
end

Type usage:

awesome { 'actual booleans':
  more_explosions                => 'yes',  # Use yes as a quoted string!
  better_than_rocket_boots       => true,   # Use an unquoted string!
  better_than_sliced_bread       => 'true', # Use a quoted string!
  suitable_for_human_consumption => no,     # Use yes and no! It doesn't matter!
}

Contact

puppet-boolean's People

Contributors

adrienthebo avatar alexjfisher avatar bastelfreak avatar bbriggs avatar binford2k avatar dhoppe avatar g1franc avatar ghoneycutt avatar igalic avatar juniorsysadmin avatar llowder avatar lukebigum avatar nanliu avatar ptierno avatar rnelson0 avatar sandra-thieme avatar tragiccode avatar trlinkin avatar vinzent avatar

Stargazers

 avatar  avatar  avatar  avatar  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  avatar

puppet-boolean's Issues

Migrate to vox pupuli?

Hi @adrienthebo,

Are you interested in migrating the module to Vox Pupuli? We already manage the awesome filemapper and network module, and we would like to spend some love to this one as well.

the property only loads when copied to puppet/property

I'm using https://github.com/stbenjam/puppet-authconfig which requires puppet-boolean. I've loaded puppet-boolean on the puppetmaster under the modepath folder.

On the client I get this error when I run puppet agent --test.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/authconfig: no such file to load -- puppet/property/boolean on node server2.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I end up coping the boolean.rb to /usr/lib/ruby/site_ruby/1.8/puppet/property/, now when I run puppet agent --test, it works as expected.

My puppet agent and puppetmaster are both version 3.1.0.

You can ping swygue on irc if you want to chat.

Release to forge

There hasn't yet been a voxpupuli release of this module to the forge.
But... there has been a recent release of puppet/network with puppet/boolean set as a dependency.

check fedora support

this module once had fedora in the metadata.json. We removed it because all versions were EOL. We need to check if recent versions work and add it back.

release with "v"

The metadata.json is set to "1.1.0"

but the release in GitHub is made as "v1.1.0"

maybe only optical, but seems confusing...

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.