]> Frank Brehm's Git Trees - pixelpark/ldap-migration.git/commitdiff
Starting with playbook
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 15 Oct 2020 10:01:34 +0000 (12:01 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 15 Oct 2020 10:01:34 +0000 (12:01 +0200)
.gitignore [new file with mode: 0644]
install-openldap-cluster.yaml [new file with mode: 0644]
inventory/dev-ds.yaml
roles/base/tasks/main.yaml [new file with mode: 0644]
roles/base/vars/main.yaml [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..f26d1f9
--- /dev/null
@@ -0,0 +1,23 @@
+*.retry
+*.swp
+*.log
+*.pyc
+*.egg
+*-stamp
+*.bak
+*.mo
+*.old
+*.new
+vms.csv
+inventory
+inventory*.yaml
+inventory.ini
+venv*
+log/*
+tmp/*
+etc/*.ini
+*private*
+.terraform
+*.backup
+.idea
+.vscode
diff --git a/install-openldap-cluster.yaml b/install-openldap-cluster.yaml
new file mode 100644 (file)
index 0000000..01bed15
--- /dev/null
@@ -0,0 +1,8 @@
+---
+
+- name: "Installation of OpenLDAP base"
+  hosts: ldap_servers
+  roles:
+    - base
+
+
index d40b42f3e979f61cb8c2179ea91372faec56ea26..6898090dd7534f5d4323f69ecfd2e0d7f660f4d3 100644 (file)
@@ -5,19 +5,20 @@ all:
     ldap_servers:
       hosts:
         dev-ds11.pixelpark.com:
-        dev-ds12.pixelpark.com:
-        dev-ds13.pixelpark.com:
+#        dev-ds12.pixelpark.com:
+#        dev-ds13.pixelpark.com:
     providers:
       hosts:
         dev-ds11.pixelpark.com:
-        dev-ds12.pixelpark.com:
-        dev-ds13.pixelpark.com:
+#        dev-ds12.pixelpark.com:
+#        dev-ds13.pixelpark.com:
     consumers:
       hosts:
         dev-ds11.pixelpark.com:
-        dev-ds12.pixelpark.com:
-        dev-ds13.pixelpark.com:
+#        dev-ds12.pixelpark.com:
+#        dev-ds13.pixelpark.com:
   vars:
     ansible_user: root
     become: false
     lapd_suffix: 'o=isp'
+    lapd_suffix_re: 'o=isp'
diff --git a/roles/base/tasks/main.yaml b/roles/base/tasks/main.yaml
new file mode 100644 (file)
index 0000000..7112612
--- /dev/null
@@ -0,0 +1,15 @@
+---
+
+# tasks base installation of the OpenLDAP server
+
+- name: "Install OpenLDAP base package"
+  yum:
+    name:
+      - "{{ openldap_package }}"
+    state: present
+
+- name: "Detect RDN of main database"
+  shell: "grep -P -l 'olcSuffix:\\s+{{ lapd_suffix_re }}' {{ slapd_cfg_dir }}/cn=config/olcDatabase*.ldif  | xargs -i basename {} .ldif"
+  changed_when: False
+  register: main_database_rdn
+
diff --git a/roles/base/vars/main.yaml b/roles/base/vars/main.yaml
new file mode 100644 (file)
index 0000000..5bcddc3
--- /dev/null
@@ -0,0 +1,8 @@
+---
+
+openldap_config_dir: '/etc/openldap'
+openldap_schema_dir: '/etc/openldap/schema'
+openldap_package: 'symas-openldap-servers'
+openldap_service: 'openldap'
+slapd_cfg_dir: '/etc/openldap/slapd.d'
+