Browse Source

Update README, created Windows Powershell script to create a Modulefile with a new author name

master
Aaron Hicks 7 years ago
parent
commit
8b3300346d
3 changed files with 62 additions and 2 deletions
  1. 0
    0
      Modulefile.orig
  2. 54
    2
      README
  3. 8
    0
      setauthor.ps1

Modulefile → Modulefile.orig View File


+ 54
- 2
README View File

@@ -1,3 +1,55 @@
blank
# blank

This is the blank module.
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

## 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 corrected 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

## Change author

1. Start Powershell in the blank module directory
2. Run the `setauthor.ps1` script:
./setauthor.ps1 newauthor
3. This creates a new `Modulefile` from `Modulefile.orig`, open it in an editor and check it's correct.

# 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 blank

...so why not continue to use it?

This module is intended for:

1. Writing a module 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.

+ 8
- 0
setauthor.ps1 View File

@@ -0,0 +1,8 @@
Param($author)
if ($author -match "^\w+$") {
echo "Replacing author with $author..."
Get-Content Modulefile.orig | Foreach-Object {$_ -replace "aethylred", $author} | Set-Content Modulefile
echo "New Modulefile created"
} else {
echo "Bad author '$author', must be a single word made up of word caracters [a-zA-Z_0-9]"
}

Loading…
Cancel
Save