Uploaded image for project: 'Puppet Task Runner'
  1. Puppet Task Runner
  2. BOLT-146

Configure what interpreter/shell to use


    • Type: New Feature
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: BOLT 1.13.0
    • Component/s: CLI
    • Release Notes:
      New Feature
    • Release Notes Summary:
      Added an {{interpreters}} configuration option to set the interpreter that is used to execute a task based on file extension. This allows overriding the shebang defined in the task source code with the path to the executable on the remote system.
    • QA Risk Assessment:
      Needs Assessment


      There are a few related stories here but for now lets group them together

      • Use Bolt's Puppet environment when running proxy tasks on localhost (which is the default mode)
      • To override the shebang on a task written by someone else; specific example: use Bolt's Ruby on localhost
      • To set a shell for a task (ie csh for the junos tasks)
      • To configure interpreters for windows (ruby, puppet, powershell, python, etc)
      • To configure windows shells (cmd vs powershell)

      Implementation plan

      • Local transport defaults to using Bolt's Ruby (if present) for .rb tasks.
      • Target config accepts a map of extension name to absolute path of an executable (exact match to extension)

            rb: /usr/bin/ruby

      • Target mapping extension to path implicitly augments the winrm extension whitelist.
      • Document pattern of using different local:// targets for different executables on the same extension. Can also be overridden by updating config during a plan.

      Note: Targeting Bolt only, so PCP transport and PE changes are left for later.

      Use Bolt's inventory to define executable mappings. Options considered

      1. Set PATH and write tasks that use env
      2. Task extension to executable; enourages patterns that also work on Windows, but also kind of already works (shebang on Posix, extension handlers on Windows)
      3. Shebang pattern to executable; specifically allows matching python2 vs python3
      4. Task name to executable; lots of configuration required in practice, not good as the only solution


          Issue Links




                • Assignee:
                  cas.donoghue Cas Donoghue
                  alex Alex Dreyer
                • Votes:
                  0 Vote for this issue
                  5 Start watching this issue


                  • Created:

                    Zendesk Support