mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Shortened service- to svc-
This commit is contained in:
32
roles/svc-openldap/tasks/schemas/nextcloud.yml
Normal file
32
roles/svc-openldap/tasks/schemas/nextcloud.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
- name: "pkgmgr install"
|
||||
include_role:
|
||||
name: pkgmgr-install
|
||||
vars:
|
||||
package_name: ldapsm
|
||||
|
||||
- name: Ensure custom LDAP schema snippet via ldapsm
|
||||
vars:
|
||||
schema_name: "nextcloud"
|
||||
attribute_defs:
|
||||
- "( 1.3.6.1.4.1.99999.1 NAME '{{ ldap.user.attributes.nextcloud_quota }}' DESC 'Quota for Nextcloud' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )"
|
||||
objectclass_defs:
|
||||
- "( 1.3.6.1.4.1.99999.2 NAME 'nextcloudUser' DESC 'Auxiliary class for Nextcloud attributes' AUXILIARY MAY ( {{ ldap.user.attributes.nextcloud_quota }} ) )"
|
||||
command: >
|
||||
ldapsm
|
||||
-s {{ ldap_server_uri }}
|
||||
-D '{{ ldap_bind_dn }}'
|
||||
-W '{{ ldap_bind_pw }}'
|
||||
-n {{ schema_name }}
|
||||
{% for at in attribute_defs %}
|
||||
-a "{{ at }}"
|
||||
{% endfor %}
|
||||
{% for oc in objectclass_defs %}
|
||||
-c "{{ oc }}"
|
||||
{% endfor %}
|
||||
register: ldapsm_result
|
||||
changed_when: "'Created schema entry' in ldapsm_result.stdout"
|
||||
check_mode: no
|
||||
|
||||
- name: Show ldapsm output
|
||||
debug:
|
||||
var: ldapsm_result.stdout_lines
|
40
roles/svc-openldap/tasks/schemas/openssh_lpk.yml
Normal file
40
roles/svc-openldap/tasks/schemas/openssh_lpk.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
- name: Install ldapsm
|
||||
include_role:
|
||||
name: pkgmgr-install
|
||||
vars:
|
||||
package_name: ldapsm
|
||||
|
||||
- name: Ensure OpenSSH-LPK schema via ldapsm
|
||||
vars:
|
||||
schema_name: "openssh-lpk"
|
||||
attribute_defs:
|
||||
- "( 1.3.6.1.4.1.24552.1.1 NAME '{{ ldap.user.attributes.ssh_public_key }}' DESC 'OpenSSH Public Key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )"
|
||||
- "( 1.3.6.1.4.1.24552.1.2 NAME 'sshFingerprint' DESC 'OpenSSH Public Key Fingerprint' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )"
|
||||
objectclass_defs:
|
||||
- >-
|
||||
( 1.3.6.1.4.1.24552.2.1
|
||||
NAME '{{ ldap.user.objects.auxiliary.ssh_public_key }}'
|
||||
DESC 'Auxiliary class for OpenSSH public keys'
|
||||
SUP top
|
||||
AUXILIARY
|
||||
MAY ( {{ ldap.user.attributes.ssh_public_key }} $ sshFingerprint ) )
|
||||
|
||||
command: >
|
||||
ldapsm
|
||||
-s {{ ldap_server_uri }}
|
||||
-D '{{ ldap_bind_dn }}'
|
||||
-W '{{ ldap_bind_pw }}'
|
||||
-n {{ schema_name }}
|
||||
{% for at in attribute_defs %}
|
||||
-a "{{ at }}"
|
||||
{% endfor %}
|
||||
{% for oc in objectclass_defs %}
|
||||
-c "{{ oc }}"
|
||||
{% endfor %}
|
||||
register: opensshlpk_ldapsm
|
||||
changed_when: "'Created schema entry' in opensshlpk_ldapsm.stdout"
|
||||
check_mode: no
|
||||
|
||||
- name: Show ldapsm output for openssh-lpk
|
||||
debug:
|
||||
var: opensshlpk_ldapsm.stdout_lines
|
Reference in New Issue
Block a user