[Ovirt-devel] re: [PATCH server] set ldap_dn in ldap.yml to support other hosts than management.priv.ovirt.org

Joey Boggs jboggs at redhat.com
Mon Feb 9 19:51:08 UTC 2009


Had to rebase this due to the last few commits causing it to fail when applied


---
 installer/bin/ovirt-installer              |    5 +++--
 installer/modules/ovirt/manifests/ovirt.pp |   12 +++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer
index 99601d4..f703149 100755
--- a/installer/bin/ovirt-installer
+++ b/installer/bin/ovirt-installer
@@ -204,7 +204,7 @@ realm_name = prompt_for_answer("Enter your realm name (example: example.com):",
 
 freeipa_password = prompt_for_answer("NOTE: The following pasword will also be your ovirtadmin password for the web management login\n\
 Enter an administrator password for FreeIPA:", :password => true)
-ldap_dn = "cn=ipaConfig,cn=etc,"
+ldap_dn = ""
 ldap_dn_temp = realm_name.split(".")
 ldap_dn_temp.each do |i|
     ldap_dn += "dc=#{i},"
@@ -275,7 +275,8 @@ $db_password = '<%= db_password %>'
 # FreeIPA configuration
 $realm_name = '<%= realm_name %>'
 $freeipa_password = '<%= freeipa_password %>'
-$ldap_dn = '<%= ldap_dn %>'
+$short_ldap_dn = '<%= ldap_dn %>'
+$ldap_dn = 'cn=ipaConfig,cn=etc,<%= ldap_dn %>'
 
 <% if cobbler_setup == "n" %>
 include cobbler::bundled
diff --git a/installer/modules/ovirt/manifests/ovirt.pp b/installer/modules/ovirt/manifests/ovirt.pp
index c5b146b..f3d69cb 100644
--- a/installer/modules/ovirt/manifests/ovirt.pp
+++ b/installer/modules/ovirt/manifests/ovirt.pp
@@ -87,9 +87,19 @@ class ovirt::setup {
 
         single_exec { "create_ovirtadmin_acct" :
 		command => "/usr/share/ovirt-server/script/grant_admin_privileges ovirtadmin",
-		require => Single_Exec[db_migrate]
+                require => [Single_Exec[db_migrate],Single_exec[set_ldap_hostname],Single_exec[set_ldap_dn]]
 	}
 
+        single_exec { "set_ldap_hostname" :
+                command => "/bin/sed -i -e 's/management.priv.ovirt.org/$ipa_host/' /usr/share/ovirt-server/config/ldap.yml",
+                require => Package[ovirt-server]
+        }
+
+        single_exec { "set_ldap_dn" :
+                command => "/bin/sed -i -e 's/dc=priv,dc=ovirt,dc=org/$short_ldap_dn/' /usr/share/ovirt-server/config/ldap.yml",
+                require => Package[ovirt-server]
+        }
+
 	single_exec { "add_host" :
 		command => "/usr/bin/ovirt-add-host $ipa_host /usr/share/ovirt-server/ovirt.keytab",
 		require => Package[ovirt-server],
-- 
1.6.0.6




More information about the ovirt-devel mailing list