Can start ads now and initialize admin password
This commit is contained in:
parent
e03c2b623e
commit
80df959c51
|
@ -6,6 +6,8 @@
|
||||||
include:
|
include:
|
||||||
- plnx.java
|
- plnx.java
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Apache Directory Server:
|
Apache Directory Server:
|
||||||
archive.extracted:
|
archive.extracted:
|
||||||
- name: {{ads.opt_dir}}
|
- name: {{ads.opt_dir}}
|
||||||
|
@ -61,6 +63,8 @@ ADS Instance{{key}} Log Props:
|
||||||
log_file: "/tmp/{{key}}.log"
|
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
|
# 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
|
||||||
|
|
||||||
|
@ -69,8 +73,7 @@ ADS Instance{{key}} Log Props:
|
||||||
"objectclass: domain\nobjectclass: top\n\n"
|
"objectclass: domain\nobjectclass: top\n\n"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
{%- if not salt['file.file_exists' ](ads.instances +"/" + key + "/conf/config.ldif_migrated") %}
|
ADS_Instance{{key}}:
|
||||||
ADS Instance{{key}} New Conf Dir:
|
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: "{{ads.instances}}/{{key}}/conf/config.ldif"
|
- name: "{{ads.instances}}/{{key}}/conf/config.ldif"
|
||||||
- source: "salt://plnx/apacheds/templates/config.ldif.jinja"
|
- source: "salt://plnx/apacheds/templates/config.ldif.jinja"
|
||||||
|
@ -80,8 +83,55 @@ ADS Instance{{key}} New Conf Dir:
|
||||||
partitionsuffix: "dc=planix,dc=org"
|
partitionsuffix: "dc=planix,dc=org"
|
||||||
ldap_port: 12389
|
ldap_port: 12389
|
||||||
ads_contextentry: "{{ads_contextentry | base64_encode }}"
|
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 %}
|
{%- endif %}
|
||||||
|
|
||||||
|
ADS_Start{{key}}:
|
||||||
|
cmd.run:
|
||||||
|
- name: "/opt/ads/bin/apacheds.sh {{key}} start && sleep 30"
|
||||||
|
- require:
|
||||||
|
- ADS_Instance{{key}}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue