Skip to content

Commit

Permalink
Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
fintanmm committed Sep 30, 2015
1 parent 6737fc8 commit 3d086d8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
================
template-formula
pam-formula
================

A saltstack formula that is empty. It has dummy content to help with a quick
start on a new formula.
Formula to set up and configuring pam authentication modules.

.. note::

Expand All @@ -16,7 +15,7 @@ Available states
.. contents::
:local:

``template``
``pam.ldap``
------------

Installs the template package, and starts the associated template service.
Configure ldap authentication.
54 changes: 54 additions & 0 deletions pam/ldap.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% from "pam-ldap/map.jinja" import pam with context %}
tls_cacertfile:
file.managed:
- source: salt://pam-ldap/files/cert
- user: root
- group: root
- mode: 640
ldap:
pkg:
- installed
- name: {{ pam.ldap }}
{{ pam.config }}:
file.managed:
- source: salt://pam-ldap/files/ldap.conf
- user: root
- group: root
- mode: 644
ldap_conf:
file.append:
- name: {{ pam.ldap-config }}
- text:
- host {{ salt['pillar.get']('pam:ldap:host') }}
{% if salt['pillar.get']('pam:ldap:port') %}
- port {{ salt['pillar.get']('pam:ldap:port') }}
{% endif %}
- base {{ salt['pillar.get']('pam:ldap:base') }}
- ldap_version {{ salt['pillar.get']('pam:ldap:version', 3) }}
- bind_policy {{ salt['pillar.get']('pam:ldap:policy') }}
{% if salt['pillar.get']('pam:ldap:binddn') %}
- binddn {{ salt['pillar.get']('pam:ldap:binddn', '') }}
- bindpw {{ salt['pillar.get']('pam:ldap:bindpw', '') }}
{% endif %}
- scope {{ salt['pillar.get']('pam:ldap:scope', 'sub') }}
- pam_lookup_policy {{ salt['pillar.get']('pam:ldap:pam_lookup_policy', 'yes') }}
- pam_groupdn {{ salt['pillar.get']('pam:ldap:pam_groupdn') }}
- pam_member_attribute {{ salt['pillar.get']('pam:ldap:pam_member_attribute', 'member') }}
- pam_password {{ salt['pillar.get']('pam:ldap:pam_password') }}
{% if salt['pillar.get']('pam:ldap:ssl') %}
- ssl {{ salt['pillar.get']('pam:ldap:ssl') }}
{% endif %}
{% if salt['pillar.get']('pam:ldap:tls_checkpeer') == 'yes' %}
- tls_checkpeer {{ salt['pillar.get']('pam:ldap:tls_checkpeer', 'no') }}
- tls_cacertfile {{ salt['pillar.get']('pam:ldap:tls_cacertfile', '') }}
- tls_cacertdir {{ salt['pillar.get']('pam:ldap:tls_cacertdir', '') }}
{% endif %}
/etc/pam.d/common-session:
file.append:
- text:
- session required pam_mkhomedir.so skel=/etc/skel umask=0022

0 comments on commit 3d086d8

Please sign in to comment.