Compare commits

..

5 Commits

Author SHA1 Message Date
f05fb7ce98 cosmetic change and working example in readme 2025-09-25 09:06:30 +02:00
75682268b7 add var to set owner of pla install dir 2025-09-24 08:59:37 +02:00
4abc5aa161 up version
remove unused variables
2025-09-24 08:12:25 +02:00
01ec188479 remove unused variable 2025-09-23 14:53:06 +02:00
a254d2cb94 up version 2025-05-14 07:49:16 +02:00
4 changed files with 49 additions and 35 deletions

View File

@@ -13,14 +13,11 @@ Apache +php needed
Role Variables
--------------
pla_baseddn
pla_install_dir - default /var/www/html
pla_version - default 1.2.6.3
pla_user - account to use to connect to ldap directory
pla_basedn - no default
pla_install_dir - default /var/www/html
pla_version - default 1.2.6.7
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' ) }}"
pla_install_dir_owner - default pla, should probably be "{{ php_fpm_pool_user }}"
Dependencies
------------
@@ -34,7 +31,17 @@ Including an example of how to use your role (for instance, with variables passe
- hosts: servers
roles:
- { role: phpldapadmin, basedn: dc=ldx }
- role: tco.php-fpm
¦tags: pla,wips
¦vars:
¦ php_packages:
¦ ¦ - php8.1-ldap
¦ ¦ - php8.1-xml
¦ php_version: "8.1"
¦ php_fpm_create_pool: true
¦ php_fpm_pool_user: selfservicepassword
¦ php_fpm_listen_socket: /srv/pla/socket
- { role: phpldapadmin, basedn: dc=ldx }
License
-------

View File

@@ -1,5 +1,6 @@
---
# defaults file for phpldapadmin
pla_version: 1.2.6.4
pla_version: 1.2.6.7
pla_install_dir: /var/www/html/
pla_install_dir_owner: pla
pla_ldap_server: localhost

View File

@@ -1,34 +1,40 @@
- 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: "[pla] - get archive"
ansible.builtin.get_url:
url: https://github.com/leenooks/phpLDAPadmin/archive/{{ pla_version }}.tar.gz
dest: /tmp/pla_{{pla_version }}.gz
- name: get archive
get_url:
url: https://github.com/leenooks/phpLDAPadmin/archive/{{ pla_version }}.tar.gz
dest: /tmp/pla_{{pla_version }}.gz
- name: "[pla] - create base dir"
ansible.builtin.file:
path: "{{ pla_install_dir }}"
state: directory
- package:
name: [ php-ldap, php-xml ]
state: present
- unarchive:
dest: /{{ pla_install_dir }}
- name: "[pla] - extract archive"
ansible.builtin.unarchive:
dest: "{{ pla_install_dir }}"
src: /tmp/pla_{{pla_version }}.gz
remote_src: true
- file:
src: /{{ pla_install_dir }}/phpLDAPadmin-{{ pla_version }}
owner: "{{ pla_install_dir_owner }}"
- name: "[pla] - link"
ansible.builtin.file:
src: "{{ pla_install_dir }}/phpLDAPadmin-{{ pla_version }}"
state: link
dest: /{{ pla_install_dir }}/pla
dest: "{{ pla_install_dir }}/pla"
owner: "{{ pla_install_dir_owner }}"
- template:
- name: "[pla] - fixownership"
tags: chown
ansible.builtin.file:
path: "{{ pla_install_dir }}/phpLDAPadmin-{{ pla_version }}"
recurse: true
state: directory
owner: "{{ pla_install_dir_owner }}"
- name: "[pla] - configure"
vars:
bigrandomstring: "{{ lookup('password', '/dev/null chars=ascii_letters,digit length=128', seed=inventory_hostname) | lower }}"
ansible.builtin.template:
src: pla_config.php
dest: /{{ pla_install_dir }}/pla/config/config.php
- name: deploy apache config
template:
src: pla_httpd.conf
dest: /etc/httpd/conf.d/pla.conf
notify: reload_apache
dest: "{{ pla_install_dir }}/pla/config/config.php"
owner: "{{ pla_install_dir_owner }}"

View File

@@ -47,7 +47,7 @@
/* phpLDAPadmin can encrypt the content of sensitive cookies if you set this
to a big random string. */
$config->custom->session['blowfish'] = imaljdmlkaedmlkezjfmljzaemflezafmlkzhfelmhzafezenull;
$config->custom->session['blowfish'] = '{{ bigrandomstring }}' ;
/* If your auth_type is http, you can override your HTTP Authentication Realm. */
// $config->custom->session['http_realm'] = sprintf('%s %s',app_name(),'login');