Class Simp::Cli::Commands::Bootstrap
In: lib/simp/cli/commands/bootstrap.rb
Parent: Simp::Cli

Methods

Public Class methods

Check for bootstrap start lock

Configure an initial, bootstrap puppetserver service listening on 8150

  • Many of our modules depend on server_facts, which require a running puppetserver. Otherwise, puppet applys would suffice.
  • The port against which we do firstrun, 8150, is arbitrary. The first puppet run is a tagged run with pupmod and simp, which will re-configure puppetserver/puppetdb with the operational configuration parameters generated by simp config.

Debug logs only go to the console when verbose option specified, but always go to the log file (which is expected to contain details)

Clean up the leftover, bootstrap puppetserver process (if any)

Ensure puppet agent is stopped and disabled

Ensure any remaining puppet processes are stopped

Ensure the puppetserver is running ca on the specified port. Used ensure the puppetserver service is running.

If selinux is enabled, relabel the filesystem.

Remove or retain existing puppet certs per user direction

Set us up to use the SIMP environment, if this has not already been done. (1) Be careful to preserve the existing primary, ‘production’ environment,

    if one exists.

(2) Create links to production in both the primary and secondary environment

    paths.

fail if puppet environments directory does not exist, primary simp environment does not exist, or secondary simp environment does not exist

Display an ASCII, spinning progress spinner for the action in a block and return the result of that block Example,

   result = show_wait_spinner {
     system('createrepo -q -p --update .')
   }

Lifted from stackoverflow.com/questions/10262235/printing-an-ascii-spinning-cursor-in-the-console

FIXME: This is a duplicate of code in simp/cli/config/items/item.rb. Need to share that code.

Track a running process by following its STDOUT output Prints a ’#’ for each line of output returns -1 if error occured, otherwise the line count if PTY.spawn succeeded

[Validate]