Showing with 1,617 additions and 598 deletions.
  1. +8 −0 .fixtures.yml
  2. +6 −0 .gitignore
  3. +2 −0 .rspec
  4. +13 −0 .travis.yml
  5. +33 −0 CHANGELOG.md
  6. +31 −0 Gemfile
  7. +6 −0 Gemfile.old
  8. +136 −0 HTTPS.md
  9. +135 −35 README.md
  10. +1 −0 Rakefile
  11. +7 −7 docs/PE_groups.md
  12. +3 −0 lib/puppet/feature/puppetclassify.rb
  13. +29 −0 lib/puppet/parser/functions/node_groups.rb
  14. +0 −92 lib/puppet/provider/helpers.rb
  15. +0 −32 lib/puppet/provider/nc_api.rb
  16. +187 −0 lib/puppet/provider/node_group/https.rb
  17. +62 −35 lib/puppet/provider/node_group/puppetclassify.rb
  18. +0 −59 lib/puppet/provider/puppet_environment/puppet_environment.rb
  19. +83 −0 lib/puppet/provider/puppet_environment/puppetclassify.rb
  20. +0 −32 lib/puppet/provider/rbac_api.rb
  21. +0 −87 lib/puppet/provider/rbac_group/rbac_group.rb
  22. +0 −106 lib/puppet/provider/rbac_user/rbac_user.rb
  23. +5 −12 lib/puppet/type/node_group.rb
  24. +1 −1 lib/puppet/type/puppet_environment.rb
  25. +0 −35 lib/puppet/type/rbac_group.rb
  26. +0 −65 lib/puppet/type/rbac_user.rb
  27. +109 −0 lib/puppet/util/nc_https.rb
  28. +59 −0 lib/puppet/util/node_groups.rb
  29. +4 −0 manifests/init.pp
  30. +15 −0 manifests/params.pp
  31. +13 −0 manifests/puppetclassify/install.pp
  32. +43 −0 metadata.json
  33. +29 −0 spec/classes/node_manager_spec.rb
  34. +29 −0 spec/classes/params_spec.rb
  35. +68 −0 spec/classes/puppetclassify/install_spec.rb
  36. +97 −0 spec/functions/node_groups_spec.rb
  37. +105 −0 spec/integration/puppet/provider/node_group/https_spec.rb
  38. +106 −0 spec/integration/puppet/provider/node_group/puppetclassify_spec.rb
  39. +60 −0 spec/integration/puppet/provider/puppet_environment/puppet_environment_spec.rb
  40. +10 −0 spec/spec_helper.rb
  41. +76 −0 spec/unit/puppet/type/node_group_spec.rb
  42. +46 −0 spec/unit/puppet/type/puppet_environment_spec.rb
8 changes: 8 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixtures:
repositories:
pe_gem:
repo: https://github.com/puppetlabs/puppetlabs-pe_gem
ref: 0.1.2
symlinks:
node_manager: "#{source_dir}"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
.*.swp
Gemfile.lock
spec/fixtures/
pkg/*
*.travis*
*.old
checksums.json
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--format documentation
--color
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: ruby
env:
- PUPPET_VERSION=4.2.0
- PUPPET_VERSION=4.1.0
- PUPPET_VERSION=4.0.0
- PUPPET_VERSION=3.8.1
- PUPPET_VERSION=3.7.0
rvm:
- 2.2.0
- 2.1.0
- 2.0.0
script:
- "bundle exec rake spec"
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## 2017-03-31 - Release 0.4.1

### Summary

- Added `description` attribute to groups

#### Bugfixes

- Added logic for cancelling unwanted classes/variables
- Able to now submit empty class/variables values

## 2017-03-30 - Release 0.4.0

### Summary

- Added `https` provider which doesn't need `puppeclassify` gem
- Added deprecation notice for `puppetclassify` provider

## 2016-10-26 - Release 0.3.0
### Summary

Needed to pin some gems because Ruby 2.1.x is approaching end of life.

#### Bugfixes
- Hardened ruby load issues on agents

## 2015-11-15 - Release 0.2.1
### Summary

Add some bugfixes.

#### Bugfixes
- Added empty dependencies to metadata.json to fix `puppet module list` error.
31 changes: 31 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
source "https://rubygems.org"

group :test do
gem "rake"
# gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.3'
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
# gem "puppetlabs_spec_helper"
gem 'rspec-puppet-utils', :git => 'https://github.com/Accuity/rspec-puppet-utils.git'
gem 'hiera-puppet-helper', :git => 'https://github.com/bobtfish/hiera-puppet-helper.git'
# there seems to be a bug with puppet-blacksmith and metadata-json-lint
# removing metadata for now
gem "metadata-json-lint"
gem 'puppet-syntax'
gem 'puppet-lint'
gem 'listen', '<= 3.0.8'
gem 'net-http-persistent', '~> 2.9.4'
end

group :development do
gem "travis"
gem "travis-lint"
gem "puppet-blacksmith"
gem "guard-rake"
end

source 'https://rubygems.org'

gem 'puppet', nil || ENV['PUPPET_VERSION']
gem 'puppetlabs_spec_helper', '0.10.3'
gem 'webmock', '1.22.1'
gem 'puppetclassify', '0.1.2'
6 changes: 6 additions & 0 deletions Gemfile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem 'puppet', nil || ENV['PUPPET_VERSION']
gem 'puppetlabs_spec_helper', '0.10.3'
gem 'webmock', '1.22.1'
gem 'puppetclassify', '0.1.0'
136 changes: 136 additions & 0 deletions HTTPS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# node_manager [![Build Status](https://travis-ci.org/WhatsARanjit/prosvcs-node_manager.svg)](https://travis-ci.org/WhatsARanjit/prosvcs-node_manager)

#### Table of Contents
1. [Overview](#overview)
1. [Requirements](#requirements)
1. [node_group type](#node_group)
1. [node_groups() function](#node_groups)

## Overview

Create and manage PE Console node groups as resources.
The `https` provider is meant to erase the dependecy on
the `puppetclassify` gem This helps will runtime issues
when managing node_groups and installing the gem in the
same agent run. To try it out:

```
node_group { 'Test new provider':
ensure => present,
provider => 'https',
}
```

No changes need to be made. When the `puppetclassify`
provider is dropped, the `https` provider will take over
as a seamless swap-in.

## Requirements:

- *nix operating system
- Puppet Enterprise >= 3.7.1

## Types

### Node_group

Node_groups will autorequire parent node_groups.

Enumerate all node groups:
* `puppet resource node_group`<br />

Example output for `puppet resource node_group 'PE MCollective'`
```
node_group { 'PE MCollective':
ensure => 'present',
classes => {'puppet_enterprise::profile::mcollective::agent' => {}},
environment => 'production',
id => '4cdec347-20c6-46d7-9658-7189c1537ae9',
override_environment => 'false',
parent => 'PE Infrastructure',
rule => ['and', ['~', ['fact', 'pe_version'], '.+']],
}
```

#### Node_group parameters

* `classes`<br />
Classes that are assigned to the node in hash format. Elements of the hash
are class parameters. Default (empty hash): `{}`

* `environment`<br />
Environment selected for this node group. Default: `production`

* `name`<br />
(namevar) Node group's name.

* `id`<br />
Universal ID for the group. This attribute is read-only.

* `override_environment`<br />
Whether or not this group's environment ment setting overrides
all other other environments. Default: `false`

* `parent`<br />
The UID for the data group. Can be specified by group name or
UID. Default: `All Nodes`

* `rules`<br />
An array of classification rules. Default (empty array): `[]`

## Functions

### node_groups()

Retrieve all or one node_group and its data.

`node_groups()` will return:

```
{
"All Nodes"=>{
"environment_trumps"=>false,
"parent"=>"00000000-0000-4000-8000-000000000000",
"name"=>"All Nodes",
"rule"=>["and", ["~", "name", ".*"]],
"variables"=>{}, "id"=>"00000000-0000-4000-8000-000000000000",
"environment"=>"production",
"classes"=>{}
},
"Production environment"=>{
"environment_trumps"=>false,
"parent"=>"00000000-0000-4000-8000-000000000000",
"name"=>"Production environment",
"rule"=>["and", ["~", "name", ".*"]],
"variables"=>{},
"id"=>"7233f964-951e-4a7f-88ea-72676ed3104d",
"environment"=>"production",
"classes"=>{}
},
...
}
```

`node_groups('All Nodes')` will return:

```
{
"All Nodes"=>{
"environment_trumps"=>false,
"parent"=>"00000000-0000-4000-8000-000000000000",
"name"=>"All Nodes",
"rule"=>["and", ["~", "name", ".*"]],
"variables"=>{}, "id"=>"00000000-0000-4000-8000-000000000000",
"environment"=>"production",
"classes"=>{}
}
}
```

_Type:_ rvalue

## Maintainers
This repositority is largely the work of some Puppet community members.
It is not officially maintained by Puppet, or any individual in
particular. Issues should be opened in Github. Questions should be directed
at the individuals responsible for committing that particular code.
Loading