Created
February 23, 2021 02:58
-
-
Save aphor/977facc24057622cbec7dbd481a7cec7 to your computer and use it in GitHub Desktop.
salt_cloud_map_run.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import salt | |
import sys | |
if __name__ == '__main__': | |
MINION_NAME = 'salt-cloud' | |
HOSTNAME = sys.env['hostname'] | |
FOLDER = sys.env['folder'] | |
IP = sys.env['ip'] | |
CLOUDMAP = {"PROFILE":[{HOSTNAME:{"folder":FOLDER,"devices":{"network":{"Network adapter 1":{"ip":IP}}}}}]} | |
client = salt.client.LocalClient() | |
jid = client.cmd_async(MINION_NAME, 'cloud.map_run', map_data=CLOUDMAP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment