chef/site-cookbooks/kosmos-dirsrv/recipes/default.rb

31 lines
861 B
Ruby

#
# Cookbook Name:: kosmos-dirsrv
# Recipe:: default
#
credentials = data_bag_item("credentials", "dirsrv")
local_hostname = "#{node["hostname"]}.kosmos.local"
hostsfile_entry "127.0.0.1" do
hostname local_hostname
end
dirsrv_instance "master" do
hostname local_hostname
admin_password credentials['admin_password']
suffix "dc=kosmos,dc=org"
end
# FIXME: The firewall and backup recipes do not work in the custom resource, so
# the code lives here for now. The issue is described here, but I think messing
# with the run context is confusing:
#
# https://github.com/chef-cookbooks/firewall/issues/134
include_recipe "kosmos-dirsrv::firewall"
unless node.chef_environment == "development"
# backup the data dir and the config files
node.override["backup"]["archives"]["dirsrv"] = ["/etc/dirsrv", "/var/lib/dirsrv"]
include_recipe "backup"
end