diff --git a/nodes/ldap-1.json b/nodes/ldap-1.kosmos.org.json similarity index 78% rename from nodes/ldap-1.json rename to nodes/ldap-1.kosmos.org.json index 3fb5b39..d81bfee 100644 --- a/nodes/ldap-1.json +++ b/nodes/ldap-1.kosmos.org.json @@ -1,22 +1,24 @@ { - "name": "ldap-1", + "name": "ldap-1.kosmos.org", "normal": { "knife_zero": { "host": "10.1.1.63" } }, "automatic": { - "fqdn": "ldap-1", + "fqdn": "ldap-1.kosmos.org", "os": "linux", "os_version": "5.4.0-1049-kvm", "hostname": "ldap-1", "ipaddress": "192.168.122.164", "roles": [ - + "dirsrv_primary" ], "recipes": [ "kosmos-base", "kosmos-base::default", + "kosmos-dirsrv", + "kosmos-dirsrv::default", "apt::default", "timezone_iii::default", "timezone_iii::debian", @@ -30,7 +32,11 @@ "postfix::_common", "postfix::_attributes", "postfix::sasl_auth", - "hostname::default" + "hostname::default", + "kosmos-dirsrv::firewall", + "backup::default", + "logrotate::default", + "ulimit::default" ], "platform": "ubuntu", "platform_version": "20.04", @@ -49,6 +55,6 @@ }, "run_list": [ "recipe[kosmos-base]", - "role[ldap]" + "role[dirsrv_primary]" ] -} +} \ No newline at end of file diff --git a/roles/ldap.rb b/roles/dirsrv_primary.rb similarity index 64% rename from roles/ldap.rb rename to roles/dirsrv_primary.rb index 5c21643..ab18c68 100644 --- a/roles/ldap.rb +++ b/roles/dirsrv_primary.rb @@ -1,4 +1,4 @@ -name "ldap" +name "dirsrv_primary" run_list %w( recipe[kosmos-dirsrv] diff --git a/site-cookbooks/kosmos-dirsrv/recipes/firewall.rb b/site-cookbooks/kosmos-dirsrv/recipes/firewall.rb index e0b7c9a..9c01304 100644 --- a/site-cookbooks/kosmos-dirsrv/recipes/firewall.rb +++ b/site-cookbooks/kosmos-dirsrv/recipes/firewall.rb @@ -6,7 +6,7 @@ include_recipe "kosmos-base::firewall" firewall_rule "ldap" do - port [389, 636] + port [389] source "10.1.1.0/24" # zerotier protocol :tcp command :allow diff --git a/site-cookbooks/kosmos-dirsrv/resources/instance.rb b/site-cookbooks/kosmos-dirsrv/resources/instance.rb index 87675dd..7fd0374 100644 --- a/site-cookbooks/kosmos-dirsrv/resources/instance.rb +++ b/site-cookbooks/kosmos-dirsrv/resources/instance.rb @@ -1,4 +1,5 @@ resource_name :dirsrv_instance +provides :dirsrv_instance property :instance_name, String, name_property: true property :hostname, String, required: true @@ -45,7 +46,7 @@ action :create do end execute "setup-#{new_resource.instance_name}" do - command "setup-ds --silent --file #{setup_config}" + command "/usr/share/dirsrv/setup-ds.pl --silent --file #{setup_config}" creates ::File.join inst_dir, 'dse.ldif' action :nothing subscribes :run, "template[#{setup_config}]", :immediately