You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.9 KiB

3 years ago
3 years ago
3 years ago
  1. # install-puppet
  2. One-shot shell script that can be used to install puppet-agent on a supported
  3. POSIX platform.
  4. ## Description
  5. This repository contains a Ruby script (`install.rb`), which when executed will
  6. generate an `install.sh` file to be used for installing puppet-agent on
  7. supported FOSS POSIX platforms.
  8. The script leverages Bolt tasks from the
  9. [puppet_agent](https://forge.puppet.com/modules/puppetlabs/puppet_agent) and
  10. [facts](https://forge.puppet.com/modules/puppetlabs/facts) modules, and
  11. attempts to change as few things as possible in order to create a working shell
  12. script which can be used with little to no external dependencies
  13. ## Getting Started
  14. ### Dependencies
  15. * A non-Windows platform for which Puppet provides official packages (see the full list [here](https://puppet.com/docs/puppet/latest/system_requirements.html#supported_operating_systems-packaged-platforms))
  16. * One of wget/curl/fetch/perl-LWP-Simple in order to download packages
  17. * `bash` (probably at least version 3)
  18. * Ability to run the script as `root`
  19. ### Usage
  20. ### Install with curl
  21. ```sh
  22. curl -sSL https://raw.githubusercontent.com/puppetlabs/install-puppet/main/install.sh | bash
  23. ```
  24. ### Install with wget
  25. ```sh
  26. wget -qO - https://raw.githubusercontent.com/puppetlabs/install-puppet/main/install.sh | bash
  27. ```
  28. Piping to `bash` is a controversial practice, so you are encouraged to inspect
  29. the [contents of the
  30. script](https://github.com/puppetlabs/install-puppet/blob/main/install.sh)
  31. before executing it.
  32. ### Script arguments
  33. If run with no arguments, the script will install the latest stable version of puppet-agent.
  34. You can install a specific version using:
  35. ```sh
  36. curl -sSL https://raw.githubusercontent.com/puppetlabs/install-puppet/main/install.sh | bash -s -- -v 6.24.0
  37. ```
  38. Below is the full list of configurable options:
  39. * `-v`/`--version` - install a specific puppet-agent version
  40. * `-c`/`--collection` - install a specific puppet-agent collection (e.g. puppet7)
  41. * `-n`/`--noop` - do a dry run, do not change any files
  42. * `--cleanup` - remove the puppetlabs repository after installation finishes
  43. ## Development
  44. The Ruby script uses parts of the `bash.sh` task from the
  45. [facts](https://forge.puppet.com/modules/puppetlabs/facts) module, and the
  46. `install_shell.sh` task from the
  47. [puppet_agent](https://forge.puppet.com/modules/puppetlabs/puppet_agent) module
  48. to generate the `install.sh` file. The modules are vendored as git submodules;
  49. in order to initialize them, run `git submodule update --init` after cloning
  50. this repository.
  51. After making your changes, run the following command to regenerate the shell script:
  52. ```sh
  53. ruby install.rb
  54. ```
  55. You can also run shellcheck on the resulting script, it will skip the vendored
  56. task parts and only warn on code specific to this repository.
  57. ```sh
  58. shellcheck install.sh
  59. ```
  60. ## License
  61. This project is licensed under the Apache 2.0 License - see the LICENSE file for details