Fix fresh dirsrv installs on Ubuntu 20.04

This commit is contained in:
2022-04-26 20:10:51 +02:00
parent 8fe3670ce9
commit 590366639e
7 changed files with 175 additions and 3 deletions
@@ -3,10 +3,12 @@
# Recipe:: default
#
include_recipe "kosmos-dirsrv::hostsfile"
credentials = data_bag_item("credentials", "dirsrv")
dirsrv_instance "master" do
hostname node['kosmos-dirsrv']['master_hostname']
hostname "ldap.kosmos.local"
admin_password credentials['admin_password']
suffix "dc=kosmos,dc=org"
end
@@ -0,0 +1,15 @@
#
# Cookbook:: kosmos-dirsrv
# Recipe:: hostsfile
#
dirsrv_primary = search(:node, "role:dirsrv_primary AND chef_environment:#{node.chef_environment}").first
unless dirsrv_primary.nil?
primary_ip = dirsrv_primary['knife_zero']['host']
hostsfile_entry primary_ip do
hostname "ldap.kosmos.local"
unique true
end
end