Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $ntp:: param for --no-ntp support #22

Merged
merged 3 commits into from
Feb 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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