[Ovirt-devel] [PATCH server] last patch to implement remote freeipa
Joey Boggs
jboggs at redhat.com
Fri May 29 20:52:07 UTC 2009
This completes the last few requirements for remote ipa, one thing to note is that when using remote ipa we do not allow the choice of creating a local dns server on the ovirt node.
---
installer/bin/ovirt-installer | 22 ++++++++++++++++---
.../modules/ovirt/files/ovirt-remote-ipa.conf | 1 +
installer/modules/ovirt/manifests/freeipa.pp | 10 +++++++++
.../modules/ovirt/templates/ovirt-dhcp.conf.erb | 3 +-
4 files changed, 30 insertions(+), 6 deletions(-)
create mode 100644 installer/modules/ovirt/files/ovirt-remote-ipa.conf
diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer
index d0dc77b..3169938 100755
--- a/installer/bin/ovirt-installer
+++ b/installer/bin/ovirt-installer
@@ -175,8 +175,7 @@ guest_dev = guest_httpd_dev
#sep_networks = (guest_dev == admin_dev) ? "n" : "y"
ovirt_host = prompt_for_answer("Enter the hostname of the oVirt management server", :regex => IP_OR_FQDN, :default => hostname.chomp)
-#remote_ipa = prompt_yes_no("Is FreeIPA already installed on another machine?")
-remote_ipa = "n"
+remote_ipa = prompt_yes_no("Is FreeIPA already installed on another machine?")
if remote_ipa == "y"
ipa_host = prompt_for_answer("Enter the hostname of the FreeIPA server", :regex => IP_OR_FQDN)
else
@@ -196,14 +195,25 @@ ldap_dn_temp.each do |i|
# DNS Configuration
+ns_count = 0
+ns_list = {}
@cli.say( "\nThe following DNS servers were found:")
File.open('/etc/resolv.conf').each_line{ |line|
line = line.chomp
- puts line if line =~ /nameserver/
+ if line =~ /nameserver/
+ @cli.say(line)
+ ns,ip = line.split()
+ ns_list[ns_count] = ip
+ end
}
+
+if remote_ipa == "y"
+dns_servers = "n"
+else
@cli.say("<%= color('\nIf your above dns servers contain the A records for your management server select \"y\"
otherwise select \"n\" and a dns server will be configured during the install', RED) %>")
dns_servers = prompt_yes_no("Use this systems's dns servers?")
+end
guest_httpd_ipaddr = interfaces[guest_httpd_dev]
guest_ipaddr = interfaces[guest_dev]
@@ -235,7 +245,11 @@ if dhcp_setup == "n"
dhcp_start = prompt_for_answer("Enter the dhcp pool start address (example: 3):", :regex => OCTET)
dhcp_stop = prompt_for_answer("Enter the dhcp pool end addess (example: 100):", :regex => OCTET)
dhcp_domain = prompt_for_answer("Enter the dhcp domain you wish to use (example: example.com):", :default => dnsdomainname.chomp, :regex => IP_OR_FQDN)
- admin_dns_server = interfaces[admin_dev]
+ if dns_servers == "y"
+ admin_dns_server = ns_list[0]
+ else
+ admin_dns_server = admin_ipaddr
+ end
admin_network_gateway = prompt_for_answer("Enter the network gateway for your Admin network (example: 192.168.50.254):", :default => default_gw.chomp, :regex => IP_OR_FQDN)
tftp_setup = prompt_yes_no("Provide pxe/tftp capability?")
end
diff --git a/installer/modules/ovirt/files/ovirt-remote-ipa.conf b/installer/modules/ovirt/files/ovirt-remote-ipa.conf
new file mode 100644
index 0000000..5cf3506
--- /dev/null
+++ b/installer/modules/ovirt/files/ovirt-remote-ipa.conf
@@ -0,0 +1 @@
+Alias /ipa/config "/usr/share/ipa/html"
diff --git a/installer/modules/ovirt/manifests/freeipa.pp b/installer/modules/ovirt/manifests/freeipa.pp
index 8983e10..31449f0 100644
--- a/installer/modules/ovirt/manifests/freeipa.pp
+++ b/installer/modules/ovirt/manifests/freeipa.pp
@@ -143,6 +143,16 @@ class freeipa::remote {
notify => Service[httpd]
}
+ file{"/usr/share/ipa/html":
+ ensure => directory
+ }
+
+ file {"/etc/httpd/conf.d/ovirt-remote-ipa.conf":
+ source => "puppet:///ovirt/ovirt-remote-ipa.conf",
+ mode => 644,
+ notify => Service[httpd]
+ }
+
}
diff --git a/installer/modules/ovirt/templates/ovirt-dhcp.conf.erb b/installer/modules/ovirt/templates/ovirt-dhcp.conf.erb
index dda7976..03cfc2b 100644
--- a/installer/modules/ovirt/templates/ovirt-dhcp.conf.erb
+++ b/installer/modules/ovirt/templates/ovirt-dhcp.conf.erb
@@ -6,5 +6,4 @@ domain=<%= dhcp_domain %>
dhcp-option=option:router,<%= admin_network_gateway %>
dhcp-option=option:ntp-server,<%= ntp_server %>
dhcp-option=12
-local=/<%= dhcp_domain %>/
-server=<%= admin_dns_server %>
+dhcp-option=6,<%= admin_dns_server %>
--
1.6.0.6
More information about the ovirt-devel
mailing list