Commit 29820f60 authored by Fabien Combernous's avatar Fabien Combernous

Merge branch '41-remove-vagrant-in-domain-name' into 'master'

Resolve "remove vagrant in domain name"

Closes #41

See merge request adullact/puppet-freeipa!44
parents 39f8b795 0c2a61aa
...@@ -45,12 +45,12 @@ Creating an IPA master, with the WebUI proxied to `https://localhost:8440`. ...@@ -45,12 +45,12 @@ Creating an IPA master, with the WebUI proxied to `https://localhost:8440`.
```puppet ```puppet
class {'freeipa': class {'freeipa':
ipa_role => 'master', ipa_role => 'master',
domain => 'vagrant.example.lan', domain => 'example.lan',
ipa_server_fqdn => 'ipa-server-1.vagrant.example.lan', ipa_server_fqdn => 'ipa-server-1.example.lan',
admin_password => 'vagrant123', admin_password => 'vagrant123',
directory_services_password => 'vagrant123', directory_services_password => 'vagrant123',
install_ipa_server => true, install_ipa_server => true,
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
enable_ip_address => true, enable_ip_address => true,
enable_hostname => true, enable_hostname => true,
manage_host_entry => true, manage_host_entry => true,
...@@ -65,16 +65,16 @@ Adding a replica: ...@@ -65,16 +65,16 @@ Adding a replica:
```puppet ```puppet
class {'::freeipa': class {'::freeipa':
ipa_role => 'replica', ipa_role => 'replica',
domain => 'vagrant.example.lan', domain => 'example.lan',
ipa_server_fqdn => 'ipa-server-2.vagrant.example.lan', ipa_server_fqdn => 'ipa-server-2.example.lan',
domain_join_password => 'vagrant123', domain_join_password => 'vagrant123',
install_ipa_server => true, install_ipa_server => true,
ip_address => '192.168.44.36', ip_address => '10.10.10.36',
enable_ip_address => true, enable_ip_address => true,
enable_hostname => true, enable_hostname => true,
manage_host_entry => true, manage_host_entry => true,
install_epel => true, install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan', ipa_master_fqdn => 'ipa-server-1.example.lan',
} }
``` ```
...@@ -82,10 +82,10 @@ Adding a client: ...@@ -82,10 +82,10 @@ Adding a client:
```puppet ```puppet
class {'::freeipa': class {'::freeipa':
ipa_role => 'client', ipa_role => 'client',
domain => 'vagrant.example.lan', domain => 'example.lan',
domain_join_password => 'vagrant123', domain_join_password => 'vagrant123',
install_epel => true, install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan', ipa_master_fqdn => 'ipa-server-1.example.lan',
} }
``` ```
......
...@@ -7,12 +7,12 @@ describe 'freeipa class' do ...@@ -7,12 +7,12 @@ describe 'freeipa class' do
pp = <<-EOS pp = <<-EOS
class { 'freeipa': class { 'freeipa':
ipa_role => 'master', ipa_role => 'master',
domain => 'vagrant.example.lan', domain => 'example.lan',
ipa_server_fqdn => 'ipa-server-1.vagrant.example.lan', ipa_server_fqdn => 'ipa-server-1.example.lan',
admin_password => 'vagrant123', admin_password => 'vagrant123',
directory_services_password => 'vagrant123', directory_services_password => 'vagrant123',
install_ipa_server => true, install_ipa_server => true,
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
enable_ip_address => true, enable_ip_address => true,
enable_hostname => true, enable_hostname => true,
manage_host_entry => true, manage_host_entry => true,
...@@ -20,7 +20,7 @@ describe 'freeipa class' do ...@@ -20,7 +20,7 @@ describe 'freeipa class' do
webui_disable_kerberos => true, webui_disable_kerberos => true,
webui_enable_proxy => true, webui_enable_proxy => true,
webui_force_https => true, webui_force_https => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan', ipa_master_fqdn => 'ipa-server-1.example.lan',
} }
EOS EOS
...@@ -40,18 +40,18 @@ describe 'freeipa class' do ...@@ -40,18 +40,18 @@ describe 'freeipa class' do
pp = <<-EOS pp = <<-EOS
class {'freeipa': class {'freeipa':
ipa_role => 'replica', ipa_role => 'replica',
domain => 'vagrant.example.lan', domain => 'example.lan',
ipa_server_fqdn => 'ipa-server-2.vagrant.example.lan', ipa_server_fqdn => 'ipa-server-2.example.lan',
admin_password => 'vagrant123', admin_password => 'vagrant123',
directory_services_password => 'vagrant123', directory_services_password => 'vagrant123',
password_usedto_joindomain => 'vagrant123', password_usedto_joindomain => 'vagrant123',
install_ipa_server => true, install_ipa_server => true,
ip_address => '192.168.44.36', ip_address => '10.10.10.36',
enable_ip_address => true, enable_ip_address => true,
enable_hostname => true, enable_hostname => true,
manage_host_entry => true, manage_host_entry => true,
install_epel => true, install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan' ipa_master_fqdn => 'ipa-server-1.example.lan'
} }
EOS EOS
...@@ -72,13 +72,13 @@ describe 'freeipa class' do ...@@ -72,13 +72,13 @@ describe 'freeipa class' do
pp = <<-EOS pp = <<-EOS
class {'freeipa': class {'freeipa':
ipa_role => 'client', ipa_role => 'client',
domain => 'vagrant.example.lan', domain => 'example.lan',
admin_password => 'vagrant123', admin_password => 'vagrant123',
directory_services_password => 'vagrant123', directory_services_password => 'vagrant123',
password_usedto_joindomain => 'vagrant123', password_usedto_joindomain => 'vagrant123',
ip_address => '192.168.44.37', ip_address => '10.10.10.37',
install_epel => true, install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan' ipa_master_fqdn => 'ipa-server-1.example.lan'
} }
EOS EOS
...@@ -125,7 +125,7 @@ describe 'freeipa class' do ...@@ -125,7 +125,7 @@ describe 'freeipa class' do
pp = <<-EOS pp = <<-EOS
exec { 'test ssh': exec { 'test ssh':
path => '/bin/', path => '/bin/',
command => 'ssh -o "StrictHostKeyChecking no" toto@192.168.44.37 id', command => 'ssh -o "StrictHostKeyChecking no" toto@10.10.10.37 id',
returns => "0" returns => "0"
} }
EOS EOS
......
...@@ -12,7 +12,7 @@ HOSTS: ...@@ -12,7 +12,7 @@ HOSTS:
box_check_update: false box_check_update: false
vagrant_memsize: 2048 vagrant_memsize: 2048
vagrant_cpus: 2 vagrant_cpus: 2
ip: 192.168.44.35 ip: 10.10.10.35
ipa-server-2: ipa-server-2:
roles: roles:
- replica - replica
...@@ -24,7 +24,7 @@ HOSTS: ...@@ -24,7 +24,7 @@ HOSTS:
box_check_update: false box_check_update: false
vagrant_memsize: 2048 vagrant_memsize: 2048
vagrant_cpus: 2 vagrant_cpus: 2
ip: 192.168.44.36 ip: 10.10.10.36
ipa-client-centos: ipa-client-centos:
roles: roles:
- client - client
...@@ -36,7 +36,7 @@ HOSTS: ...@@ -36,7 +36,7 @@ HOSTS:
box_version: 1809.01 box_version: 1809.01
box_check_update: false box_check_update: false
vagrant_memsize: 1024 vagrant_memsize: 1024
ip: 192.168.44.37 ip: 10.10.10.37
ipa-client-ubuntu16: ipa-client-ubuntu16:
roles: roles:
- client - client
...@@ -47,7 +47,7 @@ HOSTS: ...@@ -47,7 +47,7 @@ HOSTS:
box_version: 20181114.0.0 box_version: 20181114.0.0
box_check_update: false box_check_update: false
vagrant_memsize: 1024 vagrant_memsize: 1024
ip: 192.168.44.38 ip: 10.10.10.38
CONFIG: CONFIG:
type: foss type: foss
......
...@@ -9,13 +9,13 @@ describe 'freeipa::config::admin_user' do ...@@ -9,13 +9,13 @@ describe 'freeipa::config::admin_user' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -9,13 +9,13 @@ describe 'freeipa::config::webui' do ...@@ -9,13 +9,13 @@ describe 'freeipa::config::webui' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -9,12 +9,12 @@ describe 'freeipa' do ...@@ -9,12 +9,12 @@ describe 'freeipa' do
let(:params) do let(:params) do
{ {
ipa_role: 'client', ipa_role: 'client',
ipa_master_fqdn: 'foo.example.com', ipa_master_fqdn: 'foo.example.lan',
domain: 'vagrant.lan', domain: 'example.lan',
password_usedto_joindomain: 'foobartest', password_usedto_joindomain: 'foobartest',
admin_password: 'vagrant123', admin_password: 'vagrant123',
directory_services_password: 'vagrant123', directory_services_password: 'vagrant123',
ip_address: '192.168.44.35' ip_address: '10.10.10.35'
} }
end end
......
require 'spec_helper' require 'spec_helper'
describe 'freeipa', type: :class do describe 'freeipa', type: :class do
...@@ -17,7 +15,7 @@ describe 'freeipa', type: :class do ...@@ -17,7 +15,7 @@ describe 'freeipa', type: :class do
domain: 'rspec.example.lan', domain: 'rspec.example.lan',
admin_password: 'rspecrspec123', admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123', directory_services_password: 'rspecrspec123',
ip_address: '192.168.44.35', ip_address: '10.10.10.35',
ipa_master_fqdn: 'master.rspec.example.lan' ipa_master_fqdn: 'master.rspec.example.lan'
} }
end end
...@@ -53,7 +51,7 @@ describe 'freeipa', type: :class do ...@@ -53,7 +51,7 @@ describe 'freeipa', type: :class do
domain: 'rspec.example.lan', domain: 'rspec.example.lan',
admin_password: 'rspecrspec123', admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123', directory_services_password: 'rspecrspec123',
ip_address: '192.168.44.36', ip_address: '10.10.10.36',
ipa_master_fqdn: 'replica.rspec.example.lan', ipa_master_fqdn: 'replica.rspec.example.lan',
password_usedto_joindomain: 'rspecrspec123' password_usedto_joindomain: 'rspecrspec123'
} }
...@@ -92,7 +90,7 @@ describe 'freeipa', type: :class do ...@@ -92,7 +90,7 @@ describe 'freeipa', type: :class do
domain: 'rspec.example.lan', domain: 'rspec.example.lan',
admin_password: 'rspecrspec123', admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123', directory_services_password: 'rspecrspec123',
ip_address: '192.168.44.36', ip_address: '10.10.10.36',
ipa_master_fqdn: 'client.rspec.example.lan', ipa_master_fqdn: 'client.rspec.example.lan',
password_usedto_joindomain: 'rspecrspec123' password_usedto_joindomain: 'rspecrspec123'
} }
......
...@@ -10,13 +10,13 @@ describe 'freeipa::install::autofs' do ...@@ -10,13 +10,13 @@ describe 'freeipa::install::autofs' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -10,13 +10,13 @@ describe 'freeipa::install::client' do ...@@ -10,13 +10,13 @@ describe 'freeipa::install::client' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'client', ipa_role => 'client',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -9,13 +9,13 @@ describe 'freeipa::install::server::master' do ...@@ -9,13 +9,13 @@ describe 'freeipa::install::server::master' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -9,13 +9,13 @@ describe 'freeipa::install::server::replica' do ...@@ -9,13 +9,13 @@ describe 'freeipa::install::server::replica' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'replica', ipa_role => 'replica',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -10,13 +10,13 @@ describe 'freeipa::install::server' do ...@@ -10,13 +10,13 @@ describe 'freeipa::install::server' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -10,13 +10,13 @@ describe 'freeipa::install::sssd' do ...@@ -10,13 +10,13 @@ describe 'freeipa::install::sssd' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -10,13 +10,13 @@ describe 'freeipa::install' do ...@@ -10,13 +10,13 @@ describe 'freeipa::install' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
...@@ -7,13 +7,13 @@ describe 'freeipa::helpers::flushcache' do ...@@ -7,13 +7,13 @@ describe 'freeipa::helpers::flushcache' do
manifest = <<-EOS manifest = <<-EOS
class{ 'freeipa' : class{ 'freeipa' :
ipa_role => 'master', ipa_role => 'master',
ipa_master_fqdn => 'master.example.com', ipa_master_fqdn => 'master.example.lan',
ipa_server_fqdn => 'foo.example.com', ipa_server_fqdn => 'foo.example.lan',
domain => 'vagrant.lan', domain => 'example.lan',
password_usedto_joindomain => 'foobartest', password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest', admin_password => 'foobartest',
directory_services_password => 'foobartest', directory_services_password => 'foobartest',
ip_address => '192.168.44.35', ip_address => '10.10.10.35',
} }
EOS EOS
manifest manifest
......
require 'beaker-rspec' require 'beaker-rspec'
require 'beaker-puppet' require 'beaker-puppet'
require 'beaker/puppet_install_helper' require 'beaker/puppet_install_helper'
...@@ -41,55 +39,55 @@ RSpec.configure do |c| ...@@ -41,55 +39,55 @@ RSpec.configure do |c|
# But here we use several roles dedicated, used only once time in nodeset. # But here we use several roles dedicated, used only once time in nodeset.
# This permit to use one different IP for each role : master, replica, client-centos7 and client-ubuntu16. # This permit to use one different IP for each role : master, replica, client-centos7 and client-ubuntu16.
# Here master with ip address 192.168.44.35 # Here master with ip address 10.10.10.35
hosts_as('master').each do |master| hosts_as('master').each do |master|
pp = <<-EOS pp = <<-EOS
exec { 'set master /etc/hosts': exec { 'set master /etc/hosts':
path => '/bin/', path => '/bin/',
command => 'echo -e "127.0.0.1 ipa-server-1.vagrant.example.lan ipa-server-1\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.35 ipa-server-1.vagrant.example.lan ipa-server-1\n" > /etc/hosts', command => 'echo -e "127.0.0.1 ipa-server-1.example.lan ipa-server-1\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 10.10.10.35 ipa-server-1.example.lan ipa-server-1\n" > /etc/hosts',
} }
EOS EOS
apply_manifest_on(master, pp, catch_failures: true, debug: true) apply_manifest_on(master, pp, catch_failures: true, debug: true)
end end
# Here replica with ip address 192.168.44.36 # Here replica with ip address 10.10.10.36
hosts_as('replica').each do |replica| hosts_as('replica').each do |replica|
pp = <<-EOS pp = <<-EOS
exec { 'set replica /etc/hosts': exec { 'set replica /etc/hosts':
path => '/bin/', 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', command => 'echo -e "127.0.0.1 ipa-server-2.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 10.10.10.36 ipa-server-2.example.lan ipa-server-2\n" > /etc/hosts',
} }
class { 'resolv_conf': class { 'resolv_conf':
nameservers => ['192.168.44.35'], nameservers => ['10.10.10.35'],
} }
host {'ipa-server-1.vagrant.example.lan': host {'ipa-server-1.example.lan':
ensure => present, ensure => present,
ip => '192.168.44.35', ip => '10.10.10.35',
} }
EOS EOS
apply_manifest_on(replica, pp, catch_failures: true, debug: true) apply_manifest_on(replica, pp, catch_failures: true, debug: true)
end end
# Here a first client running CentOS7 with ip address 192.168.44.37 # Here a first client running CentOS7 with ip address 10.10.10.37
hosts_as('client-centos7').each do |clientcentos7| hosts_as('client-centos7').each do |clientcentos7|
pp = <<-EOS pp = <<-EOS
exec { 'set client centos /etc/hosts': exec { 'set client centos /etc/hosts':
path => '/bin/', 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', command => 'echo -e "127.0.0.1 ipa-client-centos.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 10.10.10.37 ipa-client-centos.example.lan ipa-client-centos\n" > /etc/hosts',
} }
EOS EOS
apply_manifest_on(clientcentos7, pp, catch_failures: true) apply_manifest_on(clientcentos7, pp, catch_failures: true)
end end
# Here a second client running Ubuntu1604 with ip address 192.168.44.38 # Here a second client running Ubuntu1604 with ip address 10.10.10.38
hosts_as('client-ubuntu16').each do |clientubuntu16| hosts_as('client-ubuntu16').each do |clientubuntu16|
pp = <<-EOS pp = <<-EOS
exec { 'set client ubuntu /etc/hosts': exec { 'set client ubuntu /etc/hosts':
path => '/bin/', path => '/bin/',
command => 'echo -e "127.0.0.1 ipa-client-ubuntu16.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.38 ipa-client-ubuntu16.vagrant.example.lan ipa-client-ubuntu16\n" > /etc/hosts', command => 'echo -e "127.0.0.1 ipa-client-ubuntu16.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 10.10.10.38 ipa-client-ubuntu16.example.lan ipa-client-ubuntu16\n" > /etc/hosts',
} }
EOS EOS
...@@ -104,11 +102,11 @@ RSpec.configure do |c| ...@@ -104,11 +102,11 @@ RSpec.configure do |c|
hosts_as('client').each do |client| hosts_as('client').each do |client|
pp = <<-EOS pp = <<-EOS
class { 'resolv_conf': class { 'resolv_conf':
nameservers => ['192.168.44.35'], nameservers => ['10.10.10.35'],
} }
host {'ipa-server-1.vagrant.example.lan': host {'ipa-server-1.example.lan':
ensure => present, ensure => present,
ip => '192.168.44.35', ip => '10.10.10.35',
} }
EOS EOS
......
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