Basic server and client states

This commit is contained in:
Jimmy Tang 2015-01-27 13:19:15 +00:00
parent 1d7b83bf55
commit 415bd0c5ff
4 changed files with 42 additions and 0 deletions

View file

@ -1,2 +1,18 @@
nfs-formula nfs-formula
=========== ===========
Available states
================
.. contents::
:local:
``nfs.server``
---------------
Install nfs server components
``nfs.client``
---------------
Install nfs client components

5
nfs/client.sls Normal file
View file

@ -0,0 +1,5 @@
{% from "nfs/map.jinja" import nfs with context %}
nfs-client-deps:
pkg.installed:
- pkgs: {{ nfs.pkgs_client|json }}

16
nfs/map.jinja Normal file
View file

@ -0,0 +1,16 @@
{% set map = {
'Ubuntu': {
'pkgs_server': ['nfs-common', 'nfs-kernel-server'],
'pkgs_client': ['nfs-common']
},
'Debian': {
'pkgs_server': ['nfs-common', 'nfs-kernel-server'],
'pkgs_client': ['nfs-common']
}
} %}
{% if grains.get('saltversion', '').startswith('0.17') %}
{% set nfs = salt['grains.filter_by'](map, merge=salt['pillar.get']('nfs:lookup'), base='default') %}
{% else %}
{% set nfs = map.get(grains.os) %}
{% endif %}

5
nfs/server.sls Normal file
View file

@ -0,0 +1,5 @@
{% from "nfs/map.jinja" import nfs with context %}
nfs-server-deps:
pkg.installed:
- pkgs: {{ nfs.pkgs_server|json }}