Can start ads now and initialize admin password

This commit is contained in:
7u83 2020-07-29 23:04:57 +00:00
parent e03c2b623e
commit 80df959c51
1 changed files with 52 additions and 2 deletions

View File

@ -6,6 +6,8 @@
include:
- plnx.java
Apache Directory Server:
archive.extracted:
- name: {{ads.opt_dir}}
@ -61,6 +63,8 @@ ADS Instance{{key}} Log Props:
log_file: "/tmp/{{key}}.log"
{%- if not salt['file.file_exists' ](ads.instances +"/" + key + "/conf/config.ldif_migrated") %}
# Create a base 64 encoded ads-contextentry
# see: https://directory.apache.org/apacheds/basic-ug/1.4.3-adding-partition.html
@ -69,8 +73,7 @@ ADS Instance{{key}} Log Props:
"objectclass: domain\nobjectclass: top\n\n"
%}
{%- if not salt['file.file_exists' ](ads.instances +"/" + key + "/conf/config.ldif_migrated") %}
ADS Instance{{key}} New Conf Dir:
ADS_Instance{{key}}:
file.managed:
- name: "{{ads.instances}}/{{key}}/conf/config.ldif"
- source: "salt://plnx/apacheds/templates/config.ldif.jinja"
@ -80,8 +83,55 @@ ADS Instance{{key}} New Conf Dir:
partitionsuffix: "dc=planix,dc=org"
ldap_port: 12389
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 %}