puppet-masterless 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -6
- data/bin/puppet-masterless +125 -88
- data/man/puppet-masterless.1 +117 -88
- metadata +16 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c92e1a6b43a5b98773af8b769d752ec38ab36b6703df0fcb3f5021729b9dbd38
         | 
| 4 | 
            +
              data.tar.gz: ec90a19bb036bd8166a54cdfba7137370560d313e54748926e92c3408125432f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 371ad6220621c70420885ea853a6cc541489b31257faee85f38d02cab607d6f748c561b0f920232027dc60fde345346f8fad80c5986a6517f2c6eb16a061b58d
         | 
| 7 | 
            +
              data.tar.gz: 752186acfd8d467161ed42845036b14d22bf54690e31d9fa48939783025fdbacdf76738a78a8271224c3aa4893b056776df070cb34cfc8e966477daf86bd772d
         | 
    
        data/README.md
    CHANGED
    
    | @@ -30,8 +30,8 @@ the man page. | |
| 30 30 | 
             
                install -m 755 src/puppet-masterless /usr/local/bin/puppet-masterless
         | 
| 31 31 | 
             
                install -m 644 man/puppet-masterless.1 /usr/local/share/man/man1/puppet-masterless.1
         | 
| 32 32 |  | 
| 33 | 
            -
            You can also bundle the man page with the executable and install  | 
| 34 | 
            -
             | 
| 33 | 
            +
            You can also bundle the man page with the executable and install both as
         | 
| 34 | 
            +
            a single file:
         | 
| 35 35 |  | 
| 36 36 | 
             
                rake build:prepare
         | 
| 37 37 | 
             
                install -m 755 bin/puppet-masterless /usr/local/bin/puppet-masterless
         | 
| @@ -61,8 +61,8 @@ about how this directory should be organised. | |
| 61 61 | 
             
            The program accepts arguments according to a very simple command line
         | 
| 62 62 | 
             
            grammar. To see a summary of the available options and what they
         | 
| 63 63 | 
             
            control, run `puppet-masterless` without any arguments. For full
         | 
| 64 | 
            -
            documentation, refer to its man page[^2] or help text | 
| 65 | 
            -
            `puppet-masterless help`).
         | 
| 64 | 
            +
            documentation, refer to its [man page][manual][^2] or help text
         | 
| 65 | 
            +
            (accessed via `puppet-masterless help`).
         | 
| 66 66 |  | 
| 67 67 | 
             
            [^2]: You can view a Gem's man page by installing the [gem-man][]
         | 
| 68 68 | 
             
              extension and running `gem man <gem>`.
         | 
| @@ -111,10 +111,20 @@ path under your project's `confdir`: | |
| 111 111 | 
             
                :yaml:
         | 
| 112 112 | 
             
                  :datadir: "%{settings::confdir}/data"
         | 
| 113 113 |  | 
| 114 | 
            +
            ## Resources
         | 
| 115 | 
            +
             | 
| 116 | 
            +
             - [Man page][manual]
         | 
| 117 | 
            +
             - [Source repository][repo]
         | 
| 118 | 
            +
             - [Issue tracker][issues]
         | 
| 119 | 
            +
             | 
| 120 | 
            +
            [manual]: https://catalyst-it.gitlab.io/devtools/puppet-masterless/
         | 
| 121 | 
            +
            [repo]: https://gitlab.com/catalyst-it/devtools/puppet-masterless/
         | 
| 122 | 
            +
            [issues]: https://gitlab.com/catalyst-it/devtools/puppet-masterless/issues
         | 
| 123 | 
            +
             | 
| 114 124 | 
             
            ## Contributing
         | 
| 115 125 |  | 
| 116 | 
            -
             1. Fork it from <https://gitlab.com/catalyst-it/puppet-masterless>
         | 
| 126 | 
            +
             1. Fork it from <https://gitlab.com/catalyst-it/devtools/puppet-masterless>
         | 
| 117 127 | 
             
             2. Create a feature branch (`git checkout -b my-new-feature`)
         | 
| 118 128 | 
             
             3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| 119 129 | 
             
             4. Push to the branch (`git push origin my-new-feature`)
         | 
| 120 | 
            -
             5. Create a Merge Request at <https://gitlab.com/catalyst-it/puppet-masterless/merge_requests>
         | 
| 130 | 
            +
             5. Create a Merge Request at <https://gitlab.com/catalyst-it/devtools/puppet-masterless/merge_requests>
         | 
    
        data/bin/puppet-masterless
    CHANGED
    
    | @@ -56,6 +56,7 @@ module PuppetMasterless | |
| 56 56 | 
             
              DEFAULT_SUDO = 'sudo'
         | 
| 57 57 | 
             
              REMOTE_USER = 'root'
         | 
| 58 58 | 
             
              REMOTE_WORKDIR = '/tmp'
         | 
| 59 | 
            +
              VERSION = %{0.2.3}
         | 
| 59 60 |  | 
| 60 61 | 
             
              class Main
         | 
| 61 62 | 
             
                def initialize
         | 
| @@ -74,6 +75,11 @@ module PuppetMasterless | |
| 74 75 | 
             
                  exit(n)
         | 
| 75 76 | 
             
                end
         | 
| 76 77 |  | 
| 78 | 
            +
                def version(n = 0)
         | 
| 79 | 
            +
                  STDERR.puts("puppet-masterless #{VERSION}")
         | 
| 80 | 
            +
                  exit(n)
         | 
| 81 | 
            +
                end
         | 
| 82 | 
            +
             | 
| 77 83 | 
             
                def collect(args)
         | 
| 78 84 | 
             
                  while word = args.shift
         | 
| 79 85 | 
             
                    case word
         | 
| @@ -236,6 +242,8 @@ begin | |
| 236 242 | 
             
                main.apply
         | 
| 237 243 | 
             
              when 'help'
         | 
| 238 244 | 
             
                main.help
         | 
| 245 | 
            +
              when 'version', '--version'
         | 
| 246 | 
            +
                main.version(0)
         | 
| 239 247 | 
             
              when '-h', '--help', nil
         | 
| 240 248 | 
             
                main.usage(0)
         | 
| 241 249 | 
             
              else
         | 
| @@ -246,7 +254,7 @@ rescue => e | |
| 246 254 | 
             
              exit(1)
         | 
| 247 255 | 
             
            end
         | 
| 248 256 |  | 
| 249 | 
            -
            #1 .Dd  | 
| 257 | 
            +
            #1 .Dd October 10, 2019
         | 
| 250 258 | 
             
            #1 .Dt PUPPET-MASTERLESS 1
         | 
| 251 259 | 
             
            #1 .Os
         | 
| 252 260 | 
             
            #1 .Sh NAME
         | 
| @@ -262,110 +270,134 @@ end | |
| 262 270 | 
             
            #1 .Sh DESCRIPTION
         | 
| 263 271 | 
             
            #1 The
         | 
| 264 272 | 
             
            #1 .Nm
         | 
| 265 | 
            -
            #1  | 
| 266 | 
            -
            #1  | 
| 273 | 
            +
            #1 program packages a Puppet project as a self-contained shell script and
         | 
| 274 | 
            +
            #1 optionally executes it on a remote machine via SSH.
         | 
| 267 275 | 
             
            #1 .Pp
         | 
| 268 | 
            -
            #1  | 
| 269 | 
            -
            #1  | 
| 270 | 
            -
            #1  | 
| 276 | 
            +
            #1 Some simple conventions are used to decide what files to include in the
         | 
| 277 | 
            +
            #1 package. For a list of files that will be automatically included, refer
         | 
| 278 | 
            +
            #1 to
         | 
| 279 | 
            +
            #1 .Sx FILES .
         | 
| 271 280 | 
             
            #1 .Sh COMMANDS
         | 
| 272 | 
            -
            #1 .Bl -tag -width  | 
| 281 | 
            +
            #1 .Bl -tag -width Ds
         | 
| 273 282 | 
             
            #1 .It Cm package
         | 
| 274 | 
            -
            #1  | 
| 283 | 
            +
            #1 Package a project as a self-contained shell script.
         | 
| 275 284 | 
             
            #1 .It Cm apply
         | 
| 276 | 
            -
            #1  | 
| 277 | 
            -
            #1  | 
| 278 | 
            -
            #1 .Cm to | 
| 285 | 
            +
            #1 Apply a project to a remote host, or to the local machine if no hostname
         | 
| 286 | 
            +
            #1 is specified with the
         | 
| 287 | 
            +
            #1 .Cm to
         | 
| 288 | 
            +
            #1 argument.
         | 
| 289 | 
            +
            #1 .El
         | 
| 279 290 | 
             
            #1 .Sh ARGUMENTS
         | 
| 280 | 
            -
            #1 .Bl -tag -width  | 
| 291 | 
            +
            #1 .Bl -tag -width Ds
         | 
| 281 292 | 
             
            #1 .It Cm confdir Aq pathname
         | 
| 282 | 
            -
            #1  | 
| 293 | 
            +
            #1 Set the root directory of the Puppet project. This value is passed to
         | 
| 283 294 | 
             
            #1 .Fl -confdir
         | 
| 284 | 
            -
            #1  | 
| 295 | 
            +
            #1 when running
         | 
| 285 296 | 
             
            #1 .Xr puppet-apply 8 .
         | 
| 286 297 | 
             
            #1 .Pp
         | 
| 287 | 
            -
            #1  | 
| 298 | 
            +
            #1 This argument is required.
         | 
| 288 299 | 
             
            #1 .It Cm manifest Aq filename
         | 
| 289 | 
            -
            #1  | 
| 290 | 
            -
            #1  | 
| 300 | 
            +
            #1 Specify the main Puppet manifest to apply. This may be a file or
         | 
| 301 | 
            +
            #1 directory.
         | 
| 291 302 | 
             
            #1 .Pp
         | 
| 292 | 
            -
            #1  | 
| 303 | 
            +
            #1 Defaults to
         | 
| 293 304 | 
             
            #1 .Dq Ao confdir Ac Ns /manifests
         | 
| 294 | 
            -
            #1  | 
| 305 | 
            +
            #1 (if that file is present).
         | 
| 295 306 | 
             
            #1 .It Cm hiera_config Aq filename
         | 
| 296 | 
            -
            #1  | 
| 307 | 
            +
            #1 Specify the Hiera configuration file to use. This value is passed to
         | 
| 297 308 | 
             
            #1 .Fl -hiera_config
         | 
| 298 | 
            -
            #1  | 
| 309 | 
            +
            #1 when running
         | 
| 299 310 | 
             
            #1 .Xr puppet-apply 8 .
         | 
| 300 311 | 
             
            #1 .Pp
         | 
| 301 | 
            -
            #1  | 
| 312 | 
            +
            #1 Defaults to
         | 
| 302 313 | 
             
            #1 .Dq Ao confdir Ac Ns /hiera.yaml
         | 
| 303 | 
            -
            #1  | 
| 314 | 
            +
            #1 (if that file is present).
         | 
| 304 315 | 
             
            #1 .It Cm modulepath Aq pathname
         | 
| 305 | 
            -
            #1  | 
| 306 | 
            -
            #1 . | 
| 316 | 
            +
            #1 Set the Puppet modules directory. This value is passed to
         | 
| 317 | 
            +
            #1 .Fl -modulepath
         | 
| 318 | 
            +
            #1 when running
         | 
| 319 | 
            +
            #1 .Xr puppet-apply 8 .
         | 
| 307 320 | 
             
            #1 .Pp
         | 
| 308 | 
            -
            #1  | 
| 321 | 
            +
            #1 Defaults to
         | 
| 309 322 | 
             
            #1 .Dq Ao confdir Ac Ns /modules
         | 
| 310 | 
            -
            #1  | 
| 323 | 
            +
            #1 (if that file is present).
         | 
| 311 324 | 
             
            #1 .It Cm file Aq filename
         | 
| 312 | 
            -
            #1  | 
| 313 | 
            -
            #1  | 
| 325 | 
            +
            #1 Add an arbitrary file or directory to the generated package. This can be
         | 
| 326 | 
            +
            #1 used to include files in non-standard locations.
         | 
| 314 327 | 
             
            #1 .Pp
         | 
| 315 | 
            -
            #1  | 
| 316 | 
            -
            #1  | 
| 328 | 
            +
            #1 Directories are added recursively, and this option can be repeated to
         | 
| 329 | 
            +
            #1 include multiple files.
         | 
| 317 330 | 
             
            #1 .It Cm puppet Aq executable
         | 
| 318 | 
            -
            #1 . | 
| 319 | 
            -
            #1  | 
| 320 | 
            -
            #1 . | 
| 331 | 
            +
            #1 .Pp
         | 
| 332 | 
            +
            #1 Specify the location of the
         | 
| 333 | 
            +
            #1 .Xr puppet 8
         | 
| 334 | 
            +
            #1 executable on the remote host. This is useful when the puppet binary is
         | 
| 335 | 
            +
            #1 installed in a directory that is not on the active user's
         | 
| 336 | 
            +
            #1 .Ev PATH
         | 
| 337 | 
            +
            #1 (for example under
         | 
| 321 338 | 
             
            #1 .Pa /opt/puppetlabs/bin Ns ).
         | 
| 322 339 | 
             
            #1 .Pp
         | 
| 323 | 
            -
            #1  | 
| 340 | 
            +
            #1 Defaults to
         | 
| 324 341 | 
             
            #1 .Dq puppet .
         | 
| 325 342 | 
             
            #1 .It Cm output file Aq filename
         | 
| 326 | 
            -
            #1  | 
| 327 | 
            -
            #1  | 
| 343 | 
            +
            #1 Set the output filename. If not given, a randomly-generated filename in
         | 
| 344 | 
            +
            #1 the current directory is used.
         | 
| 328 345 | 
             
            #1 .Pp
         | 
| 329 | 
            -
            #1  | 
| 346 | 
            +
            #1 Applies only to the
         | 
| 347 | 
            +
            #1 .Cm package
         | 
| 348 | 
            +
            #1 command.
         | 
| 330 349 | 
             
            #1 .It Cm sudo Aq executable
         | 
| 331 | 
            -
            #1  | 
| 332 | 
            -
            #1 . | 
| 333 | 
            -
            #1 . | 
| 350 | 
            +
            #1 Specify the location of the
         | 
| 351 | 
            +
            #1 .Xr sudo 1
         | 
| 352 | 
            +
            #1 executable on the remote host. This can also be used to specify an
         | 
| 353 | 
            +
            #1 alternative command for privilege elevation, for example
         | 
| 354 | 
            +
            #1 .Xr doas 1 .
         | 
| 334 355 | 
             
            #1 .Pp
         | 
| 335 | 
            -
            #1  | 
| 356 | 
            +
            #1 Applies only to the
         | 
| 357 | 
            +
            #1 .Cm apply
         | 
| 358 | 
            +
            #1 command.
         | 
| 336 359 | 
             
            #1 .Pp
         | 
| 337 | 
            -
            #1  | 
| 360 | 
            +
            #1 Defaults to
         | 
| 338 361 | 
             
            #1 .Dq sudo .
         | 
| 339 362 | 
             
            #1 .It Cm as Aq username
         | 
| 340 | 
            -
            #1  | 
| 341 | 
            -
            #1 .Xr puppet-apply 8 | 
| 342 | 
            -
            #1  | 
| 363 | 
            +
            #1 Set the name of the user that will run
         | 
| 364 | 
            +
            #1 .Xr puppet-apply 8
         | 
| 365 | 
            +
            #1 on the remote host.
         | 
| 366 | 
            +
            #1 .Xr sudo 1
         | 
| 367 | 
            +
            #1 is used to become this user before execution.
         | 
| 343 368 | 
             
            #1 .Pp
         | 
| 344 | 
            -
            #1  | 
| 369 | 
            +
            #1 Applies only to the
         | 
| 370 | 
            +
            #1 .Cm apply
         | 
| 371 | 
            +
            #1 command.
         | 
| 345 372 | 
             
            #1 .Pp
         | 
| 346 | 
            -
            #1  | 
| 373 | 
            +
            #1 Defaults to
         | 
| 347 374 | 
             
            #1 .Dq root .
         | 
| 348 375 | 
             
            #1 .It Cm to Aq hostname
         | 
| 349 | 
            -
            #1  | 
| 350 | 
            -
            #1  | 
| 376 | 
            +
            #1 Specify the remote host to provision. If not given, the project will be
         | 
| 377 | 
            +
            #1 applied directly to the local machine (without packaging or SSH).
         | 
| 351 378 | 
             
            #1 .Pp
         | 
| 352 | 
            -
            #1  | 
| 353 | 
            -
            #1 . | 
| 354 | 
            -
            #1 . | 
| 355 | 
            -
            #1 . | 
| 379 | 
            +
            #1 Applies only to the
         | 
| 380 | 
            +
            #1 .Cm apply
         | 
| 381 | 
            +
            #1 command.
         | 
| 382 | 
            +
            #1 .It Cm and, with
         | 
| 383 | 
            +
            #1 These words are ignored. They can be used to make an invocation of the
         | 
| 384 | 
            +
            #1 program read sensibly (or insensibly, as desired).
         | 
| 356 385 | 
             
            #1 .It Cm -- [ Ar argument ... ]
         | 
| 357 | 
            -
            #1  | 
| 358 | 
            -
            #1  | 
| 359 | 
            -
            #1 .Xr puppet-apply 8 | 
| 360 | 
            -
            #1 . | 
| 386 | 
            +
            #1 Two dashes indicate the end of program arguments. Any remaining
         | 
| 387 | 
            +
            #1 arguments are passed to
         | 
| 388 | 
            +
            #1 .Xr puppet-apply 8
         | 
| 389 | 
            +
            #1 verbatim.
         | 
| 390 | 
            +
            #1 .\" empty par for -T html spacing
         | 
| 361 391 | 
             
            #1 .Pp
         | 
| 362 | 
            -
            #1  | 
| 392 | 
            +
            #1 \&
         | 
| 393 | 
            +
            #1 .El
         | 
| 394 | 
            +
            #1 For more information about the
         | 
| 363 395 | 
             
            #1 .Cm confdir ,
         | 
| 364 396 | 
             
            #1 .Cm hiera_config ,
         | 
| 365 397 | 
             
            #1 .Cm manifest , No and
         | 
| 366 398 | 
             
            #1 .Cm modulepath No settings, refer to the following Puppet documentation:
         | 
| 367 399 | 
             
            #1 .Pp
         | 
| 368 | 
            -
            #1 .Bl -dash -compact | 
| 400 | 
            +
            #1 .Bl -dash -compact
         | 
| 369 401 | 
             
            #1 .It
         | 
| 370 402 | 
             
            #1 .Lk https://puppet.com/docs/puppet/5.5/dirs_confdir.html confdir
         | 
| 371 403 | 
             
            #1 .It
         | 
| @@ -376,9 +408,12 @@ end | |
| 376 408 | 
             
            #1 .Lk https://puppet.com/docs/puppet/5.5/dirs_modulepath.html modulepath
         | 
| 377 409 | 
             
            #1 .El
         | 
| 378 410 | 
             
            #1 .Sh FILES
         | 
| 379 | 
            -
            #1  | 
| 380 | 
            -
            #1  | 
| 381 | 
            -
            #1  | 
| 411 | 
            +
            #1 The following files are automatically included in the package, when
         | 
| 412 | 
            +
            #1 present:
         | 
| 413 | 
            +
            #1 .\" empty par for -T html spacing
         | 
| 414 | 
            +
            #1 .Pp
         | 
| 415 | 
            +
            #1 \&
         | 
| 416 | 
            +
            #1 .Bl -column "                  "
         | 
| 382 417 | 
             
            #1 .It Ao confdir Ac Ns /puppet.conf Ta - Default Puppet configuration file.
         | 
| 383 418 | 
             
            #1 .It Ao confdir Ac Ns /hiera.yaml  Ta - Default hiera configuration file.
         | 
| 384 419 | 
             
            #1 .It Ao confdir Ac Ns /data        Ta - Default hiera data directory.
         | 
| @@ -386,7 +421,7 @@ end | |
| 386 421 | 
             
            #1 .It Ao confdir Ac Ns /modules     Ta - Default module path.
         | 
| 387 422 | 
             
            #1 .El
         | 
| 388 423 | 
             
            #1 .Pp
         | 
| 389 | 
            -
            #1  | 
| 424 | 
            +
            #1 Directories are included recursively.
         | 
| 390 425 | 
             
            #1 .Sh EXIT STATUS
         | 
| 391 426 | 
             
            #1 .Ex -std
         | 
| 392 427 | 
             
            #1 .Sh EXAMPLES
         | 
| @@ -397,11 +432,11 @@ end | |
| 397 432 | 
             
            #1 puppet-masterless apply confdir puppet
         | 
| 398 433 | 
             
            #1 .Ed
         | 
| 399 434 | 
             
            #1 .Pp
         | 
| 400 | 
            -
            #1  | 
| 435 | 
            +
            #1 Apply the
         | 
| 401 436 | 
             
            #1 .Pa site.pp
         | 
| 402 | 
            -
            #1  | 
| 437 | 
            +
            #1 manifest from the project in
         | 
| 403 438 | 
             
            #1 .Pa ./config
         | 
| 404 | 
            -
            #1  | 
| 439 | 
            +
            #1 to host 10.0.8.1 as user
         | 
| 405 440 | 
             
            #1 .Dq charlize :
         | 
| 406 441 | 
             
            #1 .Bd -literal -offset indent
         | 
| 407 442 | 
             
            #1 puppet-masterless apply confdir config \\
         | 
| @@ -409,48 +444,50 @@ end | |
| 409 444 | 
             
            #1   to 10.0.8.1 as charlize
         | 
| 410 445 | 
             
            #1 .Ed
         | 
| 411 446 | 
             
            #1 .Pp
         | 
| 412 | 
            -
            #1  | 
| 447 | 
            +
            #1 Bundle the
         | 
| 413 448 | 
             
            #1 .Pa test
         | 
| 414 | 
            -
            #1  | 
| 415 | 
            -
            #1  | 
| 449 | 
            +
            #1 project as a shell script, including a non-standard Hiera configuration
         | 
| 450 | 
            +
            #1 file location and data directory:
         | 
| 416 451 | 
             
            #1 .Bd -literal -offset indent
         | 
| 417 452 | 
             
            #1 puppet-masterless package confdir test \\
         | 
| 418 453 | 
             
            #1   with file hiera and hiera_config hiera/test.yaml
         | 
| 419 454 | 
             
            #1 .Ed
         | 
| 455 | 
            +
            #1 .Pp
         | 
| 420 456 | 
             
            #1 .Sh CAVEATS
         | 
| 421 | 
            -
            #1  | 
| 457 | 
            +
            #1 For this program to be useful, Puppet must be installed on the remote
         | 
| 458 | 
            +
            #1 host.
         | 
| 422 459 | 
             
            #1 .Pp
         | 
| 423 | 
            -
            #1  | 
| 424 | 
            -
            #1  | 
| 460 | 
            +
            #1 All file paths must be relative to the current working directory. An
         | 
| 461 | 
            +
            #1 error is signaled whenever an absolute path is specified.
         | 
| 425 462 | 
             
            #1 .Pp
         | 
| 426 | 
            -
            #1  | 
| 427 | 
            -
            #1  | 
| 463 | 
            +
            #1 This program is only intended to work with Puppet 4.10 and 5.5. It may
         | 
| 464 | 
            +
            #1 work with other versions of Puppet, or it may not.
         | 
| 428 465 | 
             
            #1 .Pp
         | 
| 429 | 
            -
            #1  | 
| 430 | 
            -
            #1  | 
| 431 | 
            -
            #1  | 
| 466 | 
            +
            #1 The SSH functionality of this program is intentionally simplistic. If
         | 
| 467 | 
            +
            #1 you need more complex behaviour when connecting to remote machines, use
         | 
| 468 | 
            +
            #1 the
         | 
| 432 469 | 
             
            #1 .Cm package
         | 
| 433 | 
            -
            #1  | 
| 470 | 
            +
            #1 command in combination with a tool like
         | 
| 434 471 | 
             
            #1 .Xr ansible 1 ,
         | 
| 435 472 | 
             
            #1 .Xr cap 1 or
         | 
| 436 473 | 
             
            #1 .Xr fab 1 .
         | 
| 437 474 | 
             
            #1 .Pp
         | 
| 438 | 
            -
            #1  | 
| 475 | 
            +
            #1 Very little information is displayed when an error occurs.
         | 
| 439 476 | 
             
            #1 .Sh SECURITY CONSIDERATIONS
         | 
| 440 | 
            -
            #1  | 
| 477 | 
            +
            #1 The
         | 
| 441 478 | 
             
            #1 .Cm apply
         | 
| 442 | 
            -
            #1  | 
| 479 | 
            +
            #1 command uses
         | 
| 443 480 | 
             
            #1 .Xr sudo 1
         | 
| 444 | 
            -
            #1  | 
| 445 | 
            -
            #1  | 
| 481 | 
            +
            #1 to assume a given user's identity on the remote host, with all of the
         | 
| 482 | 
            +
            #1 security issues that implies.
         | 
| 446 483 | 
             
            #1 .Pp
         | 
| 447 | 
            -
            #1  | 
| 448 | 
            -
            #1  | 
| 484 | 
            +
            #1 When applying manifests to a remote machine, any secrets included in the
         | 
| 485 | 
            +
            #1 project will be present on the filesystem for as long as it takes to run
         | 
| 449 486 | 
             
            #1 .Xr puppet-apply 8 .
         | 
| 450 487 | 
             
            #1 .Sh IMPLEMENTATION NOTES
         | 
| 451 488 | 
             
            #1 .Nm
         | 
| 452 | 
            -
            #1  | 
| 453 | 
            -
            #1  | 
| 489 | 
            +
            #1 is a single Ruby script with no Gem dependencies. It should be possible
         | 
| 490 | 
            +
            #1 to copy and run on any machine with Ruby 1.9 or newer.
         | 
| 454 491 | 
             
            #1 .Sh SEE ALSO
         | 
| 455 492 | 
             
            #1 .Xr puppet 8 ,
         | 
| 456 493 | 
             
            #1 .Xr puppet-apply 8 ,
         | 
    
        data/man/puppet-masterless.1
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            .Dd  | 
| 1 | 
            +
            .Dd October 10, 2019
         | 
| 2 2 | 
             
            .Dt PUPPET-MASTERLESS 1
         | 
| 3 3 | 
             
            .Os
         | 
| 4 4 | 
             
            .Sh NAME
         | 
| @@ -14,110 +14,134 @@ | |
| 14 14 | 
             
            .Sh DESCRIPTION
         | 
| 15 15 | 
             
            The
         | 
| 16 16 | 
             
            .Nm
         | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 17 | 
            +
            program packages a Puppet project as a self-contained shell script and
         | 
| 18 | 
            +
            optionally executes it on a remote machine via SSH.
         | 
| 19 19 | 
             
            .Pp
         | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 20 | 
            +
            Some simple conventions are used to decide what files to include in the
         | 
| 21 | 
            +
            package. For a list of files that will be automatically included, refer
         | 
| 22 | 
            +
            to
         | 
| 23 | 
            +
            .Sx FILES .
         | 
| 23 24 | 
             
            .Sh COMMANDS
         | 
| 24 | 
            -
            .Bl -tag -width  | 
| 25 | 
            +
            .Bl -tag -width Ds
         | 
| 25 26 | 
             
            .It Cm package
         | 
| 26 | 
            -
             | 
| 27 | 
            +
            Package a project as a self-contained shell script.
         | 
| 27 28 | 
             
            .It Cm apply
         | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
            .Cm to | 
| 29 | 
            +
            Apply a project to a remote host, or to the local machine if no hostname
         | 
| 30 | 
            +
            is specified with the
         | 
| 31 | 
            +
            .Cm to
         | 
| 32 | 
            +
            argument.
         | 
| 33 | 
            +
            .El
         | 
| 31 34 | 
             
            .Sh ARGUMENTS
         | 
| 32 | 
            -
            .Bl -tag -width  | 
| 35 | 
            +
            .Bl -tag -width Ds
         | 
| 33 36 | 
             
            .It Cm confdir Aq pathname
         | 
| 34 | 
            -
             | 
| 37 | 
            +
            Set the root directory of the Puppet project. This value is passed to
         | 
| 35 38 | 
             
            .Fl -confdir
         | 
| 36 | 
            -
             | 
| 39 | 
            +
            when running
         | 
| 37 40 | 
             
            .Xr puppet-apply 8 .
         | 
| 38 41 | 
             
            .Pp
         | 
| 39 | 
            -
             | 
| 42 | 
            +
            This argument is required.
         | 
| 40 43 | 
             
            .It Cm manifest Aq filename
         | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 44 | 
            +
            Specify the main Puppet manifest to apply. This may be a file or
         | 
| 45 | 
            +
            directory.
         | 
| 43 46 | 
             
            .Pp
         | 
| 44 | 
            -
             | 
| 47 | 
            +
            Defaults to
         | 
| 45 48 | 
             
            .Dq Ao confdir Ac Ns /manifests
         | 
| 46 | 
            -
             | 
| 49 | 
            +
            (if that file is present).
         | 
| 47 50 | 
             
            .It Cm hiera_config Aq filename
         | 
| 48 | 
            -
             | 
| 51 | 
            +
            Specify the Hiera configuration file to use. This value is passed to
         | 
| 49 52 | 
             
            .Fl -hiera_config
         | 
| 50 | 
            -
             | 
| 53 | 
            +
            when running
         | 
| 51 54 | 
             
            .Xr puppet-apply 8 .
         | 
| 52 55 | 
             
            .Pp
         | 
| 53 | 
            -
             | 
| 56 | 
            +
            Defaults to
         | 
| 54 57 | 
             
            .Dq Ao confdir Ac Ns /hiera.yaml
         | 
| 55 | 
            -
             | 
| 58 | 
            +
            (if that file is present).
         | 
| 56 59 | 
             
            .It Cm modulepath Aq pathname
         | 
| 57 | 
            -
             | 
| 58 | 
            -
            . | 
| 60 | 
            +
            Set the Puppet modules directory. This value is passed to
         | 
| 61 | 
            +
            .Fl -modulepath
         | 
| 62 | 
            +
            when running
         | 
| 63 | 
            +
            .Xr puppet-apply 8 .
         | 
| 59 64 | 
             
            .Pp
         | 
| 60 | 
            -
             | 
| 65 | 
            +
            Defaults to
         | 
| 61 66 | 
             
            .Dq Ao confdir Ac Ns /modules
         | 
| 62 | 
            -
             | 
| 67 | 
            +
            (if that file is present).
         | 
| 63 68 | 
             
            .It Cm file Aq filename
         | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 69 | 
            +
            Add an arbitrary file or directory to the generated package. This can be
         | 
| 70 | 
            +
            used to include files in non-standard locations.
         | 
| 66 71 | 
             
            .Pp
         | 
| 67 | 
            -
             | 
| 68 | 
            -
             | 
| 72 | 
            +
            Directories are added recursively, and this option can be repeated to
         | 
| 73 | 
            +
            include multiple files.
         | 
| 69 74 | 
             
            .It Cm puppet Aq executable
         | 
| 70 | 
            -
            . | 
| 71 | 
            -
             | 
| 72 | 
            -
            . | 
| 75 | 
            +
            .Pp
         | 
| 76 | 
            +
            Specify the location of the
         | 
| 77 | 
            +
            .Xr puppet 8
         | 
| 78 | 
            +
            executable on the remote host. This is useful when the puppet binary is
         | 
| 79 | 
            +
            installed in a directory that is not on the active user's
         | 
| 80 | 
            +
            .Ev PATH
         | 
| 81 | 
            +
            (for example under
         | 
| 73 82 | 
             
            .Pa /opt/puppetlabs/bin Ns ).
         | 
| 74 83 | 
             
            .Pp
         | 
| 75 | 
            -
             | 
| 84 | 
            +
            Defaults to
         | 
| 76 85 | 
             
            .Dq puppet .
         | 
| 77 86 | 
             
            .It Cm output file Aq filename
         | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 87 | 
            +
            Set the output filename. If not given, a randomly-generated filename in
         | 
| 88 | 
            +
            the current directory is used.
         | 
| 80 89 | 
             
            .Pp
         | 
| 81 | 
            -
             | 
| 90 | 
            +
            Applies only to the
         | 
| 91 | 
            +
            .Cm package
         | 
| 92 | 
            +
            command.
         | 
| 82 93 | 
             
            .It Cm sudo Aq executable
         | 
| 83 | 
            -
             | 
| 84 | 
            -
            . | 
| 85 | 
            -
            . | 
| 94 | 
            +
            Specify the location of the
         | 
| 95 | 
            +
            .Xr sudo 1
         | 
| 96 | 
            +
            executable on the remote host. This can also be used to specify an
         | 
| 97 | 
            +
            alternative command for privilege elevation, for example
         | 
| 98 | 
            +
            .Xr doas 1 .
         | 
| 86 99 | 
             
            .Pp
         | 
| 87 | 
            -
             | 
| 100 | 
            +
            Applies only to the
         | 
| 101 | 
            +
            .Cm apply
         | 
| 102 | 
            +
            command.
         | 
| 88 103 | 
             
            .Pp
         | 
| 89 | 
            -
             | 
| 104 | 
            +
            Defaults to
         | 
| 90 105 | 
             
            .Dq sudo .
         | 
| 91 106 | 
             
            .It Cm as Aq username
         | 
| 92 | 
            -
             | 
| 93 | 
            -
            .Xr puppet-apply 8 | 
| 94 | 
            -
             | 
| 107 | 
            +
            Set the name of the user that will run
         | 
| 108 | 
            +
            .Xr puppet-apply 8
         | 
| 109 | 
            +
            on the remote host.
         | 
| 110 | 
            +
            .Xr sudo 1
         | 
| 111 | 
            +
            is used to become this user before execution.
         | 
| 95 112 | 
             
            .Pp
         | 
| 96 | 
            -
             | 
| 113 | 
            +
            Applies only to the
         | 
| 114 | 
            +
            .Cm apply
         | 
| 115 | 
            +
            command.
         | 
| 97 116 | 
             
            .Pp
         | 
| 98 | 
            -
             | 
| 117 | 
            +
            Defaults to
         | 
| 99 118 | 
             
            .Dq root .
         | 
| 100 119 | 
             
            .It Cm to Aq hostname
         | 
| 101 | 
            -
             | 
| 102 | 
            -
             | 
| 120 | 
            +
            Specify the remote host to provision. If not given, the project will be
         | 
| 121 | 
            +
            applied directly to the local machine (without packaging or SSH).
         | 
| 103 122 | 
             
            .Pp
         | 
| 104 | 
            -
             | 
| 105 | 
            -
            . | 
| 106 | 
            -
            . | 
| 107 | 
            -
            . | 
| 123 | 
            +
            Applies only to the
         | 
| 124 | 
            +
            .Cm apply
         | 
| 125 | 
            +
            command.
         | 
| 126 | 
            +
            .It Cm and, with
         | 
| 127 | 
            +
            These words are ignored. They can be used to make an invocation of the
         | 
| 128 | 
            +
            program read sensibly (or insensibly, as desired).
         | 
| 108 129 | 
             
            .It Cm -- [ Ar argument ... ]
         | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 111 | 
            -
            .Xr puppet-apply 8 | 
| 112 | 
            -
            . | 
| 130 | 
            +
            Two dashes indicate the end of program arguments. Any remaining
         | 
| 131 | 
            +
            arguments are passed to
         | 
| 132 | 
            +
            .Xr puppet-apply 8
         | 
| 133 | 
            +
            verbatim.
         | 
| 134 | 
            +
            .\" empty par for -T html spacing
         | 
| 113 135 | 
             
            .Pp
         | 
| 114 | 
            -
             | 
| 136 | 
            +
            \&
         | 
| 137 | 
            +
            .El
         | 
| 138 | 
            +
            For more information about the
         | 
| 115 139 | 
             
            .Cm confdir ,
         | 
| 116 140 | 
             
            .Cm hiera_config ,
         | 
| 117 141 | 
             
            .Cm manifest , No and
         | 
| 118 142 | 
             
            .Cm modulepath No settings, refer to the following Puppet documentation:
         | 
| 119 143 | 
             
            .Pp
         | 
| 120 | 
            -
            .Bl -dash -compact | 
| 144 | 
            +
            .Bl -dash -compact
         | 
| 121 145 | 
             
            .It
         | 
| 122 146 | 
             
            .Lk https://puppet.com/docs/puppet/5.5/dirs_confdir.html confdir
         | 
| 123 147 | 
             
            .It
         | 
| @@ -128,9 +152,12 @@ The | |
| 128 152 | 
             
            .Lk https://puppet.com/docs/puppet/5.5/dirs_modulepath.html modulepath
         | 
| 129 153 | 
             
            .El
         | 
| 130 154 | 
             
            .Sh FILES
         | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 133 | 
            -
             | 
| 155 | 
            +
            The following files are automatically included in the package, when
         | 
| 156 | 
            +
            present:
         | 
| 157 | 
            +
            .\" empty par for -T html spacing
         | 
| 158 | 
            +
            .Pp
         | 
| 159 | 
            +
            \&
         | 
| 160 | 
            +
            .Bl -column "                  "
         | 
| 134 161 | 
             
            .It Ao confdir Ac Ns /puppet.conf Ta - Default Puppet configuration file.
         | 
| 135 162 | 
             
            .It Ao confdir Ac Ns /hiera.yaml  Ta - Default hiera configuration file.
         | 
| 136 163 | 
             
            .It Ao confdir Ac Ns /data        Ta - Default hiera data directory.
         | 
| @@ -138,7 +165,7 @@ The | |
| 138 165 | 
             
            .It Ao confdir Ac Ns /modules     Ta - Default module path.
         | 
| 139 166 | 
             
            .El
         | 
| 140 167 | 
             
            .Pp
         | 
| 141 | 
            -
             | 
| 168 | 
            +
            Directories are included recursively.
         | 
| 142 169 | 
             
            .Sh EXIT STATUS
         | 
| 143 170 | 
             
            .Ex -std
         | 
| 144 171 | 
             
            .Sh EXAMPLES
         | 
| @@ -149,11 +176,11 @@ directly to the local machine: | |
| 149 176 | 
             
            puppet-masterless apply confdir puppet
         | 
| 150 177 | 
             
            .Ed
         | 
| 151 178 | 
             
            .Pp
         | 
| 152 | 
            -
             | 
| 179 | 
            +
            Apply the
         | 
| 153 180 | 
             
            .Pa site.pp
         | 
| 154 | 
            -
             | 
| 181 | 
            +
            manifest from the project in
         | 
| 155 182 | 
             
            .Pa ./config
         | 
| 156 | 
            -
             | 
| 183 | 
            +
            to host 10.0.8.1 as user
         | 
| 157 184 | 
             
            .Dq charlize :
         | 
| 158 185 | 
             
            .Bd -literal -offset indent
         | 
| 159 186 | 
             
            puppet-masterless apply confdir config \\
         | 
| @@ -161,48 +188,50 @@ puppet-masterless apply confdir config \\ | |
| 161 188 | 
             
              to 10.0.8.1 as charlize
         | 
| 162 189 | 
             
            .Ed
         | 
| 163 190 | 
             
            .Pp
         | 
| 164 | 
            -
             | 
| 191 | 
            +
            Bundle the
         | 
| 165 192 | 
             
            .Pa test
         | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 193 | 
            +
            project as a shell script, including a non-standard Hiera configuration
         | 
| 194 | 
            +
            file location and data directory:
         | 
| 168 195 | 
             
            .Bd -literal -offset indent
         | 
| 169 196 | 
             
            puppet-masterless package confdir test \\
         | 
| 170 197 | 
             
              with file hiera and hiera_config hiera/test.yaml
         | 
| 171 198 | 
             
            .Ed
         | 
| 199 | 
            +
            .Pp
         | 
| 172 200 | 
             
            .Sh CAVEATS
         | 
| 173 | 
            -
             | 
| 201 | 
            +
            For this program to be useful, Puppet must be installed on the remote
         | 
| 202 | 
            +
            host.
         | 
| 174 203 | 
             
            .Pp
         | 
| 175 | 
            -
             | 
| 176 | 
            -
             | 
| 204 | 
            +
            All file paths must be relative to the current working directory. An
         | 
| 205 | 
            +
            error is signaled whenever an absolute path is specified.
         | 
| 177 206 | 
             
            .Pp
         | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 207 | 
            +
            This program is only intended to work with Puppet 4.10 and 5.5. It may
         | 
| 208 | 
            +
            work with other versions of Puppet, or it may not.
         | 
| 180 209 | 
             
            .Pp
         | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 183 | 
            -
             | 
| 210 | 
            +
            The SSH functionality of this program is intentionally simplistic. If
         | 
| 211 | 
            +
            you need more complex behaviour when connecting to remote machines, use
         | 
| 212 | 
            +
            the
         | 
| 184 213 | 
             
            .Cm package
         | 
| 185 | 
            -
             | 
| 214 | 
            +
            command in combination with a tool like
         | 
| 186 215 | 
             
            .Xr ansible 1 ,
         | 
| 187 216 | 
             
            .Xr cap 1 or
         | 
| 188 217 | 
             
            .Xr fab 1 .
         | 
| 189 218 | 
             
            .Pp
         | 
| 190 | 
            -
             | 
| 219 | 
            +
            Very little information is displayed when an error occurs.
         | 
| 191 220 | 
             
            .Sh SECURITY CONSIDERATIONS
         | 
| 192 | 
            -
             | 
| 221 | 
            +
            The
         | 
| 193 222 | 
             
            .Cm apply
         | 
| 194 | 
            -
             | 
| 223 | 
            +
            command uses
         | 
| 195 224 | 
             
            .Xr sudo 1
         | 
| 196 | 
            -
             | 
| 197 | 
            -
             | 
| 225 | 
            +
            to assume a given user's identity on the remote host, with all of the
         | 
| 226 | 
            +
            security issues that implies.
         | 
| 198 227 | 
             
            .Pp
         | 
| 199 | 
            -
             | 
| 200 | 
            -
             | 
| 228 | 
            +
            When applying manifests to a remote machine, any secrets included in the
         | 
| 229 | 
            +
            project will be present on the filesystem for as long as it takes to run
         | 
| 201 230 | 
             
            .Xr puppet-apply 8 .
         | 
| 202 231 | 
             
            .Sh IMPLEMENTATION NOTES
         | 
| 203 232 | 
             
            .Nm
         | 
| 204 | 
            -
             | 
| 205 | 
            -
             | 
| 233 | 
            +
            is a single Ruby script with no Gem dependencies. It should be possible
         | 
| 234 | 
            +
            to copy and run on any machine with Ruby 1.9 or newer.
         | 
| 206 235 | 
             
            .Sh SEE ALSO
         | 
| 207 236 | 
             
            .Xr puppet 8 ,
         | 
| 208 237 | 
             
            .Xr puppet-apply 8 ,
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: puppet-masterless
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Evan Hanson
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2019-10- | 
| 11 | 
            +
            date: 2019-10-28 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         | 
| @@ -24,6 +24,20 @@ dependencies: | |
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 26 | 
             
                    version: '12.0'
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: rspec
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - "~>"
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '3.0'
         | 
| 34 | 
            +
              type: :development
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - "~>"
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '3.0'
         | 
| 27 41 | 
             
            description: Packages and applies a Puppet project to a remote host.
         | 
| 28 42 | 
             
            email: evanh@catalyst.net.nz
         | 
| 29 43 | 
             
            executables:
         |