Commit 89757dd8 authored by Scott Barthelemy's avatar Scott Barthelemy Committed by Fabien Combernous

Resolve "Install Client Centos7"

parent 9e12922a
......@@ -39,8 +39,7 @@ class freeipa::install::client {
$client_install_cmd_opts_no_ntp = '--no-ntp'
}
$client_install_cmd = "\
/usr/sbin/ipa-client-install \
$client_install_cmd = "/usr/sbin/ipa-client-install \
--server=${freeipa::ipa_master_fqdn} \
--realm=${freeipa::final_realm} \
--domain=${freeipa::domain} \
......
......@@ -37,7 +37,7 @@ describe 'freeipa class' do
end
end
end
### Test Install Replica
context 'replica' do
context 'with default parameters' do
......@@ -69,5 +69,27 @@ describe 'freeipa class' do
end
end
end
### Test Install Client
context 'when clients' do
context 'with default parameters' do
hosts_as('client').each do |client|
it 'applies idempotently' do
pp = <<-EOS
class {'freeipa':
ipa_role => 'client',
domain => 'vagrant.example.lan',
domain_join_password => 'vagrant123',
install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan',
}
EOS
apply_manifest_on(client, pp, catch_failures: true, debug: true)
apply_manifest_on(client, pp, catch_changes: true, debug: true)
end
end
end
end
end
end
......@@ -24,6 +24,14 @@ HOSTS:
box: geerlingguy/centos7
vagrant_memsize: 2048
ip: 192.168.44.36
ipa-client-centos:
roles:
- client
- centos7
platform: el-7-x86_64
hypervisor: vagrant
box: geerlingguy/centos7
ip: 192.168.44.37
CONFIG:
type: foss
......
......@@ -71,5 +71,38 @@ RSpec.configure do |c|
apply_manifest_on(replica, pp, :catch_failures => true, :debug => true)
end
## Preconfigure client
hosts_as('centos7').each do |centos7|
pp = <<-EOS
exec { 'set client centos /etc/hosts':
path => '/bin/',
command => 'echo -e "127.0.0.1 ipa-client-centos.vagrant.example.lan ipa-server-2\n ::1 ip6-localhost ip6-loopback\n fe00::0 ip6-localnet\n ff00::0 ip6-mcastprefix\n ff02::1 ip6-allnodes\n ff02::2 ip6-allrouters\n\n 192.168.44.37 ipa-client-centos.vagrant.example.lan ipa-client-centos\n" > /etc/hosts',
}
EOS
apply_manifest_on(centos7, pp, catch_failures: true)
end
hosts_as('client').each do |client|
pp = <<-EOS
class { 'resolv_conf':
nameservers => ['192.168.44.35'],
}
EOS
apply_manifest_on(client, pp, catch_failures: true)
puppet('module', 'install', 'saz-resolv_conf')
pp = <<-EOS
host {'ipa-server-1.vagrant.example.lan':
ensure => present,
ip => '192.168.44.35',
}
EOS
apply_manifest_on(client, pp, catch_failures: true)
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment