Skip to content

Commit 7288555

Browse files
committed
Initial commit
0 parents  commit 7288555

26 files changed

+973
-0
lines changed

.gitignore

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
*.gem
2+
*.rbc
3+
/.config
4+
/coverage/
5+
/InstalledFiles
6+
/pkg/
7+
/spec/reports/
8+
/spec/examples.txt
9+
/test/tmp/
10+
/test/version_tmp/
11+
/tmp/
12+
13+
# Used by dotenv library to load environment variables.
14+
# .env
15+
16+
## Specific to RubyMotion:
17+
.dat*
18+
.repl_history
19+
build/
20+
*.bridgesupport
21+
build-iPhoneOS/
22+
build-iPhoneSimulator/
23+
24+
## Specific to RubyMotion (use of CocoaPods):
25+
#
26+
# We recommend against adding the Pods directory to your .gitignore. However
27+
# you should judge for yourself, the pros and cons are mentioned at:
28+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29+
#
30+
# vendor/Pods/
31+
32+
## Documentation cache and generated files:
33+
/.yardoc/
34+
/_yardoc/
35+
/doc/
36+
/rdoc/
37+
38+
## Environment normalization:
39+
/.bundle/
40+
/vendor/bundle
41+
/lib/bundler/man/
42+
43+
# for a library or gem, you might want to ignore these files since the code is
44+
# intended to run in multiple environments; otherwise, check them in:
45+
# Gemfile.lock
46+
# .ruby-version
47+
# .ruby-gemset
48+
49+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50+
.rvmrc
51+
# ide related
52+
.idea

Gemfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2+
3+
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3']
4+
gem 'metadata-json-lint'
5+
gem 'puppet', puppetversion
6+
gem 'puppetlabs_spec_helper', '>= 1.0.0'
7+
gem 'puppet-lint', '>= 1.0.0'
8+
gem 'facter', '>= 1.7.0'
9+
gem 'rspec-puppet'
10+
11+
# rspec must be v2 for ruby 1.8.7
12+
if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
13+
gem 'rspec', '~> 2.0'
14+
gem 'rake', '~> 10.0'
15+
else
16+
# rubocop requires ruby >= 1.9
17+
gem 'rubocop'
18+
end

Gemfile.lock

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.3.0)
5+
diff-lcs (1.3)
6+
facter (2.4.6-x64-mingw32)
7+
ffi (~> 1.9.5)
8+
win32-dir (~> 0.4.8)
9+
win32-security (~> 0.2.5)
10+
fast_gettext (1.1.0)
11+
ffi (1.9.18-x64-mingw32)
12+
gettext (3.2.2)
13+
locale (>= 2.0.5)
14+
text (>= 1.3.0)
15+
gettext-setup (0.24)
16+
fast_gettext (~> 1.1.0)
17+
gettext (>= 3.0.2)
18+
locale
19+
hiera (3.3.1-x64-mingw32)
20+
win32-dir (~> 0.4.8)
21+
json (1.8.3)
22+
json_pure (1.8.6)
23+
locale (2.1.2)
24+
metaclass (0.0.4)
25+
metadata-json-lint (1.1.0)
26+
json
27+
semantic_puppet (>= 0.1.2, < 2.0.0)
28+
spdx-licenses (~> 1.0)
29+
minitar (0.6.1)
30+
mocha (1.2.1)
31+
metaclass (~> 0.0.1)
32+
parser (2.4.0.0)
33+
ast (~> 2.2)
34+
powerpack (0.1.1)
35+
puppet (4.10.0-x64-mingw32)
36+
facter (> 2.0, < 4)
37+
ffi (~> 1.9.6)
38+
gettext-setup (>= 0.10, < 1)
39+
hiera (>= 2.0, < 4)
40+
json_pure (~> 1.8)
41+
locale (~> 2.1)
42+
minitar (~> 0.6.1)
43+
win32-dir (= 0.4.9)
44+
win32-eventlog (= 0.6.5)
45+
win32-process (= 0.7.5)
46+
win32-security (= 0.2.5)
47+
win32-service (= 0.8.8)
48+
puppet-lint (2.2.1)
49+
puppet-syntax (2.4.0)
50+
rake
51+
puppetlabs_spec_helper (2.1.2)
52+
mocha (~> 1.0)
53+
puppet-lint (~> 2.0)
54+
puppet-syntax (~> 2.0)
55+
rspec-puppet (~> 2.0)
56+
rainbow (2.2.2)
57+
rake
58+
rake (10.4.2)
59+
rspec (2.99.0)
60+
rspec-core (~> 2.99.0)
61+
rspec-expectations (~> 2.99.0)
62+
rspec-mocks (~> 2.99.0)
63+
rspec-core (2.99.2)
64+
rspec-expectations (2.99.2)
65+
diff-lcs (>= 1.1.3, < 2.0)
66+
rspec-mocks (2.99.4)
67+
rspec-puppet (2.5.0)
68+
rspec
69+
rubocop (0.48.1)
70+
parser (>= 2.3.3.1, < 3.0)
71+
powerpack (~> 0.1)
72+
rainbow (>= 1.99.1, < 3.0)
73+
ruby-progressbar (~> 1.7)
74+
unicode-display_width (~> 1.0, >= 1.0.1)
75+
ruby-progressbar (1.8.1)
76+
semantic_puppet (1.0.0)
77+
gettext-setup (>= 0.3)
78+
spdx-licenses (1.1.0)
79+
text (1.3.1)
80+
unicode-display_width (1.2.1)
81+
win32-dir (0.4.9)
82+
ffi (>= 1.0.0)
83+
win32-eventlog (0.6.5)
84+
ffi
85+
win32-process (0.7.5)
86+
ffi (>= 1.0.0)
87+
win32-security (0.2.5)
88+
ffi
89+
win32-service (0.8.8)
90+
ffi
91+
92+
PLATFORMS
93+
x64-mingw32
94+
95+
DEPENDENCIES
96+
facter (>= 1.7.0)
97+
metadata-json-lint
98+
puppet (>= 3.3)
99+
puppet-lint (>= 1.0.0)
100+
puppetlabs_spec_helper (>= 1.0.0)
101+
rspec-puppet
102+
rubocop
103+
104+
BUNDLED WITH
105+
1.15.0.pre.3

README.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# unity
2+
3+
#### Table of Contents
4+
5+
1. [Description](#description)
6+
1. [Setup - The basics of getting started with unity](#setup)
7+
* [What unity affects](#what-unity-affects)
8+
* [Setup requirements](#setup-requirements)
9+
* [Beginning with unity](#beginning-with-unity)
10+
1. [Usage - Configuration options and additional functionality](#usage)
11+
1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
12+
1. [Limitations - OS compatibility, etc.](#limitations)
13+
1. [Development - Guide for contributing to the module](#development)
14+
15+
## Description
16+
17+
Start with a one- or two-sentence summary of what the module does and/or what
18+
problem it solves. This is your 30-second elevator pitch for your module.
19+
Consider including OS/Puppet version it works with.
20+
21+
You can give more descriptive information in a second paragraph. This paragraph
22+
should answer the questions: "What does this module *do*?" and "Why would I use
23+
it?" If your module has a range of functionality (installation, configuration,
24+
management, etc.), this is the time to mention it.
25+
26+
## Setup
27+
28+
### What unity affects **OPTIONAL**
29+
30+
If it's obvious what your module touches, you can skip this section. For
31+
example, folks can probably figure out that your mysql_instance module affects
32+
their MySQL instances.
33+
34+
If there's more that they should know about, though, this is the place to mention:
35+
36+
* A list of files, packages, services, or operations that the module will alter,
37+
impact, or execute.
38+
* Dependencies that your module automatically installs.
39+
* Warnings or other important notices.
40+
41+
### Setup Requirements **OPTIONAL**
42+
43+
If your module requires anything extra before setting up (pluginsync enabled,
44+
etc.), mention it here.
45+
46+
If your most recent release breaks compatibility or requires particular steps
47+
for upgrading, you might want to include an additional "Upgrading" section
48+
here.
49+
50+
### Beginning with unity
51+
52+
The very basic steps needed for a user to get the module up and running. This
53+
can include setup steps, if necessary, or it can be an example of the most
54+
basic use of the module.
55+
56+
## Usage
57+
58+
This section is where you describe how to customize, configure, and do the
59+
fancy stuff with your module here. It's especially helpful if you include usage
60+
examples and code samples for doing things with your module.
61+
62+
## Reference
63+
64+
Here, include a complete list of your module's classes, types, providers,
65+
facts, along with the parameters for each. Users refer to this section (thus
66+
the name "Reference") to find specific details; most users don't read it per
67+
se.
68+
69+
## Limitations
70+
71+
This is where you list OS compatibility, version compatibility, etc. If there
72+
are Known Issues, you might want to include them under their own heading here.
73+
74+
## Development
75+
76+
Since your module is awesome, other users will want to play with it. Let them
77+
know what the ground rules for contributing are.
78+
79+
## Release Notes/Contributors/Etc. **Optional**
80+
81+
If you aren't using changelog, put your release notes here (though you should
82+
consider using changelog). You can also add any additional sections you feel
83+
are necessary or important to include here. Please use the `## ` header.

Rakefile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require 'puppetlabs_spec_helper/rake_tasks'
2+
require 'puppet-lint/tasks/puppet-lint'
3+
require 'metadata-json-lint/rake_task'
4+
5+
if RUBY_VERSION >= '1.9'
6+
require 'rubocop/rake_task'
7+
RuboCop::RakeTask.new
8+
end
9+
10+
PuppetLint.configuration.send('disable_80chars')
11+
PuppetLint.configuration.relative = true
12+
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp']
13+
14+
desc 'Validate manifests, templates, and ruby files'
15+
task :validate do
16+
Dir['manifests/**/*.pp'].each do |manifest|
17+
sh "puppet parser validate --noop #{manifest}"
18+
end
19+
Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file|
20+
sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures}
21+
end
22+
Dir['templates/**/*.erb'].each do |template|
23+
sh "erb -P -x -T '-' #{template} | ruby -c"
24+
end
25+
end
26+
27+
desc 'Run metadata_lint, lint, validate, and spec tests.'
28+
task :test do
29+
[:metadata_lint, :lint, :validate, :spec].each do |test|
30+
Rake::Task[test].invoke
31+
end
32+
end

examples/example_license.pp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
notice ("System")
2+
unity_system { 'FNM00150600267':
3+
ip => '10.245.101.35',
4+
user => 'admin',
5+
password => 'Password123!',
6+
}
7+
notice ("License")
8+
9+
10+
unity_license{ 'C:/Users/wangp11/RubymineProjects/dellemc-unity/examples/license-any-host-Merlin-ESSENTIAL.lic':
11+
unity_system => Unity_system['FNM00150600267'],
12+
}

examples/example_pool.pp

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
unity_system { 'FNM00150600267':
2+
ip => '10.245.101.35',
3+
user => 'admin',
4+
password => 'Password123!',
5+
}
6+
7+
unity_pool { 'Beijing':
8+
unity_system => Unity_system['FNM00150600267'],
9+
description => 'Test that the pool is already created',
10+
raid_groups => [{
11+
disk_group => 'dg_15',
12+
raid_type => 1,
13+
stripe_width => 0,
14+
disk_num => 5,
15+
}]
16+
}
17+
18+
19+
unity_pool { 'puppet_pool':
20+
unity_system => Unity_system['FNM00150600267'],
21+
description => 'created by puppet module',
22+
raid_groups => [{
23+
disk_group => 'dg_15',
24+
raid_type => 1,
25+
stripe_width => 0,
26+
disk_num => 5,
27+
}]
28+
}
29+
30+

examples/example_system.pp

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
unity_system { 'FNM00150600267':
2+
ip => '10.245.101.35',
3+
user => 'admin',
4+
password => 'Password123!',
5+
}

examples/example_system_wrongip.pp

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
unity_system { 'FNM00150600267':
2+
ip => '10.244.101.35',
3+
user => 'admin',
4+
password => 'Password123!',
5+
}

examples/init.pp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# The baseline for module testing used by Puppet Labs is that each manifest
2+
# should have a corresponding test manifest that declares that class or defined
3+
# type.
4+
#
5+
# Tests are then run by using puppet apply --noop (to check for compilation
6+
# errors and view a log of events) or by fully applying the test in a virtual
7+
# environment (to compare the resulting system state to the desired state).
8+
#
9+
# Learn more about module testing here:
10+
# https://docs.puppet.com/guides/tests_smoke.html
11+
#
12+
include ::unity

0 commit comments

Comments
 (0)