mirror of
https://github.com/saltstack-formulas/nfs-formula.git
synced 2025-04-16 09:40:27 +00:00
refactor(service): split out nfs service handling into dedicated state
This commit is contained in:
parent
b3d113a49e
commit
ad8d4b89dc
2 changed files with 17 additions and 9 deletions
|
@ -1,9 +1,15 @@
|
||||||
{% from "nfs/map.jinja" import nfs with context %}
|
{% from "nfs/map.jinja" import nfs with context %}
|
||||||
|
|
||||||
|
include:
|
||||||
|
- nfs.service
|
||||||
|
|
||||||
|
|
||||||
{% if nfs.pkgs_server %}
|
{% if nfs.pkgs_server %}
|
||||||
nfs-server-deps:
|
nfs-server-deps:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs: {{ nfs.pkgs_server|json }}
|
- pkgs: {{ nfs.pkgs_server|json }}
|
||||||
|
- require_in:
|
||||||
|
- service: nfs-service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
nfs-exports-configure:
|
nfs-exports-configure:
|
||||||
|
@ -14,15 +20,6 @@ nfs-exports-configure:
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: nfs-service
|
- service: nfs-service
|
||||||
|
|
||||||
nfs-service:
|
|
||||||
service.running:
|
|
||||||
{% if nfs.service_name is string %}
|
|
||||||
- name: {{ nfs.service_name }}
|
|
||||||
{% elif nfs.service_name is iterable %}
|
|
||||||
- names: {{ nfs.service_name }}
|
|
||||||
{% endif %}
|
|
||||||
- enable: True
|
|
||||||
|
|
||||||
{% if grains.get('os') == 'FreeBSD' %}
|
{% if grains.get('os') == 'FreeBSD' %}
|
||||||
{% set mountd_flags = salt['pillar.get'](
|
{% set mountd_flags = salt['pillar.get'](
|
||||||
'nfs:server:mountd_flags', None) -%}
|
'nfs:server:mountd_flags', None) -%}
|
||||||
|
|
11
nfs/service.sls
Normal file
11
nfs/service.sls
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{% from "nfs/map.jinja" import nfs with context %}
|
||||||
|
|
||||||
|
nfs-service:
|
||||||
|
service.running:
|
||||||
|
{% if nfs.service_name is string %}
|
||||||
|
- name: {{ nfs.service_name }}
|
||||||
|
{% elif nfs.service_name is iterable %}
|
||||||
|
- names: {{ nfs.service_name }}
|
||||||
|
{% endif %}
|
||||||
|
- enable: True
|
||||||
|
|
Loading…
Add table
Reference in a new issue