Coder Social home page Coder Social logo

Improve Servers about sake HOT 6 CLOSED

alajmo avatar alajmo commented on July 19, 2024
Improve Servers

from sake.

Comments (6)

alajmo avatar alajmo commented on July 19, 2024 1

I think the regex filtering of servers task would be a good start (code paths for similar functionality exist, see tags/servers).

Some notes:

  • Set via flag or config, I'm thinking the name --match could be used
  • Target server hosts (so it's not regex for the server names, but for the server hosts)
  • Write some unit tests

from sake.

josegonzalez avatar josegonzalez commented on July 19, 2024 1

I think I would pair this with another tool, like a python script, that generates the servers to connect to. But I would like to modify what that python tool generates (maybe select a different region or env) based on some runtime arguments that sake would pass to the script. Not sure what the interface might look like.

from sake.

alajmo avatar alajmo commented on July 19, 2024 1

All features are released with v0.12.0 now. @josegonzalez you can now run the following:

    servers:
        inv:
            inventory: ./some-python-script $somearg
            env:
              somearg: 192.168.1.2 
# use default somearg 192.168.1.2
sake run <task> -s inv

# Pass CLI argument
sake run <task> -s inv somearg=192.168.1.99

from sake.

alesauce avatar alesauce commented on July 19, 2024

Hello! I’d like to contribute to this project, but I don’t want to duplicate anything that you’re actively working on. Is there anything on this issue that I can pick up, or should I find another one?

from sake.

josegonzalez avatar josegonzalez commented on July 19, 2024

Would be great to be able to pass arguments to whatever gets inventory. Something like:

    # sake run -s server-1 -inventory-args "--expanded-args here"
    servers:
      # One of the following:
      # host: 192.168.1.1
      # hosts: www[01:50].example.com # look at https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#adding-ranges-of-hosts
      # hosts:
      # - 192.168.1.1
      # - 192.168.1.2
      inventory: some-command

So the inventory command would be:

some-command --expanded-args here

from sake.

alajmo avatar alajmo commented on July 19, 2024

Not sure I follow, do you mean something like this:

    servers:
        name: server-1
            inventory: echo $SOME_ENV
$ sake run ping -s server-1 SOME_ENV="192.168.1.1,192.168.1.2"

which would run task ping on servers:

  • 192.168.1.1
  • 192.168.1.2

from sake.

Related Issues (20)

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.