GithubHelp home page GithubHelp logo

saltstates's Introduction

saltstates

state modules for saltstack

saltstates general usage

  • create a _states directory in your file_roots

  • place the .py file in _states

salt.states.ufw.present

(name,mode=None,direction=None,fr="any",to="any",port="any",proto=None,**kwargs)

create firewall rules using ufw command

name the identifier for the firewall rule. will be added as comment and displayed at the ufw status output

mode the mode used for ufw, can be allow or deny

direction the direction for the firewall rule. can be in or out

fr from which ip prefix allow connections

to to which ip prefix allow connections

port which port(s) to be used for the firewall rule

porto which protocol to be used, can be tcp, udp or both

example

port_443:
  ufw.present:
    - mode: allow
    - direction: in
    - fr: any
    - to: 192.168.0.13
    - proto: tcp

salt.states.ufw.absent

(name,mode,direction=None,fr="any",to="any",port="any",proto=None,**kwargs)

delete firewall rules using ufw

name the identifier for the firewall rule.

mode the mode used for ufw, can be allow or deny

direction the direction for the firewall rule. can be in or out

fr from which ip prefix allow connections

to to which ip prefix allow connections

port which port(s) to be used for the firewall rule

porto which protocol to be used, can be tcp, udp or both

example

port_443:
  ufw.absent:
    - mode: allow
    - direction: in
    - fr: any
    - to: 192.168.0.13
    - proto: tcp

salt.states.yay.installed

(name,runas=None,password=None,updateflag=None,overwrite=False, **kwargs)

install aur packages with yay

name the package to be installed with yay

runas run as user

password use password when installing the package

updateflag a file which is used to update the package. The file gets deleted after successful update

overwrite use pacman --overwrite '*' for yay

example

sensu-agent:
  yay.installed:
    - runas: yay
    - password: {{ pillar['yay_password'] }}
    - updateflag: /tmp/sensu-agent.update
    - overwrite: True

returners general usage

  • create a _returners directory in your file_roots
  • place the .py in _returners directory

returner.file

usage

schedule:
  highstate:
    function: state.highstate
    minutes: 10
    returner:
      - file
returner.file.file: /var/log/salt-state.log

saltstates's People

Contributors

thorko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.