Compare commits
5 Commits
480283cb5a
...
be9a853e50
Author | SHA1 | Date |
---|---|---|
7u83 | be9a853e50 | |
7u83 | 2e2ed5450b | |
7u83 | 6f6e465eac | |
7u83 | 148b93575a | |
7u83 | d4f6d352bc |
|
@ -0,0 +1,8 @@
|
|||
Facter.add('ads_instances') do
|
||||
setcode do
|
||||
Dir.glob('/opt/plnxtools/ads/*').map do |x|
|
||||
content = File.read(x)
|
||||
File.basename(x)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -13,6 +13,11 @@ inherits ::plnxtools
|
|||
{
|
||||
$ads_home = "$opt_dir/$appname"
|
||||
|
||||
file {"opt_plnx_ads":
|
||||
path => "$opt_dir/plnxtools/ads",
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
package {"openldap-client":
|
||||
ensure => installed
|
||||
}
|
||||
|
@ -35,6 +40,23 @@ inherits ::plnxtools
|
|||
}
|
||||
}
|
||||
|
||||
class plnxtools::apacheds::del(
|
||||
$ensure = stopped
|
||||
)
|
||||
inherits plnxtools::apacheds
|
||||
{
|
||||
$in = $facts['ads_instances']
|
||||
$in.each |$x| {
|
||||
|
||||
if !defined(Plnxtools::Apacheds::Instance[$x]) {
|
||||
plnxtools::apacheds::instance{$x:
|
||||
partitionid => "$x",
|
||||
partitionsuffix => "dc=$x,dc=org",
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define plnxtools::apacheds::instance(
|
||||
$ensure = running,
|
||||
|
@ -45,13 +67,14 @@ define plnxtools::apacheds::instance(
|
|||
|
||||
) {
|
||||
$ads_instances = $plnxtools::apacheds::ads_instances
|
||||
if $ensure != purged {
|
||||
$log_file = "$plnxtools::apacheds::ads_logdir/$title.log"
|
||||
|
||||
#
|
||||
# Create a base 64 encoded ads-contextentry
|
||||
# see: https://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html
|
||||
#
|
||||
$ads_contextentry0 = base64('encode',"dn: $partitionsuffix\ndc: uniadmin\nobjectclass: domain\nobjectclass: top\n\n")
|
||||
$ads_contextentry0 = base64('encode',"dn: $partitionsuffix\ndc: $title\nobjectclass: domain\nobjectclass: top\n\n")
|
||||
$ads_contextentry = strip(regsubst($ads_contextentry0, '\n', "\n "))
|
||||
|
||||
|
||||
|
@ -80,13 +103,42 @@ define plnxtools::apacheds::instance(
|
|||
}
|
||||
|
||||
|
||||
|
||||
$bin_dir = "${plnxtools::apacheds::opt_dir}/${plnxtools::apacheds::appname}/bin"
|
||||
|
||||
file {"/opt/plnxtools/ads/$title":
|
||||
ensure => file
|
||||
}->
|
||||
service {"apacheds_${title}":
|
||||
start => "$bin_dir/apacheds.sh $title start",
|
||||
stop => "$bin_dir/apacheds.sh $title stop",
|
||||
status => "$bin_dir/apacheds.sh $title status | grep 'is running'",
|
||||
ensure => running
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
else{
|
||||
service {"apacheds_${title}":
|
||||
start => "$bin_dir/apacheds.sh $title start",
|
||||
stop => "$bin_dir/apacheds.sh $title stop",
|
||||
status => "$bin_dir/apacheds.sh $title status | grep 'is running'",
|
||||
ensure => stopped,
|
||||
} ->
|
||||
file {"/opt/plnxtools/ads/$title":
|
||||
ensure => absent
|
||||
} ->
|
||||
file{"$ads_instances/$title":
|
||||
ensure => absent,
|
||||
force => true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
define plnxtools::apacheds::syncrepl(
|
||||
$parition,
|
||||
$consumer_id,
|
||||
)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ inherits plnxtools::params{
|
|||
file {"opt_dir":
|
||||
path => $opt_dir,
|
||||
ensure => directory
|
||||
}->
|
||||
file {"opt_dir_plnx":
|
||||
path => "$opt_dir/plnxtools",
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
#
|
||||
|
|
|
@ -705,7 +705,7 @@ objectclass: organizationalUnit
|
|||
objectclass: top
|
||||
|
||||
dn: ads-transportid=ldap,ou=transports,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
|
||||
ads-systemport: 10389
|
||||
ads-systemport: <%= @ldap_port %>
|
||||
ads-transportnbthreads: 8
|
||||
ads-transportaddress: 0.0.0.0
|
||||
ads-transportid: ldap
|
||||
|
|
Loading…
Reference in New Issue