The final module
With all of our functions in place, the final module will look like this:
''' The backend for serving files from an SFTP account. To enable, add ``sftp`` to the :conf_master:`fileserver_backend` option in the Master config file. .. code-block:: yaml fileserver_backend: - sftp Each environment is configured as a directory inside the SFTP account. The name of the directory must match the name of the environment. .. code-block:: yaml sftpfs_host: sftp.example.com sftpfs_port: 22 sftpfs_username: larry sftpfs_password: 123pass sftpfs_root: /srv/sftp/salt/ ''' import os import os.path import logging import time try: import fcntl HAS_FCNTL = True except ImportError: # fcntl is not available on windows HAS_FCNTL = False import salt.fileserver ...
Get Extending SaltStack now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.