From 48ce7ce78c7e98ba4f341ef2c19949e13bc586c0 Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Thu, 12 Oct 2023 15:37:29 +0200 Subject: [PATCH] up version --- README.md | 9 ++++++++- TODO | 1 + defaults/main.yml | 5 +++-- tasks/main.yml | 20 ++++++++++++-------- templates/pla_config.php | 4 ++-- 5 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 TODO diff --git a/README.md b/README.md index c0ebb96..a422004 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Role Name Quick and dirty playbook to install phpldapadmin +We are using leenooks' fork + Requirements ------------ @@ -13,7 +15,12 @@ Role Variables pla_baseddn pla_install_dir - default /var/www/html -pla_version - default 1.2.5 +pla_version - default 1.2.6.3 +pla_user - account to use to connect to ldap directory +pla_basedn - no default +pla_ldap_server - default {{ localhost }} +pla_bind_dn - "{{ lookup( 'keepass', '{{ group_names[0] }}/{{ inventory_hostname }})pla_dn', 'username' ) }}" +pla_bin_pwd: "{{ lookup( 'keepass', '{{ group_names[0] }}/{{ inventory_hostname }})pla_dn', 'password' ) }}" Dependencies ------------ diff --git a/TODO b/TODO new file mode 100644 index 0000000..59f47ea --- /dev/null +++ b/TODO @@ -0,0 +1 @@ +if ldap dn and password is set: create user on server first \ No newline at end of file diff --git a/defaults/main.yml b/defaults/main.yml index 0e7bdc4..91f34d9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,5 @@ --- # defaults file for phpldapadmin -pla_version: 1.2.6.2 -pla_install_dir: /var/www/html/ \ No newline at end of file +pla_version: 1.2.6.4 +pla_install_dir: /var/www/html/ +pla_ldap_server: localhost \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index de0a497..667c5b9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,15 @@ -- name: get archive +- name: get some vars + set_facts: + pla_bind_dn: "{{ lookup( 'keepass', '{{ group_names[0] }}/{{ inventory_hostname }})pla_dn', 'username' ) }}" + pla_bin_pwd: "{{ lookup( 'keepass', '{{ group_names[0] }}/{{ inventory_hostname }})pla_dn', 'password' ) }}" + tags: always + + - name: get archive get_url: - url: https://github.com/leenooks/phpLDAPadmin/archive/{{ pla_version }}.tar.gz - dest: /tmp/pla_{{pla_version }}.gz -- yum: +url: https://github.com/leenooks/phpLDAPadmin/archive/{{ pla_version }}.tar.gz +dest: /tmp/pla_{{pla_version }}.gz + +- package: name: [ php-ldap, php-xml ] state: present @@ -18,10 +25,7 @@ - template: src: pla_config.php dest: /{{ pla_install_dir }}/pla/config/config.php -- name: clean up - file: - path: /tmp/pla_{{pla_version }}.gz - state: absent + - name: deploy apache config template: src: pla_httpd.conf diff --git a/templates/pla_config.php b/templates/pla_config.php index 2423b07..a379a5f 100644 --- a/templates/pla_config.php +++ b/templates/pla_config.php @@ -283,14 +283,14 @@ $servers->newServer('ldap_pla'); /* A convenient name that will appear in the tree viewer and throughout phpLDAPadmin to identify this LDAP server to users. */ -$servers->setValue('server','name','localhost'); +$servers->setValue('server','name','{{ pla_ldap_server }}'); /* Examples: 'ldap.example.com', 'ldaps://ldap.example.com/', 'ldapi://%2fusr%local%2fvar%2frun%2fldapi' (Unix socket at /usr/local/var/run/ldap) */ -$servers->setValue('server','host','127.0.0.1'); +$servers->setValue('server','host','{{ pla_ldap_server }}'); /* The port your LDAP server listens on (no quotes). 389 is standard. */ // $servers->setValue('server','port',389);