ansible filters ldif
1.0.0
LDIF를 읽거나 쓰는 ansible 필터.
이 ansible 필터를 설치하십시오.
pip 를 통해 :PIP 설치 Ansible-Filters-Ldif
ansible-galaxy 를 통해 :Ansible-galaxy 설치 'git+https : //github.com/atterdag/ansible-filters-ldif.git'
Ansible 필터는 항상 로컬 호스트에서 실행됩니다.
사전을 LDIF로 변환하십시오
---
- name : Create dictionary with entries
set_fact :
dictionary :
- - dc=example,dc=com
- dc :
- example
description :
- This is a line longer than 79 characters, so LDIF breaks it up over multiple lines
o :
- example.com
objectClass :
- dcObject
- organization
- - ou=people,dc=example,dc=com
- objectClass :
- organizationalUnit
ou :
- people
- - cn=Jane Doe,ou=people,dc=example,dc=com
- cn :
- Jane Doe
mail :
- [email protected]
objectClass :
- inetOrgPerson
sn :
- Doe
- - cn=John Doe,ou=people,dc=example,dc=com
- cn :
- John Doe
mail :
- [email protected]
objectClass :
- inetOrgPerson
sn :
- Doe
- - ou=groups,dc=example,dc=com
- objectClass :
- organizationalUnit
ou :
- groups
- - cn=users,ou=groups,dc=example,dc=com
- cn :
- users
member :
- cn=Jane Doe,ou=people,dc=example,dc=com
- cn=John Doe,ou=people,dc=example,dc=com
objectClass :
- groupOfNames
- name : " Convert dictionary to LDIF while writing it to /tmp/test.ldif using 'to_ldif' filter "
copy :
content : " {{ dictionary | to_ldif }} "
dest : " /tmp/test.ldif "LDIF를 JSON으로 변환하십시오
---
- name : " Create multi-line string variable with LDIF data "
set_fact :
ldif : |
dn: dc=example,dc=com
dc: example
description: This is one line which is longer than
79 characters, so LDIF breaks it up over multiple lines
objectClass: dcObject
objectClass: organization
o: example.com
dn: ou=people,dc=example,dc=com
objectClass: organizationalUnit
ou: people
dn: cn=Jane Doe,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
cn: Jane Doe
sn: Doe
mail: [email protected]
dn: cn=John Doe,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
cn: John Doe
sn: Doe
mail: [email protected]
dn: ou=groups,dc=example,dc=com
objectClass: organizationalUnit
ou: groups
dn: cn=users,ou=groups,dc=example,dc=com
objectClass: groupOfNames
cn: users
member: cn=Jane Doe,ou=people,dc=example,dc=com
member: cn=John Doe,ou=people,dc=example,dc=com
- name : " Convert string to JSON while writing it to /tmp/test.json using 'from_ldif' filter "
copy :
content : " {{ (ldif | from_ldif) | to_nice_json }} "
dest : " /tmp/test.json " 다음 OS 개발 패키지를 먼저 설치하십시오.
sudo apt-get 설치 libssl-dev libldap2-dev libsasl2-dev python2-dev python3-dev mkvirtualenv--python =/usr/bin/python3 python3-development PIP 설치 -Requirement 요구 사항 .txt 보석을 설치하십시오. Travis Fry
GPLV3.