mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
update the state template
This commit is contained in:
parent
9ccb9cc3a0
commit
b43e087d56
1 changed files with 64 additions and 0 deletions
|
@ -0,0 +1,64 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
{{cookiecutter.project_name}} state module
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
{{cookiecutter.project_short_description}}
|
||||
|
||||
.. versionadded:: {{cookiecutter.version}}
|
||||
|
||||
:configuration:
|
||||
|
||||
.. code-block:: yaml
|
||||
<your example config>
|
||||
|
||||
'''
|
||||
# keep lint from choking on _get_conn and _cache_id
|
||||
#pylint: disable=E0602
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import Python libs
|
||||
import logging
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.compat
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# Import third party libs
|
||||
HAS_LIBS = False
|
||||
try:
|
||||
# Import libs...
|
||||
|
||||
HAS_LIBS = True
|
||||
except ImportError as ie:
|
||||
missing_package = ie.message
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__virtualname__ = '{{cookiecutter.project_name}}'
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load this module if dependencies is installed on this minion.
|
||||
'''
|
||||
if HAS_LIBS:
|
||||
return __virtualname__
|
||||
return (False, 'The {{cookiecutter.project_name}} execution module failed to load:'
|
||||
'import error - {0}.'.format(missing_package))
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
# Put logic here to instantiate underlying jobs/connections
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def present(name):
|
||||
ret = {'name': name,
|
||||
'changes': {},
|
||||
'result': False,
|
||||
'comment': ''}
|
||||
# Compare values
|
||||
return ret
|
Loading…
Add table
Reference in a new issue