[Python] SaltStack custom state: How to download file from "salt:" URI

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to write a custom SaltStack state. It will be used like this:

    Example of my.state usage:
    my.state:
    - name: /some/path
    - source: salt://path/to/dsl/file


    This state is planned to grab a file from the Salt Master file server, transfer it to the minion, then execute the file using a program in the minion, analyze the output, delete the downloaded file, and return a proper state dict based on success/failure of the program that executes the DSL file.

    My question:

    • How to write the custom state so it's able to download from salt:// URI ?

    Note: I do not envision the need to download the file from anywhere else but the Salt Master.

    Continue reading...

Compartilhe esta Página