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

Provision with Script

Scheduled Pinned Locked Moved Solved
Feature Request
4
33
5.4k
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.
  • Z
    zfeng
    last edited by Jan 9, 2020, 5:14 PM

    Hi guys. I have used Fog for a while and definitely this is a great project and saves a lot of my time on provisioning new machine.

    Does Fog have a feature that allows us to run script after it finishes provisioning, just like building AWS EC2 instance? Could that be a feature request if it does not exist?

    Thanks

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Jan 9, 2020, 6:09 PM

      I’m not sure what you mean by “after it finishes provisioning”

      FOG images machines, pure and simple.

      We have the FOG Client that can do some alternate things such as: Printer Management, Snapins - Essentially run scripts or program installations – needs to be silently, Hostname Changing, Domain Joining, Display management, Auto Logout, Power Management - where you can schedule instant or regularly run (Wake ups, Shutdowns, Reboots), User Login/Out Tracking, Task Reboots, and/or Host registration - Client will register the host for you in a pending status, awaiting for an admin to approve the registration of said host.

      However, if you mean, in terms of imaging, do we have the ability to run scripts after imaging is complete, then the answer is yes.

      We have two features, post-init (which will run special scripts you create and define) before imaging process begins, as well as post-download scripts (which will run special scripts you create and define) after the imaging process completes.

      Hopefully this helps explain things a little better on what FOG does, can do, and is limited to.

      Thank you,

      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
      • Z
        zfeng
        last edited by Jan 9, 2020, 6:12 PM

        This helps a lot. This is an amazing project

        G 1 Reply Last reply Jan 9, 2020, 7:27 PM Reply Quote 0
        • G
          george1421 Moderator @zfeng
          last edited by Jan 9, 2020, 7:27 PM

          @zfeng So to add on to the information Tom provided, the FOG post init (before imaging) and post install (after imaging) scripts are executed by the FOS Linux engine (the customized linux OS that runs on the target computer for capturing and deploying images). So the post init and post install scripts need to be written in a bash shell script. That will be run within the context of the target computer. So if you can create an AWS EC2 instance from a linux command line then you might be able to do it in a FOG script. You also have to be aware that FOS Linux is a very small and fast OS, its not a full linux distribution so not all of the programs on a full linux distro are on FOS Linux. That’s not saying they can’t be, just they might not be today.

          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!

          1 Reply Last reply Reply Quote 0
          • Z
            zfeng
            last edited by Jan 9, 2020, 7:33 PM

            Thanks so much for your info. Basically, the way I use the FOG is to provision physical computer. After the imaging process is complete, I would like to run some kind of script on the target system, such as making curl request to download something. I don’t know if that is possible with FOG @george1421

            G 1 Reply Last reply Jan 9, 2020, 7:55 PM Reply Quote 0
            • G
              george1421 Moderator @zfeng
              last edited by Jan 9, 2020, 7:55 PM

              @zfeng Yes FOG Linux has the curl command because it uses that and a few other commands to “talk” to the fog server during imaging.

              One could (in a post install script) mount the target hard drive and then use a properly crafted wget or curl call to download a file onto the target hard drive. Unmount the target hard drive then complete the FOG imaging process.

              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!

              Z 2 Replies Last reply Jan 9, 2020, 8:19 PM Reply Quote 0
              • Z
                zfeng @george1421
                last edited by Jan 9, 2020, 8:19 PM

                @george1421 I think I need to be more precise. Let’s say that the image is deployed properly. Is that a way I can run script just like you can run that on the terminal? For now, after I complete the imaging provision, I have to power up the computer and run customized script to download something and install certain package which is must be done after the imaging process.I am sorry if I did not make the point clear

                G 1 Reply Last reply Jan 9, 2020, 8:45 PM Reply Quote 0
                • Z
                  zfeng @george1421
                  last edited by Jan 9, 2020, 8:42 PM

                  @george1421 I basically want to eliminate the part that I need to run the script after the provision is done.

                  G 1 Reply Last reply Jan 9, 2020, 8:49 PM Reply Quote 0
                  • G
                    george1421 Moderator @zfeng
                    last edited by george1421 Jan 9, 2020, 2:47 PM Jan 9, 2020, 8:45 PM

                    @zfeng You can download the “something” and write it to the target hard drive, but you can not “install it” because it would install within the context of FOS Linux which runs from RAM. When the computer is rebooted fos linux is gone.

                    BUT what you can do is download something to the target computer and then create a file in /etc/init.d on the target disk (you will probably need to create the sym link in proper init folder so that it will run in the proper startup mode). Lets say you created a file call S99local and in that batch file you placed the commands to run the thing that FOS Linux downloaded and stored on the target computer. Once the script ran it would delete the /etc/init.d/S99local script so it wouldn’t run each time the system booted. That way FOS LInux could download (or copy the something from the FOG server) and when the target computer booted the first time it would run the script to install it.

                    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!

                    Z 1 Reply Last reply Jan 9, 2020, 9:13 PM Reply Quote 0
                    • G
                      george1421 Moderator @zfeng
                      last edited by Jan 9, 2020, 8:49 PM

                      @zfeng Of course that assumes you are installing linux on a target computer. If it was a windows OS on the target computer we still could do something similar you would just have to change how the script or PS was launched by updating the windows registry for run once with a FOS Linux post install script.

                      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!

                      J 1 Reply Last reply Jan 9, 2020, 9:09 PM Reply Quote 0
                      • J
                        Junkhacker Developer @george1421
                        last edited by Jan 9, 2020, 9:09 PM

                        or run the script with the fog client as a snapin

                        signature:
                        Junkhacker
                        We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                        Z 1 Reply Last reply Jan 9, 2020, 9:15 PM Reply Quote 0
                        • Z
                          zfeng @george1421
                          last edited by Jan 9, 2020, 9:13 PM

                          @george1421 Thing is getting more clear. However, I still need some help. The reason why I need run script every time after I provision the computer is because with different computer I need to download different stuff for the different computer. Let’s say that I have computerA and computerB that I need to provision. How can I possibly specify argument with script, such as, Computer=ComputerA ./script.sh on the home directory?

                          J 1 Reply Last reply Jan 9, 2020, 9:15 PM Reply Quote 0
                          • Z
                            zfeng @Junkhacker
                            last edited by Jan 9, 2020, 9:15 PM

                            @Junkhacker can I run that on the home directory after the computer finishes provisioning? Thanks for jumping in

                            J 1 Reply Last reply Jan 9, 2020, 9:16 PM Reply Quote 0
                            • J
                              Junkhacker Developer @zfeng
                              last edited by Jan 9, 2020, 9:15 PM

                              @zfeng variables such as the host name are available for use scripting within FOS. this info comes from the host’s profile that gets created when you register a host with FOG.

                              signature:
                              Junkhacker
                              We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                              Z 1 Reply Last reply Jan 9, 2020, 9:18 PM Reply Quote 0
                              • J
                                Junkhacker Developer @zfeng
                                last edited by Jan 9, 2020, 9:16 PM

                                @zfeng if you give some more info on what the script is actually doing, we might be able to help you find the best solution faster

                                signature:
                                Junkhacker
                                We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                                Z 1 Reply Last reply Jan 9, 2020, 9:21 PM Reply Quote 0
                                • Z
                                  zfeng @Junkhacker
                                  last edited by Jan 9, 2020, 9:18 PM

                                  @Junkhacker hostname is part of the script. I also need to do something else such as downloading a particular file with specific variable passed from the argument

                                  J 1 Reply Last reply Jan 9, 2020, 9:20 PM Reply Quote 0
                                  • J
                                    Junkhacker Developer @zfeng
                                    last edited by Jan 9, 2020, 9:20 PM

                                    @zfeng this is very vague

                                    signature:
                                    Junkhacker
                                    We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                                    Z 1 Reply Last reply Jan 9, 2020, 9:23 PM Reply Quote 0
                                    • Z
                                      zfeng @Junkhacker
                                      last edited by Jan 9, 2020, 9:21 PM

                                      @Junkhacker the script will install different projects from git repository. everyone of the them needs to have an argument to install specific package on the computer.

                                      For now, after I complete the provision part, I basically power up the computer and run Computer=ComputerA ./start.sh on the home directory.

                                      1 Reply Last reply Reply Quote 0
                                      • Z
                                        zfeng @Junkhacker
                                        last edited by Jan 9, 2020, 9:23 PM

                                        @Junkhacker I am sorry for not specific enough

                                        T J 2 Replies Last reply Jan 9, 2020, 9:24 PM Reply Quote 0
                                        • T
                                          Tom Elliott @zfeng
                                          last edited by Jan 9, 2020, 9:24 PM

                                          @zfeng I’m guessing the image is Linux based?

                                          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

                                          Z 1 Reply Last reply Jan 9, 2020, 9:25 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            16/33
                                            Last post

                                          159

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project