Skip to content

Commit

Permalink
replaced validate_string with validate_legacy
Browse files Browse the repository at this point in the history
* updated tests
  • Loading branch information
acjohnson committed Sep 30, 2017
1 parent d9046cd commit 25c52db
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 35 deletions.
5 changes: 0 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@

AllCops:
Include:
- '**/*.gemspec'
- '**/*.rake'
- '**/Gemfile'
- '**/Puppetfile'
- '**/Rakefile'
- '**/Guardfile'
Exclude:
- 'modules/**/*'
- 'pkg/**/*'
- 'spec/fixtures/**/*'
- 'vendor/**/*'
RunRailsCops: false
DisplayCopNames: true

Metrics/LineLength:
Expand Down
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ sudo: false
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.7
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.7
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 2.3.5
env: Puppet_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"

notifications:
email: false
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
2017-09-30 (0.0.2)
* Puppet 4x fixes
2016-07-07 (0.0.1)
* First release
14 changes: 1 addition & 13 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :unit_tests do
gem 'rubocop', '0.34.2', :require => false
gem 'rubocop', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'metadata-json-lint', :require => false
Expand All @@ -22,18 +22,6 @@ group :unit_tests do
gem 'puppet-lint-appends-check', :require => false
end

group :development do
gem 'simplecov', :require => false
# gem 'guard-rake', :require => false
gem 'librarian-puppet', :require => false
end

group :system_tests do
# gem 'vagrant-wrapper', :require => false
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
end

if (facterversion = ENV['FACTER_GEM_VERSION'])
gem 'facter', facterversion, :require => false
else
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ class {'::adcli':

## Reference

#####`ad_domain`
`ad_domain`
Defines the Active Directory domain to join
Type: string
Default: undef

#####`ad_join_username`
`ad_join_username`
Defines the Active Directory username to use during domain join operations.
Type: string
Default: undef

#####`$ad_join_password`
`$ad_join_password`
Defines the Active Directory password to use during domain join operations. hiera-eyaml should be used for secure storage of this password.
Type: string
Default: undef

#####`$ad_join_ou`
`$ad_join_ou`
Defines the Active Directory organizational unit to use during domain join operations.
Type: string
Default: undef
Expand Down
10 changes: 4 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@
$ad_join_ou = $adcli::params::ad_join_ou,
) inherits adcli::params {

validate_string(
$ad_domain,
$ad_join_username,
$ad_join_password,
$ad_join_ou
)
validate_legacy(String, 'validate_string', $ad_domain)
validate_legacy(String, 'validate_string', $ad_join_username)
validate_legacy(String, 'validate_string', $ad_join_password)
validate_legacy(String, 'validate_string', $ad_join_ou)

anchor { 'adcli::begin': } ->
class { '::adcli::install': } ->
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-adcli",
"version": "0.0.1",
"version": "0.0.2",
"author": "Aaron Johnson",
"summary": "Install adcli package and Join Active Directory using adcli",
"license": "GPL-3.0+",
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
context 'with defaults for all parameters' do
it { is_expected.to contain_class('adcli::install') }
it { is_expected.to contain_class('adcli::join') }

it { is_expected.to contain_package('adcli').with_ensure('present') }
it { is_expected.to contain_exec('adcli_join') }
end
Expand All @@ -48,7 +47,6 @@
context 'with defaults for all parameters' do
it { is_expected.to contain_class('adcli::install') }
it { is_expected.to contain_class('adcli::join') }

it { is_expected.to contain_package('adcli').with_ensure('present') }
it { is_expected.to contain_exec('adcli_join') }
end
Expand Down
6 changes: 6 additions & 0 deletions tests/test.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class {'::adcli':
ad_domain => 'ad.example.com',
ad_join_username => 'username',
ad_join_password => 'secret',
ad_join_ou => 'ou=container,dc=example,dc=com'
}

0 comments on commit 25c52db

Please sign in to comment.