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

    How to pass host-specific settings into host after deploying image

    Scheduled Pinned Locked Moved
    General
    2
    5
    461
    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.
    • J
      joseheitor
      last edited by

      Hi,

      I would like to pass a text file with host specific settings (like hostname, etc.) to a Linux host, so that on first startup after imaging, the host can perform some specific customization tasks.

      I am guessing that ‘postdownloadscripts’ are the appropriate mechanism…? How do I target a specific file with specific settings to a specific host?

      A simple end-to-end working example would be greatly appreciated!

      Thanks,
      Jose

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @joseheitor
        last edited by

        @joseheitor The short answer is you are correct a post install script is what you need. We don’t have a tutorial on this for a linux target computer, but we do for a windows target computer. The concepts are the same between the two platforms. I have to admit it a bit easier for linux since the FOG deployment engine is based on linux already.

        This tutorial gives you the framework you need: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

        The fog.custominstall script checks to see if its a windows platform by the $osid variable then loops through the disk partitions looking for the fs type of ntfs, if found it tries to detect the windows folder. If you know the partition number already you can just do the direct mount of the directory onto the mount directory you create. From there is just piping the variables you need into a text file on the target computer.

        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 Reply Quote 0
        • J
          joseheitor @george1421
          last edited by

          @george1421 - Thanks.

          Is there a way to initially just start an interactive shell, so that I can test all the individual commands that will eventually make up the unattended script?

          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @joseheitor
            last edited by

            @joseheitor Yes the easiest way is to schedule a debug deployment. Before you hit the schedule task button, tick the debug checkbox. PXE boot the target computer, after a few screens of text you need to clear with the enter key you will be dropped to the FOS Linux command shell. Kye in fog to start the deployment process in single step mode.

            What I would do first is edit the fog.powerdownload script and put an echo statement like “script is running” then enter a debugPause after. When you see the script is running text and the pause afterwards you can hit a ctrl-c to drop out to a command shell. Your context will be as the script is running so you will have access to the fog variables. you can see them using the set | more command.

            Once you have your post deployment script figured out you can restart the deployment process by just rerunning the fog command. You don’t need to reboot the target computer as long as you don’t let the script run past the post install script spot.

            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 Reply Quote 1
            • J
              joseheitor @george1421
              last edited by

              @george1421 Fantastic! Many thanks.

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

              148

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project