This is a blank puppet module.
Use this module to start a new blank puppet module with all the required components ready for submitting to Puppet Forge.
-
Clone this repository:
git clone -o puppet-blank -b master git://github.com/Aethylred/puppet-blank.git /path/to/new/repository
-
Merge any
puppet-blank
feature branches that are required and resolve conflicts. -
Use the
unblank.ps1
script to customise the blank template -
Delete clean up blank with
cleanup.ps1
-
Delete past git history and reinitialise git (optional, but recommended):
Remove-Item .\.git -Force -Recurse git init
-
Commit changes:
git add -A git commit -m 'Initial commit'
-
Add a new
origin
remote:git remote add origin git@a.git.repo:reponame.git
-
Push your changes:
git push origin master
The puppet-blank
template has a number of branches that can be merged in to add additional features to your Puppet module.
rspec-augeas
This branch will update the Travis configuration to installrspec-puppet-augeas
which provides additional tests when using the Puppet augeas resource.vagrant
This branch adds a Vagrantfile and instructions on how to use Vagrant to test your Puppet module on a local virtual machine.
Provided are some Powershell scripts that can be used to manage the blank puppet module template.
Powershell will not run unsigned scripts by default, this can be enabled by executing the following command in an Administrator Powershell. This is required before any of the other powershell scripts will run.
-
Click Start menu
-
Type "powershell" in the Search programs and files box, do not press enter.
-
When Powershell shows up in the search results, right click and select Run as administrator
-
Windows UAC may ask for permission to run as an administrator, click Yes
-
Run the following command in the administrator PowerShell:
set-executionpolicy remotesigned
-
Press Enter again to confirm the policy change
NOTE: You may need to repeat this in both PowerShell and PowerShell (x86) on 64-bit systems.
This updates the author and module name using the .orig
templates. This script can be re-run, creating new templates. This may not be advisable in later stages of module development.
-
Start Powershell in the blank module directory
-
Run the
unblank.ps1
script:.\unblank.ps1 newauthor newmodule
-
Add the newly created files to the git version control:
git add Modulefile manifests\init.pp tests\init.pp
-
Commit these changes to git:
git commit -am "Unblanked module with newauthor and newmodule"
-
Add new remote repository:
git remote add origin git@git.repo.server:repository.git
-
Push changes to origin:
git push origin master
-
The new module is ready for further development
Just merge from the puppet-blank remote, though conflicts will be expected:
git pull puppet-blank master
-
Start Powershell in the blank module directory
-
Run the cleanup script:
.\cleanup.ps1
-
Commit the changes to git:
git commit -am "Cleaned up with the puppet-blank cleanup script"
-
Push changes to remote:
git push origin master
NOTE: The cleanup script is destructive and will delete several files, including itself.
NOTE: The puppet-blank remote is read-only, it should not be possible to push to it.
-
To perform this step, the module will need to be cloned to a Linux server where puppet has been installed, and that the
UNKNOWN
entries in theModulefile
have been corrected. -
in the parent directory to the module, build the module metadata where the module is in the directory
puppet-module
:puppet module build puppet-module
-
Submit the resulting tarball to Puppet Forge as per [their instructions] (http://docs.puppetlabs.com/puppet/2.7/reference/modules_publishing.html)
More like questions that should be asked.
This module started with the standard module generation using
```PowerShell
puppet module generate author-blank
```
...but this has been (mostly) fixed, so why not continue to use it?
This module is intended for:
- Writing a module in an environment where puppet is not or can not be installed
- Use as a starting point for a collection of modules and pre-populated with things like licensing, boiler plate, test environments, pictures of cats, etc. etc.
- Writing a module in an environment where
puppet module generate
doesn't work, i.e. Windows.
My $work
environment is restricted to using Windows 7, so I required scripts that run under Windows 7. I used PowerShell because it has Perl-like regular expressions and it sometimes, but not consistently, acts like bash. This made this much easier to use than .bat
batch files.