For general contribution and community guidelines, please see the community repo.
It may help to understand some typical flows when this Puppet module is included in your Puppet workflows. The following Conjur Puppet module workflows are portrayed below:
This workflow is described in the Updating the Puppet manifest section in the README.md file.
This workflow is described in the "Using Conjur identity files (Linux agents only)" and "Using Windows Registry / Windows Credential Manager (Windows agents only)" sections of the README.md file.
Run a pre-configured Conjur and Puppet master instance by going into the
examples/puppetmaster
folder and running the following:
$ export CLEAN_UP_ON_EXIT=false
$ export INSTALL_PACKAGED_MODULE=false
$ export COMPOSE_PROJECT_NAME=puppetmaster_manual
$ ./test.sh
This command will run the integration tests and exit with the Puppet master and Conjur instances still available.
After you have your test environment up, you can test changes using pre-built agent images that makes the test cycle really fast.
For example, once the Puppet master is up you can run this to converge an agent:
$ # Get IP of docker-compose gateway. This only needs to be run once.
$ export DOCKER_GATEWAY_IP="$(docker inspect $(docker-compose ps -q puppet) | \
jq .[0].NetworkSettings.Networks[].Gateway | tr -d '"')"
$ # Run the agent
$ docker run --rm -it \
--net puppetmaster_manual_default \
--add-host "conjur.cyberark.com:$DOCKER_GATEWAY_IP" \
--hostname "my-agent-name" \
"puppet/puppet-agent-ubuntu"
You will see Puppet converge on the node.
A couple notes:
-
docker-compose
creates the$COMPOSE_PROJECT_NAME_default
network by default. The agent needs to connect to this network to be able to see the Puppet master and Conjur. -
The default command for these agent images is
agent --verbose --one-time --no-daemonize --summarize
. The default entrypoint is/opt/puppetlabs/bin/puppet
. This can be overridden for your purposes with CLI parameters:$ docker run --rm -it \ --net puppetmaster_manual_default \ --add-host "conjur.cyberark.com:$DOCKER_GATEWAY_IP" \ --hostname 'test-machine' \ puppet_default \ puppet/puppet-agent-ubuntu agent --trace \ --one-time \ --no-daemonize \ --certname 'myhost.com'
The examples/puppetmaster/vagrant directory contains Vagrantfiles, Bash scripts, and PowerShell scripts that can be used to create a Vagrant/VirtualBox-based development and test environment for testing the Conjur Puppet module with Puppet Agents running on Windows2016 or Windows2012.
These Vagrantfiles and scripts can be used to:
- Spin up a containerized Puppet Server and Conjur server via docker-compose.
- Create a Windows2016 or Windows2012 VM.
- Dynamically install the desired version of Puppet Agent on the VM.
- Run Puppet Agent on the VM to install a Puppet catalog.
- Confirm that Puppet has been provisioned according to the configured Puppet manifest on the Puppet master.
For details, refer to examples/puppetmaster/vagrant/README.md.
Run the following at the base of the project:
$ ./ci/test.sh
This script leverages PDK to run both unit tests and validations of the module.
To (re)generate the documentation, you just need to run ./ci/gen-docs.sh
from the root of the
project and commit the changes.
-
Check for files added since last release and any modules that are newly linked from code or used that were not written by CyberArk employees. Keep in mind that dependency module version changes count as new modules.
-
If any module(s) from that list does not have a matching entry in the NOTICES.txt file you should add (or update) its version and license/copyright in NOTICES.txt.
-
If any external modules are no longer linked to or an external dependency removed from source, remove that version of the software and its license/copyright from NOTICES.txt.
If no dependencies have changed, you can move on to the next step.
To release a new version of the module to the Puppet Forge:
- Update the
version
field in metadata.json. - Update CHANGELOG.md.
- Verify that nothing changed in the
REFERENCE.md
by regenerating the docs. - Commit and push these changes to a branch, and create a PR.
- Once the PR is approved, create an annotated tag on the main branch and push
it (
git tag -a <VERSION> -m <VERSION> && git push --tags
) - Verify the Jenkins pipeline completes successfully.
- Verify the updated module on Puppet Forge.
- Search the open issues in GitHub to find out what has been planned
- Select an existing issue or open an issue to propose changes or fixes
- Add the
implementing
label to the issue as you begin to work on it - Run tests as described here, ensuring they pass
- Submit a pull request, linking the issue in the description (e.g.
Connected to #123
) - Add the
implemented
label to the issue, and ask another contributor to review and merge your code