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"
|
$ads_home = "$opt_dir/$appname"
|
||||||
|
|
||||||
|
file {"opt_plnx_ads":
|
||||||
|
path => "$opt_dir/plnxtools/ads",
|
||||||
|
ensure => directory
|
||||||
|
}
|
||||||
|
|
||||||
package {"openldap-client":
|
package {"openldap-client":
|
||||||
ensure => installed
|
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(
|
define plnxtools::apacheds::instance(
|
||||||
$ensure = running,
|
$ensure = running,
|
||||||
|
@ -45,48 +67,78 @@ define plnxtools::apacheds::instance(
|
||||||
|
|
||||||
) {
|
) {
|
||||||
$ads_instances = $plnxtools::apacheds::ads_instances
|
$ads_instances = $plnxtools::apacheds::ads_instances
|
||||||
$log_file = "$plnxtools::apacheds::ads_logdir/$title.log"
|
if $ensure != purged {
|
||||||
|
$log_file = "$plnxtools::apacheds::ads_logdir/$title.log"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a base 64 encoded ads-contextentry
|
# Create a base 64 encoded ads-contextentry
|
||||||
# see: https://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html
|
# 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 "))
|
$ads_contextentry = strip(regsubst($ads_contextentry0, '\n', "\n "))
|
||||||
|
|
||||||
|
|
||||||
file{"$ads_instances/$title":
|
file{"$ads_instances/$title":
|
||||||
ensure => directory
|
ensure => directory
|
||||||
} ->
|
} ->
|
||||||
file{"$ads_instances/$title/conf":
|
file{"$ads_instances/$title/conf":
|
||||||
ensure => directory
|
ensure => directory
|
||||||
} ->
|
} ->
|
||||||
file{"$ads_instances/$title/log":
|
file{"$ads_instances/$title/log":
|
||||||
ensure => directory
|
ensure => directory
|
||||||
} ->
|
} ->
|
||||||
file{"$ads_instances/$title/run":
|
file{"$ads_instances/$title/run":
|
||||||
ensure => directory
|
ensure => directory
|
||||||
} ->
|
} ->
|
||||||
file{"$ads_instances/$title/conf/log4j.properties":
|
file{"$ads_instances/$title/conf/log4j.properties":
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template ("plnxtools/apacheds/log4j.properties.erb"),
|
content => template ("plnxtools/apacheds/log4j.properties.erb"),
|
||||||
}->
|
}->
|
||||||
file{"/tmp/ads-$title-config.ldif":
|
file{"/tmp/ads-$title-config.ldif":
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template ("plnxtools/apacheds/config.ldif.erb"),
|
content => template ("plnxtools/apacheds/config.ldif.erb"),
|
||||||
}->
|
}->
|
||||||
exec {"/bin/cp /tmp/ads-$title-config.ldif $ads_instances/$title/conf/config.ldif":
|
exec {"/bin/cp /tmp/ads-$title-config.ldif $ads_instances/$title/conf/config.ldif":
|
||||||
creates => "$ads_instances/$title/conf/config.ldif_migrated"
|
creates => "$ads_instances/$title/conf/config.ldif_migrated"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$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 => $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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$bin_dir = "${plnxtools::apacheds::opt_dir}/${plnxtools::apacheds::appname}/bin"
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
define plnxtools::apacheds::syncrepl(
|
||||||
|
$parition,
|
||||||
|
$consumer_id,
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@ inherits plnxtools::params{
|
||||||
file {"opt_dir":
|
file {"opt_dir":
|
||||||
path => $opt_dir,
|
path => $opt_dir,
|
||||||
ensure => directory
|
ensure => directory
|
||||||
|
}->
|
||||||
|
file {"opt_dir_plnx":
|
||||||
|
path => "$opt_dir/plnxtools",
|
||||||
|
ensure => directory
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -705,7 +705,7 @@ objectclass: organizationalUnit
|
||||||
objectclass: top
|
objectclass: top
|
||||||
|
|
||||||
dn: ads-transportid=ldap,ou=transports,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
|
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-transportnbthreads: 8
|
||||||
ads-transportaddress: 0.0.0.0
|
ads-transportaddress: 0.0.0.0
|
||||||
ads-transportid: ldap
|
ads-transportid: ldap
|
||||||
|
|
Loading…
Reference in New Issue