• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Snapin to Host assign

Scheduled Pinned Locked Moved
Feature Request
3
5
701
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    mousepl
    last edited by Mar 1, 2020, 5:23 PM

    Hello,

    It would be good to have possibility to assign Basic Task from Snapin to Host or group.
    For now we can assign Snapin only from Host view or Group view.

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Mar 1, 2020, 6:41 PM

      Snapins can be assigned to a host from the snapin page. Tasks are handled at the host level as you task hosts. Tasking a snapin makes no sense. How do you select which hosts to send that snapin too? That would add too much complexity. Does that make sense?

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • M
        mousepl
        last edited by Mar 1, 2020, 6:52 PM

        Maybe i was not clear. Point is to “run” snapin from Snapin page. simply select Snapin and deploy it on particulat Hosts/groups.
        It makes sense, it is working like this in Zenworks for example. If you can run (not assign because assigning is doing nothing) Snapin from host level why not to do it from Snapin level?

        Here is example:
        to execute snapin on 12 hosts i need to go Host by Host and run Snapin which takes time OR i can create group, ad d12 Hosts to it and run Snapin, go to Groups GUI, run Snapin and after that remove group (because i want to run it once so group is no longer needed).

        It would be easier to go to Snapin, select particular Hosts (or groups) and run it from this level.

        J 1 Reply Last reply Mar 2, 2020, 8:04 PM Reply Quote 1
        • J
          JJ Fullmer Testers @mousepl
          last edited by JJ Fullmer Mar 2, 2020, 2:11 PM Mar 2, 2020, 8:04 PM

          @mousepl Are you thinking you would want to be able to do this on the fly, or would you want to deploy the snapin on all hosts that have it assigned to it?
          By on the fly I mean, select specific hosts from the snapin then deploy, that would be a bit more difficult to implement, but maybe adding a button for deploying on all hosts with a snapin is possible.

          If you’re familar with powershell or willing to learn. You could create a function/script that does this with the api module.

          i.e.

          # install the module
          Install-Module FogApi;
          # Follow the setup instructions found in the links in my signature. i.e. get the fogapi token and user api token from your web gui
          Set-FogServerSettings -fogServer 'serverName' -fogapitoken 'insertServerAPItokenHere' -fogusertoken 'insertFogUserAPItokenHere'
          

          Assuming those steps are done for the user running the function

          function Start-SnapinDeploy {
          [CmdletBinding()]
          param(
              #define the snapin name you want to deploy
              $snapinName
          )
          #get all the snapins from the server
          $allSnapins = Get-FogSnapins;
          #get all the host/snapin associations from the server
          $snapAssocs = Get-FogObject -type object -coreObject snapinassociation;
          #get the snapin you want to deploye in a single object
          $snapinToDeploy = $allSnapins | Where-Object name -match $snapinName;
          #find all the hosts that have that snapin associated
          $hostsWithSnapin = $snapAssocs.snapinassociations | Where-Object snapinID -match "$($snapinToDeploy.ID)"
          #loop through the hosts that have that snapin assigned and start a task for that snapin for each of them
          $hostsWithSnapin.hostID | ForEach-Object {
              $hostID = $_;
              $json = (@{
                  "taskTypeID" = 13
                  "deploySnapins"=$snapinToDeploy.ID
              } | ConvertTo-Json);
              New-FogObject -type objecttasktype -coreTaskObject host -jsonData $json -IDofObject $hostID;
              }
          }
          # call the function to deploy a snapin named office365
          Start-SnapinDeploy -snapinName 'office365'
          

          I may be off on the json creation as I haven’t tested a single snapin deploy, so the required body data might be different. I just kinda altered the way I use the start-fogsnapins function https://github.com/FOGProject/fog-community-scripts/blob/master/PowershellModules/FogApi/FogApi/Public/Start-FogSnapins.ps1 for this example. I typically only use fog snapins for the initial deployment at imaging.

          But as you can see from the example, while things are linked together, the linkage is really meant to go from host to snapin. Snapins are really meant to be deployed at imaging time, which is why they are all queued when you a image a host. The idea being to include software provisioning with your OS images. The feature request you described would be useful I agree, but one might argue that that makes more sense for a software deployment tool, where fog is an imaging tool.

          It can be used as a software deployment tool, but that’s just not how it’s designed.

          That’s all really just a disclaimer to say it may be a bit for this to show up as a new feature. It’s possible and it would be useful. I’m all for anything linked in a database having linked buttons in each spot in a gui. But creating that button may just be easier said than done, but may eventually be done.

          You could in theory create a gui using the powershell module and built in powershell command show-command and some dynamic paramters that grab all the available snapins, it would take a bit of work but you could make a gui prompt with drop downs/multi-selector for fog host(s), snapins, then a deploy button. Point being, just because it isn’t in the web gui, doesn’t mean the capability doesn’t already exist.

          I hope that helps

          Have you tried the FogApi powershell module? It's pretty cool IMHO
          https://github.com/darksidemilk/FogApi
          https://fogapi.readthedocs.io/en/latest/
          https://www.powershellgallery.com/packages/FogApi
          https://forums.fogproject.org/topic/12026/powershell-api-module

          J 1 Reply Last reply Mar 2, 2020, 8:14 PM Reply Quote 1
          • J
            JJ Fullmer Testers @JJ Fullmer
            last edited by Mar 2, 2020, 8:14 PM

            I copy pasted the function into my console and tested it with a snapin that was assigned to just my computer and it did in fact queue it to deploy.

            This could be altered to quickly deploy to a given list of hosts or groups as well. Giving you a quick command line method for deploying snapins to hosts in a variety of ways.

            If this is something that would achieve what you’re going for let me know and maybe I can add in the functions to the api module so they just exist and then you have a deployment tool via command line, which is typically quicker in my humble opinion

            Have you tried the FogApi powershell module? It's pretty cool IMHO
            https://github.com/darksidemilk/FogApi
            https://fogapi.readthedocs.io/en/latest/
            https://www.powershellgallery.com/packages/FogApi
            https://forums.fogproject.org/topic/12026/powershell-api-module

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              5/5
              Last post

            207

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project