Giter Club home page Giter Club logo

salt-server-parser's Introduction

Salt Server Parser

made-with-python GitHub release Pylint CodeQL

Generate SSH config from Salt server lists

Requirements

  • Python 3.9+

How to use

It's your servers.sls file:

servers:
    lab-1001:
        main_ip: 1.2.3.4
        ...
        ...
    lab-1002:
        main_ip: 4.5.6.7
        ...
        ...
    ...
    ...

Note: Add/remove extra info from main.py file. For example IdentityFile, IdentityAgent, etc

Run:

python main.py <servers.sls> <output> <ssh port> <ssh user> <mode>

Example

python main.py /Salt/pillar/dev/servers.sls out.txt 22 arash Staging

Output

#------- Staging Servers ------#

Host lab-1001
    HostName 1.2.3.4
    Port 22
    User user
    IdentitiesOnly yes
    IdentityAgent ~/.gnupg/S.gpg-agent.ssh
    IdentityFile ~/.ssh/id_rsa_yubikey.pub

Host lab-1002
    HostName 4.5.6.7
    Port 22
    User user
    IdentitiesOnly yes
    IdentityAgent ~/.gnupg/S.gpg-agent.ssh
    IdentityFile ~/.ssh/id_rsa_yubikey.pub

Also you will have two another files:

  • A ip-list.json file containing all IPs will be generated for further use.
  • A server-list.json file containing all servers with their IP based on role, zone, provider and code. There is an other key for unknown servers. You can Change __create_list() function to fit your needs.
  • A server-list.toml file to use with WireGuard-Config-Generator

salt-server-parser's People

Contributors

hatamiarash7 avatar navfar avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

salt-server-parser's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/pylint.yml
  • actions/checkout v4@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
  • actions/setup-python v5
pip_requirements
requirements.txt
  • ruamel.yaml ==0.18.6
  • pyfiglet ==1.0.2
  • pylint ==3.1.0
  • toml ==0.10.2

  • Check this box to trigger a request for Renovate to run again on this repository

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.