Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-428

pdk module convert CLI



    • Type: New Feature
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.3.0
    • Component/s: None
    • Labels:
    • Template:
    • QA Risk Assessment:
      Needs Assessment


      As a module author, I want to be able to run a simple command to make my existing module compatible with the PDK.

      As a module author, I want to be able to run a simple command to detect and apply any updates to my module from the module template used to generate it

      As David Schmitt wrote in PDK-378, we need to have a way for module authors to both make their module compatible with the PDK and to keep their module up to date with the module template.

      To make an existing compatible with PDK:

      pdk module convert [--yes|-y] [--template-url=<template URL>]

      To update the template of a PDK compatible module:

      pdk module update [--yes|-y] [--template-url=<template URL>]

      1. Determine the appropriate module template to use. If there is no PDK template information in metadata.json (i.e. bringing an existing module into PDK management), use the same logic as `pdk new module` to select the module template (CLI specified -> answer file -> default). If there is PDK template information in metadata.json, use that.
      2. Reuse the existing template dir and template file logic that is used in `pdk new module` to render the new files into the module, but with a `.pdknew` (or similar) extension rather than overwriting
      3. Checksum the contents of the `.pdknew` and existing files to eliminate files that have not changed
      4. Display a diff of the changed files to the user (eventually, we could delegate this to the user's VCS of choice, but until we have VCS integration something like https://github.com/halostatue/diff-lcs should work cross-platform)
      5. Unless the user provide the `--yes` flag, ask for confirmation before proceeding
      6. If the user agrees to proceed, rename the `.pdknew` files to remove the extension to apply the updates. If the user does not want to proceed, remove the `.pdknew` files.


          Issue Links



              tim.sharpe Tim Sharpe
              UX Contact:
              Rick Monro
              7 Vote for this issue
              15 Start watching this issue



                  Zendesk Support