Browse Source

Initial Commit after unblanking and cleaning

Aaron Hicks 6 years ago
parent
commit
5e063a3eed
8 changed files with 29 additions and 216 deletions
  1. 11
    0
      Modulefile
  2. 0
    11
      Modulefile.orig
  3. 6
    8
      README.markdown
  4. 0
    145
      README1st.markdown
  5. 0
    12
      cleanup.ps1
  6. 7
    7
      manifests/init.pp
  7. 5
    5
      tests/init.pp
  8. 0
    28
      unblank.ps1

+ 11
- 0
Modulefile View File

@@ -0,0 +1,11 @@
1
+name    'nesi-gpg'
2
+version '0.0.1'
3
+source 'https://github.com/nesi/puppet-gpg'
4
+author 'nesi'
5
+license 'GPL 3'
6
+summary 'A Puppet module for managing GPG keys'
7
+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.'
8
+project_page 'https://github.com/nesi/puppet-gpg'
9
+
10
+## Add dependencies, if any:
11
+# dependency 'username/name', '>= 1.2.0'

+ 0
- 11
Modulefile.orig View File

@@ -1,11 +0,0 @@
1
-name    'aethylred-blank'
2
-version '0.0.1'
3
-source 'UNKNOWN'
4
-author 'aethylred'
5
-license 'UNKNOWN'
6
-summary 'UNKNOWN'
7
-description 'UNKNOWN'
8
-project_page 'UNKNOWN'
9
-
10
-## Add dependencies, if any:
11
-# dependency 'username/name', '>= 1.2.0'

+ 6
- 8
README.markdown View File

@@ -1,8 +1,6 @@
1
-# blank
1
+# gpg
2 2
 
3
-This is a blank puppet module.
4
-
5
-*NOTE:* Check README1st.markdown for usage of the blank puppet module template.
3
+This is a Puppet module for handing GPG keys.
6 4
 
7 5
 # Licensing
8 6
 
@@ -20,10 +18,10 @@ This module has been developed for the use with Open Source Puppet (Apache 2.0 l
20 18
 
21 19
 # Gnu General Public License
22 20
 
23
-This file is part of the blank Puppet module.
21
+This file is part of the gpg Puppet module.
24 22
 
25
-The blank 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.
23
+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.
26 24
 
27
-The blank 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.
25
+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.
28 26
 
29
-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/>.
27
+You should have received a copy of the GNU General Public License along with the gpg Puppet module.  If not, see <http://www.gnu.org/licenses/>.

+ 0
- 145
README1st.markdown View File

@@ -1,145 +0,0 @@
1
-# blank
2
-
3
-This is a blank puppet module.
4
-
5
-# Usage
6
-
7
-Use this module to start a new blank puppet module with all the required components ready for submitting to Puppet Forge.
8
-
9
-## Create a new blank module
10
-
11
-1. Clone this repository:
12
-
13
-	```
14
-	git clone -o puppet-blank -b master git://github.com/Aethylred/puppet-blank.git /path/to/new/repository
15
-	```
16
-1. Use the `unblank.ps1` script to customise the blank template
17
-1. Delete clean up blank with `cleanup.ps1`
18
-1. Commit changes
19
-1. Add a new `origin` remote:
20
-
21
-	```
22
-	git remote add origin git@a.git.repo:reponame.git
23
-	```
24
-1. Push your changes:
25
-
26
-	```
27
-	git push origin master
28
-	```
29
-
30
-## Windows scripts
31
-
32
-Provided are some Powershell scripts that can be used to manage the blank puppet module template.
33
-
34
-## Enable execution of unsigned scripts
35
-
36
-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.
37
-
38
-1. Click *Start* menu
39
-2. Type "powershell" in the *Search programs and files* box, do not press enter.
40
-3. When *Powershell* shows up in the search results, right click and select *Run as administrator*
41
-4. Windows UAC may ask for permission to run as an administrator, click *Yes*
42
-5. Run the following command in the administrator PowerShell:
43
-
44
-	```
45
-	set-executionpolicy remotesigned
46
-	```
47
-6. Press *Enter* again to confirm the policy change
48
-
49
-**NOTE:** You may need to repeat this in both PowerShell and PowerShell (x86) on 64-bit systems.
50
-
51
-## Change author and module
52
-
53
-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.
54
-
55
-1. Start Powershell in the blank module directory
56
-2. Run the `unblank.ps1` script:
57
-
58
-	```
59
-	.\unblank.ps1 newauthor newmodule
60
-	```
61
-3. Add the newly created files to the git version control:
62
-
63
-	```
64
-	git add Modulefile manifests\init.pp tests\init.pp
65
-	```
66
-4. Commit these changes to git:
67
-
68
-	```
69
-	git commit -am "Unblanked module with newauthor and newmodule"
70
-	```
71
-5. Add new remote repository:
72
-
73
-	```
74
-	git remote add origin git@git.repo.server:repository.git
75
-	```
76
-6. Push changes to origin:
77
-
78
-	```
79
-	git push origin master
80
-	```
81
-7. The new module is ready for further development
82
-
83
-## Updating puppet-blank
84
-
85
-Just merge from the puppet-blank remote, though conflicts will be expected:
86
-
87
-```
88
-git pull puppet-blank master
89
-```
90
-
91
-## Cleaning up the puppet-blank files
92
-1. Start Powershell in the blank module directory
93
-2. Run the cleanup script:
94
-
95
-	```
96
-	.\cleanup.ps1
97
-	```
98
-3. Commit the changes to git:
99
-
100
-	```
101
-	git commit -am "Cleaned up with the puppet-blank cleanup script"
102
-	```
103
-4. Push changes to remote:
104
-
105
-	```
106
-	git push origin master
107
-	```
108
-
109
-**NOTE:** The cleanup script is *destructive* and will delete several files, including itself.
110
-
111
-**NOTE:** The puppet-blank remote is read-only, it should not be possible to push to it.
112
-
113
-## Prepare a module for submission to Puppet Forge
114
-
115
-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.
116
-2. in the parent directory to the module, build the module metadata where the module is in the directory `puppet-module`:
117
-
118
-	```
119
-	puppet module build puppet-module
120
-	```
121
-3. Submit the resulting tarball to Puppet Forge as per [their instructions]
122
-(http://docs.puppetlabs.com/puppet/2.7/reference/modules_publishing.html)
123
-
124
-# Frequently Asked Questions
125
-
126
-More like questions that should be asked.
127
-
128
-## Why not use the puppet module generator?
129
-
130
-This module started with the standard module generation using
131
-
132
-	```
133
-	puppet module generate author-blank
134
-	```
135
-...so why not continue to use it?
136
-
137
-This module is intended for:
138
-
139
-1. Writing a module in an environment where puppet is not or can not be installed
140
-2. Use as a starting point for a collection of modules and prepopulated with things like licensing, boiler plate, pictures of cats, etc. etc.
141
-3. Writing a module in an environment where `puppet module generate` doesn't work, i.e. Windows.
142
-
143
-## Why Windows powershell scripts?
144
-
145
-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.

+ 0
- 12
cleanup.ps1 View File

@@ -1,12 +0,0 @@
1
-echo "Cleaning up template..."
2
-if ((Test-Path 'Modulefile') -and (Test-Path 'manifests/init.pp') -and (Test-Path 'tests/init.pp')){
3
-	echo "Deleting .orig templates..."
4
-	Remove-Item 'Modulefile.orig'
5
-	Remove-Item 'manifests/init.pp.orig'
6
-	Remove-Item 'tests/init.pp.orig'
7
-	Remove-Item 'README1st.markdown'
8
-	Remove-Item 'unblank.ps1'
9
-	Remove-Item 'cleanup.ps1'
10
-} else {
11
-	throw "ERROR: Cannot find required files, have you run unblank.ps1?"
12
-}

manifests/init.pp.orig → manifests/init.pp View File

@@ -1,6 +1,6 @@
1
-# Class: blank
1
+# Class: gpg
2 2
 #
3
-# This module manages blank
3
+# This module manages gpg
4 4
 #
5 5
 # Parameters:
6 6
 #
@@ -11,23 +11,23 @@
11 11
 # Sample Usage:
12 12
 #
13 13
 
14
-# This file is part of the blank Puppet module.
14
+# This file is part of the gpg Puppet module.
15 15
 #
16
-#     The blank Puppet module is free software: you can redistribute it and/or modify
16
+#     The gpg Puppet module is free software: you can redistribute it and/or modify
17 17
 #     it under the terms of the GNU General Public License as published by
18 18
 #     the Free Software Foundation, either version 3 of the License, or
19 19
 #     (at your option) any later version.
20 20
 #
21
-#     The blank Puppet module is distributed in the hope that it will be useful,
21
+#     The gpg Puppet module is distributed in the hope that it will be useful,
22 22
 #     but WITHOUT ANY WARRANTY; without even the implied warranty of
23 23
 #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 24
 #     GNU General Public License for more details.
25 25
 #
26 26
 #     You should have received a copy of the GNU General Public License
27
-#     along with the blank Puppet module.  If not, see <http://www.gnu.org/licenses/>.
27
+#     along with the gpg Puppet module.  If not, see <http://www.gnu.org/licenses/>.
28 28
 
29 29
 # [Remember: No empty lines between comments and class definition]
30
-class blank {
30
+class gpg {
31 31
 
32 32
 
33 33
 }

tests/init.pp.orig → tests/init.pp View File

@@ -1,15 +1,15 @@
1
-# This file is part of the blank Puppet module.
1
+# This file is part of the gpg Puppet module.
2 2
 #
3
-#     The blank Puppet module is free software: you can redistribute it and/or modify
3
+#     The gpg Puppet module is free software: you can redistribute it and/or modify
4 4
 #     it under the terms of the GNU General Public License as published by
5 5
 #     the Free Software Foundation, either version 3 of the License, or
6 6
 #     (at your option) any later version.
7 7
 #
8
-#     The blank Puppet module is distributed in the hope that it will be useful,
8
+#     The gpg Puppet module is distributed in the hope that it will be useful,
9 9
 #     but WITHOUT ANY WARRANTY; without even the implied warranty of
10 10
 #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 11
 #     GNU General Public License for more details.
12 12
 #
13 13
 #     You should have received a copy of the GNU General Public License
14
-#     along with the blank Puppet module.  If not, see <http://www.gnu.org/licenses/>.
15
-include blank
14
+#     along with the gpg Puppet module.  If not, see <http://www.gnu.org/licenses/>.
15
+include gpg

+ 0
- 28
unblank.ps1 View File

@@ -1,28 +0,0 @@
1
-Param($author,$module)
2
-if ($author -match "^\w+$") {
3
-	if ($module -match "^\w+$") {
4
-		echo "Update Modulefile..."
5
-		$modulefile = Get-Content Modulefile.orig
6
-		$modulefile = Foreach-Object {$modulefile -replace "aethylred", $author}
7
-		$modulefile = Foreach-Object {$modulefile -replace "blank", $module}
8
-		Set-Content Modulefile $modulefile
9
-		echo "Modulefile updated."
10
-
11
-		echo "Update manifests/init.pp..."
12
-		$initfile = Get-Content manifests/init.pp.orig
13
-		$initfile = Foreach-Object {$initfile -replace "blank", $module}
14
-		Set-Content manifests/init.pp $initfile
15
-		echo "manifests/init.pp updated."
16
-
17
-		echo "Update tests\init.pp..."
18
-		$testfile = Get-Content tests/init.pp.orig
19
-		$testfile = Foreach-Object {$testfile -replace "blank", $module}
20
-		Set-Content tests/init.pp $testfile
21
-		echo "tests/init.pp updated."
22
-
23
-	} else {
24
-		throw "ERROR: Bad module parameter '$module', must be a single word made up of word caracters [a-zA-Z_0-9]"
25
-	}
26
-} else {
27
-  throw "ERROR: Bad author parameter '$author', must be a single word made up of word caracters [a-zA-Z_0-9]"
28
-}

Loading…
Cancel
Save