Skip to content

Commit

Permalink
Merge pull request #22 from joshuabaird/ntp_support
Browse files Browse the repository at this point in the history
Add $ntp:: param for --no-ntp support
  • Loading branch information
stbenjam committed Feb 10, 2015
2 parents 7a9157e + c502e00 commit 95b177f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gem 'rspec-puppet', '< 1.0.0'
gem 'ruby-augeas'
gem 'puppet-lint', '>= 1'
gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]}
gem 'rspec', '~> 3.1.0'
12 changes: 11 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
# $mkhomedir:: Automatically make /home/<user> or not
# Default: true
#
# $ntp:: Manage and configure ntpd?
# Default: true
#
# $options:: Additional command-line options to pass directly to
# installer
#
Expand Down Expand Up @@ -83,6 +86,7 @@
$fixed_primary = $ipaclient::params::fixed_primary,
$installer = $ipaclient::params::installer,
$mkhomedir = $ipaclient::params::mkhomedir,
$ntp = $ipaclient::params::ntp,
$options = $ipaclient::params::options,
$package = $ipaclient::params::package,
$password = $ipaclient::params::password,
Expand Down Expand Up @@ -150,10 +154,16 @@
$opt_mkhomedir = ''
}

if !str2bool($ntp) {
$opt_ntp = '--no-ntp'
} else {
$opt_ntp = ''
}

# Flatten the arrays, delete empty options, and shellquote everything
$command = shellquote(delete(flatten([$installer,$opt_realm,$opt_password,
$opt_principal,$opt_mkhomedir,$opt_domain,
$opt_server,$opt_fixed_primary,$opt_ssh,$options,
$opt_server,$opt_fixed_primary,$opt_ssh,$opt_ntp,$options,
'--force','--unattended']), ''))

exec { 'ipa_installer':
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
$installer = '/usr/sbin/ipa-client-install'
$automount_location = ''
$automount_server = ''
$ntp = true

# Name of IPA package to install
case $::osfamily {
Expand Down
5 changes: 3 additions & 2 deletions spec/classes/ipaclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
:realm => "PIXIEDUST.COM",
:sudo => false,
:automount => true,
:automount_location => 'home'
:automount_location => 'home',
:ntp => false
} end

it "should install the right package" do
Expand All @@ -103,7 +104,7 @@
end

it "should generate the correct command" do
should contain_exec('ipa_installer').with_command("/usr/sbin/ipa-client-install --realm PIXIEDUST.COM --password unicorns --principal [email protected] --domain pixiedust.com --server ipa01.pixiedust.com --force --unattended")
should contain_exec('ipa_installer').with_command("/usr/sbin/ipa-client-install --realm PIXIEDUST.COM --password unicorns --principal [email protected] --domain pixiedust.com --server ipa01.pixiedust.com --no-ntp --force --unattended")
end

it "should not configure sudoers" do
Expand Down

0 comments on commit 95b177f

Please sign in to comment.