We're going to use Windows Server 2019 in this example so let's start by booting up our vagrant machine.
make windows server-2019 upAfter the machine starts it will get bootstrapped for development. See the bootstrap module for more information.
Let's start by accessing our new machine.
make windows server-2019 rdpLog in with the following details:
- user: vagrant
- password: vagrant
Once you have a remote ssh session established with your remote machine, open a new terminal and clone your module.
git clone https://github.com/puppetlabs/puppetlabs-chocolatey
cd puppetlabs-chocolateyDuring bootstrap, gh-cli is installed.
We can use it to authenticate git and persist our access tokens.
From a terminal run gh auth login and follow the instructions ensuring that you choose https when asked to choose a protocol.
From inside the module directory run bundle install.
Gems will be saved locally to ./.bundle/gems.
bundle installOnce the dependencies have been installed we need to initialize the module for development.
bundle exec rake spec_prepUnderneath the spec/fixtures/ you should now have the following directories:
- modules:
spec/fixtures/modules - manifests:
spec/fixtures/manifests
You can define test classes in spec/fixtures/manifests/site.pp.
Alternatively, you can run any of the examples provided with the module.
The only thing left to do now is to make some changes and apply the manifest. You can do this by executing the following command:
bundle exec puppet apply .\spec\fixtures\manifests\site.pp --modulepath .\spec\fixtures\modules\ --debug