Skip to content
This repository was archived by the owner on Mar 12, 2019. It is now read-only.
This repository was archived by the owner on Mar 12, 2019. It is now read-only.

Please add variable substitution #45

@wesparish

Description

@wesparish

It would be nice for Spiceweasel to have the ability to dynamically replace variables at runtime.

For example, it would be nice to be able to set a Spiceweasel variable "password" to "mysecret123" and use a replacement string throughout the rest of the manifest file. Furthermore, it would also be nice to have the ability to not only define key/value pairs for variables, but also to define key/special_value variables that allow prompting the user at runtime (eg: prompting for a sensitive password that cannot be stored in plaintext).

As a possible path to take (assuming 2 special strings, prompt_for_password (no echo) and prompt_for_text (echo)):

variables:
- root_password:
    value: "prompt_for_password"
- admin_user_name:
    value: "prompt_for_text"
- mray_pem_file:
    value: "~/.ssh/mray.pem"

nodes:
- serverA:
    run_list: role[base]
    options: -i <%= variables[:mray_pem_file] %> -x <%= variables[:admin_user_name] %> --sudo -P <%= variables[:root_password] %>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions