Skip to content

Commit 39ba137

Browse files
authored
Merge pull request #1 from hellofresh/add-role
Add initial role files
2 parents f4b3708 + 7774cb7 commit 39ba137

File tree

25 files changed

+395
-1
lines changed

25 files changed

+395
-1
lines changed

.yamllint

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: default
2+
3+
rules:
4+
braces:
5+
max-spaces-inside: 1
6+
level: error
7+
brackets:
8+
max-spaces-inside: 1
9+
level: error
10+
line-length: disable
11+
# NOTE(retr0h): Templates no longer fail this lint rule.
12+
# Uncomment if running old Molecule templates.
13+
# truthy: disable

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Anton Ustyuzhanin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
# ansible-sssd-ldap
1+
sssd_ldap
2+
=========
3+
4+
Install and configure sssd, nsswitch, pam and sshd to get user accounts from LDAP
5+
6+
Requirements
7+
------------
8+
9+
None
10+
11+
Role Variables
12+
--------------
13+
14+
You can override variables in your group_vars
15+
16+
- `sssd_ldap_search_base: dc=example,dc=org`
17+
- `sssd_ldap_uri: ldap://example.org`
18+
- `sssd_ldap_default_bind_dn: cn=manager,dc=example,dc=org`
19+
- `sssd_ldap_default_authtok: bind_password`
20+
- `sssd_ldap_user_ssh_public_key: sshPublicKey`
21+
22+
23+
Dependencies
24+
------------
25+
26+
None
27+
28+
Example Playbook
29+
----------------
30+
31+
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
32+
33+
- hosts: servers
34+
roles:
35+
- { role: sssd_ldap }
36+
37+
License
38+
-------
39+
40+
MIT
41+
42+
Author Information
43+
------------------
44+
45+
Anton Ustyuzhanin

defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
sssd_ldap_search_base: dc=example,dc=org
3+
sssd_ldap_uri: ldap://example.org
4+
sssd_ldap_default_bind_dn: cn=manager,dc=example,dc=org
5+
sssd_ldap_default_authtok: bind_password
6+
sssd_ldap_user_ssh_public_key: sshPublicKey

files/pam_mkhomedir

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Name: Create home directory on login
2+
Default: yes
3+
Priority: 900
4+
Session-Type: Additional
5+
Session:
6+
required pam_mkhomedir.so umask=0077 skel=/etc/skel
7+

handlers/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# handlers file for sssd_ldap
3+
- name: restart sssd
4+
service:
5+
name: sssd
6+
state: restarted
7+
8+
- name: run pam auth update
9+
shell: pam-auth-update --package
10+
11+
- name: restart sshd
12+
service:
13+
name: "{{ sssd_ldap_ssh_service }}"
14+
state: restarted

meta/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
galaxy_info:
3+
author: antonu17
4+
description: Anton Ustyuzhanin
5+
company: HelloFresh
6+
7+
license: MIT
8+
9+
min_ansible_version: 1.2
10+
11+
platforms:
12+
- name: Ubuntu
13+
versions:
14+
- xenial
15+
16+
galaxy_tags:
17+
- sssd
18+
- ldap
19+
- ssh
20+
21+
dependencies: []

molecule/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.pyc
2+
.cache
3+
.molecule
4+
pytestdebug.log
5+
__pycache__/

molecule/default/Dockerfile.j2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Molecule managed
2+
3+
FROM {{ item.image }}
4+
5+
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
6+
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \
7+
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
8+
elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \
9+
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi

molecule/default/INSTALL.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*******
2+
Install
3+
*******
4+
5+
Requirements
6+
============
7+
8+
* Docker Engine
9+
* docker-py
10+
11+
Install
12+
=======
13+
14+
.. code-block:: bash
15+
16+
$ sudo pip install docker-py

0 commit comments

Comments
 (0)