CLI i.s.o. WEBUI to automate configuration

  • Hi,


    Probably a silly question but I wonder whether all configuration settings done in the web ui of openmediavault can also be done via the command line (using omv-salt etc).


    For instance:

    - Disabling “Permit root login” for the SSH service

    - Adding “ssh” group to user “JohnDoe”

    • Offizieller Beitrag

    Disabling “Permit root login” for the SSH service

    Sure but why? You could change the omv database (xml) and the run sudo omv-salt deploy run ssh. You could also issue omv-rpc commands.

    Adding “ssh” group to user “JohnDoe”

    users are Linux users and their group membership is also at the Linux level. sudo usermod -a -G ssh johndoe

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    Einmal editiert, zuletzt von ryecoaaron ()

    • Offizieller Beitrag

    What does the above command do?

    Why not run: sudo-salt deploy deploy run ssh?

    It was a typo. I meant ssh.


    I want to automate the installation and configuration of openmediavault via a shell script.

    While I love automating things, that will take a lot of time to create and maintain. Much more than it would take you to setup a new instance. The install script does a little - https://github.com/OpenMediaVa…/blob/master/install#L398

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • This doesn't work:

    sudo omv-rpc -u admin 'SSH' 'set' '{"permitrootlogin": false}' | jq


    It seems I need to specify all attributes of the object.

    {

    "enable": true,

    "port": 22,

    "passwordauthentication": true,

    "pubkeyauthentication": true,

    "permitrootlogin": false,

    "tcpforwarding": false,

    "compression": false,

    "extraoptions": ""

    }


    What if I only want tot change one attribute (i.e. permitrootlogin)?

    • Offizieller Beitrag

    What if I only want tot change one attribute (i.e. permitrootlogin)?

    Then you edit the xml yourself, run the omv-salt command, and HOPE you get it right. This is why I said it wasn't worth making this automation in my opinion.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    OMV acts like it does because it was never the intention to give power users the ability to do weird things. It's working that way that it solves its job, getting the configuration parameters from the UI or any RPC and stores them in the database. Salt is then deploying the configuration and services. OMV acts as root of origin in the system. That's the main intention of OMV. And it will stay that way.

  • OMV acts like it does because it was never the intention to give power users the ability to do weird things. It's working that way that it solves its job, getting the configuration parameters from the UI or any RPC and stores them in the database. Salt is then deploying the configuration and services. OMV acts as root of origin in the system. That's the main intention of OMV. And it will stay that way.

    I fully understand! As a rookie I wouldn't even dare to ask you to change a thing in OMV.


    I only want to change a few settings via a shell script (cli). The reason I don't want to do that in the WebUI is convenience and to make sure I don't forget to change a setting in the WebUI after installing OMV.


    I only want to know the best way to achieve this.

    • Offizieller Beitrag

    Shouldn't I use that when I want to change Linux config files that are already "controlled" and overwritten by OMV?

    Read his sentence again. He says without OMV.

    I only want to know the best way to achieve this.

    I told you already. Edit the xml (xmlstarlet works well from scripts) and then run omv-salt deploy run ssh.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Read his sentence again. He says without OMV.

    I told you already. Edit the xml (xmlstarlet works well from scripts) and then run omv-salt deploy run ssh.

    I know he said "without OMV", but I don't know what he means, hence my apparently silly question to trigger a more elaborate explanation.


    OK, I will directly edit the config.xml file.

    Thanks for the xmlstarlet tip!

  • Hello,

    I'm new to OMV (installed it on Friday 3rd February) and I'm seeing these GUI limitations, too. But I'm not new to Linux. I like automating and deploying things with Ansible. Thus, some things can't be configured with the Web GUI, for example SMB protocol or MiniDLNA sorting titles. And I didn't find a way to backup and restore my configuration. Yes, for sure, I can use plain Debian or Ubuntu and then setting it all up by myself. But things like Samba and RAID are really ugly, when I need to configure this all by hand. So, I really like OMV. (But I don't like XML or even JSON...)

    So I'm asking, is there no way to find a compromise? Maybe using some kind of community.general.xml module with Ansible?

    Best regards,

    Thomas

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!