Search code examples
c#.netuniverse

How to execute TCL commands of Rocket Universe through Ansible?


I wanna execute 3-4 commands of Universe(which is in Linux) by executing some program through Ansible in Windows. I was having a look at UniObjects but couldn't find it how to add it in C# console app and not sure if it is free of cost. The aim is automation as I want to execute those commands(COPY, BASIC, RUN) without any user interaction. Any help would be appreciated.


Solution

  • Provided that the user that is running the script has permissions to everything you need to do and that your shell doesn't jump straight into a menu when it starts Universe, it is easy to run UV code from the the OS shell. In the Unix/Linux world it is common practice to use this sort of strategy to execute processes from cron. You might check to see if you have examples there to maintain standards.

    In my shop we generally collect them into a single PA entry in the VOC and then PHANTOM that off when we want to run it. I don't know what STOP.PHANTOMS does (I assume that is a local thing) but here is a mock example that expects that it will not to kill the phantom we just spawned off to run this.

    >ED VOC COPY.FOOBAR
    5 lines long.
    
    ----: p
    0001: PA
    0002: STOP.PHANTOMS
    0003: COPY FROM FOO TO BAR FOOBAR OVERWRITING
    0004: BASIC BAR FOOBAR
    0005: RUN BAR FOOBAR
    

    and the shell script

    cd /path/to/account
    /path/to/uv/bin/uv <<start
    PHANTOM COPY.FOOBAR
    start
    

    You can probably do it without using PHANTOM as well, though I have not really experimented with it much.