Skip to content

lfzyx/ButterSalt-saltapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ButterSalt-saltapi

Build Status

ButterSalt-saltapi is a wrapper for salt rest_cherrypy API!

Installation

pip install buttersalt-saltapi

Usage

A full-access access for linux user lfzyx need to add the following configuration items to the /etc/salt/master configuration file :

external_auth:
  pam:
    lfzyx:
        - .*
        - '@runner'
        - '@wheel'

rest_cherrypy:
  port: 8000
  disable_ssl: True

Then run systemctl restart salt-api && systemctl restart salt-master.service

Now in you project, use the following code :

from buttersalt_saltapi import saltapi

salt = saltapi.SaltApi(baseurl='SALT API address', username='SALT API username', password='SALT API password')

salt.login()