8 changed files with 29 additions and 216 deletions
@ -0,0 +1,11 @@ |
|||
name 'nesi-gpg' |
|||
version '0.0.1' |
|||
source 'https://github.com/nesi/puppet-gpg' |
|||
author 'nesi' |
|||
license 'GPL 3' |
|||
summary 'A Puppet module for managing GPG keys' |
|||
description 'A Puppet module for managing GPG keys, initially it will deploy keys from a source, but will be developed into generating and deploying GPG keys from the puppetmaster.' |
|||
project_page 'https://github.com/nesi/puppet-gpg' |
|||
|
|||
## Add dependencies, if any: |
|||
# dependency 'username/name', '>= 1.2.0' |
@ -1,11 +0,0 @@ |
|||
name 'aethylred-blank' |
|||
version '0.0.1' |
|||
source 'UNKNOWN' |
|||
author 'aethylred' |
|||
license 'UNKNOWN' |
|||
summary 'UNKNOWN' |
|||
description 'UNKNOWN' |
|||
project_page 'UNKNOWN' |
|||
|
|||
## Add dependencies, if any: |
|||
# dependency 'username/name', '>= 1.2.0' |
@ -1,145 +0,0 @@ |
|||
# blank |
|||
|
|||
This is a blank puppet module. |
|||
|
|||
# Usage |
|||
|
|||
Use this module to start a new blank puppet module with all the required components ready for submitting to Puppet Forge. |
|||
|
|||
## Create a new blank module |
|||
|
|||
1. Clone this repository: |
|||
|
|||
``` |
|||
git clone -o puppet-blank -b master git://github.com/Aethylred/puppet-blank.git /path/to/new/repository |
|||
``` |
|||
1. Use the `unblank.ps1` script to customise the blank template |
|||
1. Delete clean up blank with `cleanup.ps1` |
|||
1. Commit changes |
|||
1. Add a new `origin` remote: |
|||
|
|||
``` |
|||
git remote add origin git@a.git.repo:reponame.git |
|||
``` |
|||
1. Push your changes: |
|||
|
|||
``` |
|||
git push origin master |
|||
``` |
|||
|
|||
## Windows scripts |
|||
|
|||
Provided are some Powershell scripts that can be used to manage the blank puppet module template. |
|||
|
|||
## Enable execution of unsigned scripts |
|||
|
|||
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. |
|||
|
|||
1. Click *Start* menu |
|||
2. Type "powershell" in the *Search programs and files* box, do not press enter. |
|||
3. When *Powershell* shows up in the search results, right click and select *Run as administrator* |
|||
4. Windows UAC may ask for permission to run as an administrator, click *Yes* |
|||
5. Run the following command in the administrator PowerShell: |
|||
|
|||
``` |
|||
set-executionpolicy remotesigned |
|||
``` |
|||
6. 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. |
|||
|
|||
## Change author and module |
|||
|
|||
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. |
|||
|
|||
1. Start Powershell in the blank module directory |
|||
2. Run the `unblank.ps1` script: |
|||
|
|||
``` |
|||
.\unblank.ps1 newauthor newmodule |
|||
``` |
|||
3. Add the newly created files to the git version control: |
|||
|
|||
``` |
|||
git add Modulefile manifests\init.pp tests\init.pp |
|||
``` |
|||
4. Commit these changes to git: |
|||
|
|||
``` |
|||
git commit -am "Unblanked module with newauthor and newmodule" |
|||
``` |
|||
5. Add new remote repository: |
|||
|
|||
``` |
|||
git remote add origin git@git.repo.server:repository.git |
|||
``` |
|||
6. Push changes to origin: |
|||
|
|||
``` |
|||
git push origin master |
|||
``` |
|||
7. The new module is ready for further development |
|||
|
|||
## Updating puppet-blank |
|||
|
|||
Just merge from the puppet-blank remote, though conflicts will be expected: |
|||
|
|||
``` |
|||
git pull puppet-blank master |
|||
``` |
|||
|
|||
## Cleaning up the puppet-blank files |
|||
1. Start Powershell in the blank module directory |
|||
2. Run the cleanup script: |
|||
|
|||
``` |
|||
.\cleanup.ps1 |
|||
``` |
|||
3. Commit the changes to git: |
|||
|
|||
``` |
|||
git commit -am "Cleaned up with the puppet-blank cleanup script" |
|||
``` |
|||
4. 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. |
|||
|
|||
## Prepare a module for submission to Puppet Forge |
|||
|
|||
1. 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 the `Modulefile` have been corrected. |
|||
2. 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 |
|||
``` |
|||
3. Submit the resulting tarball to Puppet Forge as per [their instructions] |
|||
(http://docs.puppetlabs.com/puppet/2.7/reference/modules_publishing.html) |
|||
|
|||
# Frequently Asked Questions |
|||
|
|||
More like questions that should be asked. |
|||
|
|||
## Why not use the puppet module generator? |
|||
|
|||
This module started with the standard module generation using |
|||
|
|||
``` |
|||
puppet module generate author-blank |
|||
``` |
|||
...so why not continue to use it? |
|||
|
|||
This module is intended for: |
|||
|
|||
1. Writing a module in an environment where puppet is not or can not be installed |
|||
2. Use as a starting point for a collection of modules and prepopulated with things like licensing, boiler plate, pictures of cats, etc. etc. |
|||
3. Writing a module in an environment where `puppet module generate` doesn't work, i.e. Windows. |
|||
|
|||
## Why Windows powershell scripts? |
|||
|
|||
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, which made this much easier than `.bat` batch files. |
@ -1,12 +0,0 @@ |
|||
echo "Cleaning up template..." |
|||
if ((Test-Path 'Modulefile') -and (Test-Path 'manifests/init.pp') -and (Test-Path 'tests/init.pp')){ |
|||
echo "Deleting .orig templates..." |
|||
Remove-Item 'Modulefile.orig' |
|||
Remove-Item 'manifests/init.pp.orig' |
|||
Remove-Item 'tests/init.pp.orig' |
|||
Remove-Item 'README1st.markdown' |
|||
Remove-Item 'unblank.ps1' |
|||
Remove-Item 'cleanup.ps1' |
|||
} else { |
|||
throw "ERROR: Cannot find required files, have you run unblank.ps1?" |
|||
} |
@ -1,15 +1,15 @@ |
|||
# This file is part of the blank Puppet module. |
|||
# This file is part of the gpg Puppet module. |
|||
# |
|||
# The blank Puppet module is free software: you can redistribute it and/or modify |
|||
# The gpg Puppet module is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation, either version 3 of the License, or |
|||
# (at your option) any later version. |
|||
# |
|||
# The blank Puppet module is distributed in the hope that it will be useful, |
|||
# The gpg Puppet module is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with the blank Puppet module. If not, see <http://www.gnu.org/licenses/>. |
|||
include blank |
|||
# along with the gpg Puppet module. If not, see <http://www.gnu.org/licenses/>. |
|||
include gpg |
@ -1,28 +0,0 @@ |
|||
Param($author,$module) |
|||
if ($author -match "^\w+$") { |
|||
if ($module -match "^\w+$") { |
|||
echo "Update Modulefile..." |
|||
$modulefile = Get-Content Modulefile.orig |
|||
$modulefile = Foreach-Object {$modulefile -replace "aethylred", $author} |
|||
$modulefile = Foreach-Object {$modulefile -replace "blank", $module} |
|||
Set-Content Modulefile $modulefile |
|||
echo "Modulefile updated." |
|||
|
|||
echo "Update manifests/init.pp..." |
|||
$initfile = Get-Content manifests/init.pp.orig |
|||
$initfile = Foreach-Object {$initfile -replace "blank", $module} |
|||
Set-Content manifests/init.pp $initfile |
|||
echo "manifests/init.pp updated." |
|||
|
|||
echo "Update tests\init.pp..." |
|||
$testfile = Get-Content tests/init.pp.orig |
|||
$testfile = Foreach-Object {$testfile -replace "blank", $module} |
|||
Set-Content tests/init.pp $testfile |
|||
echo "tests/init.pp updated." |
|||
|
|||
} else { |
|||
throw "ERROR: Bad module parameter '$module', must be a single word made up of word caracters [a-zA-Z_0-9]" |
|||
} |
|||
} else { |
|||
throw "ERROR: Bad author parameter '$author', must be a single word made up of word caracters [a-zA-Z_0-9]" |
|||
} |
Loading…
Reference in new issue