Compare commits
2 Commits
858ab0815d
...
80df959c51
Author | SHA1 | Date |
---|---|---|
7u83 | 80df959c51 | |
7u83 | e03c2b623e |
|
@ -6,6 +6,8 @@
|
|||
include:
|
||||
- plnx.java
|
||||
|
||||
|
||||
|
||||
Apache Directory Server:
|
||||
archive.extracted:
|
||||
- name: {{ads.opt_dir}}
|
||||
|
@ -37,7 +39,7 @@ Apache Directory Server Config:
|
|||
ads_home: {{ads.opt_dir}}/ads
|
||||
java_home: {{java.java_home}}
|
||||
java_opts: ""
|
||||
ads_shutdown_port: ""
|
||||
ads_shutdown_port: "0"
|
||||
ads_instances: {{ads.instances}}
|
||||
- require:
|
||||
- AdsDirs
|
||||
|
@ -60,8 +62,18 @@ ADS Instance{{key}} Log Props:
|
|||
- defaults:
|
||||
log_file: "/tmp/{{key}}.log"
|
||||
|
||||
|
||||
{%- if not salt['file.file_exists' ](ads.instances +"/" + key + "/conf/config.ldif_migrated") %}
|
||||
ADS Instance{{key}} New Conf Dir:
|
||||
|
||||
# Create a base 64 encoded ads-contextentry
|
||||
# see: https://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html
|
||||
|
||||
{%
|
||||
set ads_contextentry = "dn: "+'dc=planix,dc=org\n'+"dc: "+key+"\n"+
|
||||
"objectclass: domain\nobjectclass: top\n\n"
|
||||
%}
|
||||
|
||||
ADS_Instance{{key}}:
|
||||
file.managed:
|
||||
- name: "{{ads.instances}}/{{key}}/conf/config.ldif"
|
||||
- source: "salt://plnx/apacheds/templates/config.ldif.jinja"
|
||||
|
@ -70,9 +82,56 @@ ADS Instance{{key}} New Conf Dir:
|
|||
partitionid: tube
|
||||
partitionsuffix: "dc=planix,dc=org"
|
||||
ldap_port: 12389
|
||||
ads_contextentry: ""
|
||||
ads_contextentry: "{{ads_contextentry | base64_encode }}"
|
||||
|
||||
ADS_Log_Dir{{key}}:
|
||||
file.directory:
|
||||
- name: "{{ads.instances}}/{{key}}/log"
|
||||
- require:
|
||||
- ADS_Instance{{key}}
|
||||
|
||||
ADS_Run_Dir{{key}}:
|
||||
file.directory:
|
||||
- name: "{{ads.instances}}/{{key}}/run"
|
||||
- require:
|
||||
- ADS_Instance{{key}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ADS_Start_Srvice{{key}}:
|
||||
#include:
|
||||
# - plnx.apacheds.myservice
|
||||
# - require:
|
||||
# - ADS_Instance{{key}}
|
||||
|
||||
ADS_Init_LDAP{{key}}:
|
||||
ldap.managed:
|
||||
- connect_spec:
|
||||
url: 'ldap://localhost:12389'
|
||||
bind:
|
||||
method: simple
|
||||
dn: 'uid=admin,ou=system'
|
||||
password: 'secret'
|
||||
- entries:
|
||||
- 'uid=admin,ou=system':
|
||||
- replace:
|
||||
uid:
|
||||
- admin
|
||||
userPassword: ['123456' ]
|
||||
|
||||
- require:
|
||||
- ADS_Start{{key}}
|
||||
|
||||
{%- endif %}
|
||||
|
||||
ADS_Start{{key}}:
|
||||
cmd.run:
|
||||
- name: "/opt/ads/bin/apacheds.sh {{key}} start && sleep 30"
|
||||
- require:
|
||||
- ADS_Instance{{key}}
|
||||
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue