Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Scott Barthelemy
puppet-freeipa
Commits
f88c5846
Commit
f88c5846
authored
Sep 28, 2018
by
Fabien Combernous
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Fix install Replica"
parent
b7e14bff
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
5 deletions
+78
-5
manifests/install/server/replica.pp
manifests/install/server/replica.pp
+1
-2
spec/acceptance/freeipa_spec.rb
spec/acceptance/freeipa_spec.rb
+32
-0
spec/acceptance/nodesets/default.yml
spec/acceptance/nodesets/default.yml
+10
-0
spec/classes/install/server_spec.rb
spec/classes/install/server_spec.rb
+0
-1
spec/spec_helper_acceptance.rb
spec/spec_helper_acceptance.rb
+35
-2
No files found.
manifests/install/server/replica.pp
View file @
f88c5846
...
...
@@ -5,8 +5,7 @@
# @example
# include freeipa::install::server::replica
class
freeipa::install::server::replica
{
$replica_install_cmd
=
"
\
/usr/sbin/ipa-replica-install
\
$replica_install_cmd
=
"/usr/sbin/ipa-replica-install
\
--principal=
${freeipa::final_domain_join_principal}
\
--admin-password='
${freeipa::final_domain_join_password}
'
\
${freeipa::install::server::server_install_cmd_opts_hostname}
\
...
...
spec/acceptance/freeipa_spec.rb
View file @
f88c5846
...
...
@@ -37,5 +37,37 @@ describe 'freeipa class' do
end
end
end
### Test Install Replica
context
'replica'
do
context
'with default parameters'
do
hosts_as
(
'replica'
).
each
do
|
replica
|
it
'applies idempotently'
do
pp
=
<<-
EOS
class {'freeipa':
ipa_role => 'replica',
domain => 'vagrant.example.lan',
ipa_server_fqdn => 'ipa-server-2.vagrant.example.lan',
domain_join_password => 'vagrant123',
install_ipa_server => true,
ip_address => '192.168.44.36',
enable_ip_address => true,
enable_hostname => true,
manage_host_entry => true,
install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan',
}
EOS
apply_manifest_on
(
replica
,
pp
,
:catch_failures
=>
true
,
:debug
=>
true
)
apply_manifest_on
(
replica
,
pp
,
:catch_changes
=>
true
,
:debug
=>
true
)
end
describe
command
(
'ipactl status'
)
do
its
(
:exit_status
)
{
is_expected
.
to
be
0
}
end
end
end
end
end
end
spec/acceptance/nodesets/default.yml
View file @
f88c5846
...
...
@@ -7,6 +7,7 @@ HOSTS:
platform
:
el-7-x86_64
hypervisor
:
vagrant
box
:
geerlingguy/centos7
vagrant_memsize
:
2048
ip
:
192.168.44.35
forwarded_ports
:
httpd1
:
...
...
@@ -15,6 +16,15 @@ HOSTS:
httpd2
:
from
:
8440
to
:
8440
ipa-server-2
:
roles
:
-
replica
platform
:
el-7-x86_64
hypervisor
:
vagrant
box
:
geerlingguy/centos7
vagrant_memsize
:
2048
ip
:
192.168.44.36
CONFIG
:
type
:
foss
loglevel
:
debug
spec/classes/install/server_spec.rb
View file @
f88c5846
...
...
@@ -7,7 +7,6 @@ describe 'freeipa::install::server' do
'class{"freeipa": ipa_role => "master", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest", admin_password => "foobartest", directory_services_password => "foobartest", install_ipa_client => false, install_ipa_server => true}'
end
let
(
:facts
)
{
os_facts
}
let
(
:facts
)
{
os_facts
}
it
{
is_expected
.
to
compile
}
end
...
...
spec/spec_helper_acceptance.rb
View file @
f88c5846
...
...
@@ -17,6 +17,7 @@ RSpec.configure do |c|
on
host
,
puppet
(
'module'
,
'install'
,
'puppetlabs-stdlib'
)
on
host
,
puppet
(
'module'
,
'install'
,
'crayfishx-firewalld'
)
on
host
,
puppet
(
'module'
,
'install'
,
'puppet-selinux'
)
on
host
,
puppet
(
'module'
,
'install'
,
'saz-resolv_conf'
)
pp
=
<<-
EOS
exec { 'stop network manager':
...
...
@@ -27,8 +28,10 @@ RSpec.configure do |c|
EOS
apply_manifest_on
(
host
,
pp
,
catch_failures:
true
)
end
## Preconfigure master
## Preconfigure master
hosts_as
(
'master'
).
each
do
|
master
|
pp
=
<<-
EOS
exec { 'set master /etc/hosts':
path => '/bin/',
...
...
@@ -36,7 +39,37 @@ RSpec.configure do |c|
}
EOS
apply_manifest
(
pp
,
catch_failures:
true
,
debug:
true
)
apply_manifest_on
(
master
,
pp
,
catch_failures:
true
,
debug:
true
)
end
## Preconfigure replica
hosts_as
(
'replica'
).
each
do
|
replica
|
pp
=
<<-
EOS
exec { 'set replica /etc/hosts':
path => '/bin/',
command => 'echo -e "127.0.0.1 ipa-server-2.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.36 ipa-server-2.vagrant.example.lan ipa-server-2
\n
" > /etc/hosts',
}
EOS
apply_manifest_on
(
replica
,
pp
,
:catch_failures
=>
true
,
:debug
=>
true
)
pp
=
<<-
EOS
class { 'resolv_conf':
nameservers => ['192.168.44.35'],
}
EOS
apply_manifest_on
(
replica
,
pp
,
:catch_failures
=>
true
,
:debug
=>
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
(
replica
,
pp
,
:catch_failures
=>
true
,
:debug
=>
true
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment