Skip to content

Commit 0f10eb0

Browse files
authored
Merge pull request #163 from OpenVoxProject/follow-style-guide
Follow the style-guide
2 parents dd9be59 + c804bd2 commit 0f10eb0

34 files changed

Lines changed: 416 additions & 385 deletions

docs/_openvox_8x/cheatsheet_core_types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ If a service has a bad init script, you can work around it and manage almost any
151151
Logs an arbitrary message, at the `notice` log level. This appears in the POSIX syslog or Windows Event Log on the Puppet agent node and is also logged in reports.
152152

153153
``` puppet
154-
notify { "This message is getting logged on the agent node.": }
154+
notify { 'This message is getting logged on the agent node.': }
155155
```
156156

157157
{:.section}
@@ -194,8 +194,8 @@ Executes an arbitrary command on the agent node. When using execs, you must eith
194194
Manages cron jobs. Largely self-explanatory. On Windows, you should use [`scheduled_task`](./type.html#scheduledtask) instead.
195195

196196
cron { 'logrotate':
197-
command => "/usr/sbin/logrotate",
198-
user => "root",
197+
command => '/usr/sbin/logrotate',
198+
user => 'root',
199199
hour => 2,
200200
minute => 0,
201201
}
@@ -219,7 +219,7 @@ Manages cron jobs. Largely self-explanatory. On Windows, you should use [`schedu
219219

220220
Manages user accounts; mostly used for system users.
221221

222-
user { "jane":
222+
user { 'jane':
223223
ensure => present,
224224
uid => '507',
225225
gid => 'admin',

docs/_openvox_8x/cheatsheet_module.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,22 @@ This directory holds the module's Puppet code.
4040

4141
**apache/manifests/init.pp**
4242

43-
```
43+
``` puppet
4444
class apache {
45-
...
45+
...
4646
}
4747
```
4848

4949
`init.pp` is special; it should contain a class (or defined type) with the same name as the module.
5050

5151
**apache/manifests/vhost.pp**
5252

53-
```
54-
define apache::vhost
55-
($port, $docroot)
56-
{
57-
...
53+
``` puppet
54+
define apache::vhost(
55+
$port,
56+
$docroot,
57+
) {
58+
...
5859
}
5960
```
6061

@@ -64,9 +65,9 @@ Other classes (and defined types) should be named
6465

6566
**apache/manifests/config/ssl.pp**
6667

67-
```
68+
``` puppet
6869
class apache::config::ssl {
69-
...
70+
...
7071
}
7172
```
7273

@@ -87,8 +88,8 @@ filename`.
8788

8889
To fetch this file:
8990

90-
```
91-
file {'/etc/apache2/httpd.conf':
91+
``` puppet
92+
file { '/etc/apache2/httpd.conf':
9293
ensure => file,
9394
source => 'puppet:///modules/apache/httpd.conf',
9495
}
@@ -98,8 +99,8 @@ file {'/etc/apache2/httpd.conf':
9899

99100
Puppet's file server can navigate any subdirectories:
100101

101-
```
102-
file {'/etc/apache2/httpd-ssl.conf':
102+
``` puppet
103+
file { '/etc/apache2/httpd-ssl.conf':
103104
ensure => file,
104105
source => 'puppet:///modules/apache/extra/ssl',
105106
}
@@ -132,7 +133,7 @@ This directory holds ERB templates.
132133

133134
To use this template:
134135

135-
```
136+
``` puppet
136137
file {'/etc/apache2/sites-enabled/wordpress.conf':
137138
ensure => file,
138139
content => template('apache/vhost.erb'),

docs/_openvox_8x/custom_types.markdown

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ You can and should write a string describing the resource type and assign it to
9090
The string should be in [Markdown][] format (avoiding dialect-specific features that aren't universally supported). When the Puppet tools extract the string, they will strip the greatest common amount of leading whitespace from the front of each line, excluding the first line. For example:
9191

9292
``` ruby
93-
Puppet::Type.newtype(:database) do
94-
@doc = %q{Creates a new database. Depending
95-
on the provider, this might create relational
96-
databases or NoSQL document stores.
97-
98-
Example:
99-
100-
database {'mydatabase':
101-
ensure => present,
102-
owner => root,
103-
}
104-
}
105-
end
93+
Puppet::Type.newtype(:database) do
94+
@doc = %q{Creates a new database. Depending
95+
on the provider, this might create relational
96+
databases or NoSQL document stores.
97+
98+
Example:
99+
100+
database { 'mydatabase':
101+
ensure => present,
102+
owner => root,
103+
}
104+
}
105+
end
106106
```
107107

108108
In this example, any whitespace would be trimmed from the first line (in this case, it's zero spaces), then the greatest common amount would be trimmed from remaining lines. Three lines have four leading spaces, two lines have six, and two lines have eight, so four leading spaces would be trimmed from each line. This leaves the example code block indented by four spaces, and thus doesn't break the Markdown formatting.

docs/_openvox_8x/designing_advanced_profiles.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ class profile::jenkins::master (
585585
# ...
586586
if $jenkins_logs_to_syslog {
587587
jenkins::sysconfig { 'JENKINS_LOG':
588-
value => "$jenkins_logs_to_syslog",
588+
value => $jenkins_logs_to_syslog,
589589
}
590590
}
591591
# ...
@@ -634,7 +634,7 @@ class profile::jenkins::master (
634634
+ # separate log file eg. daemon.info
635635
+ if $jenkins_logs_to_syslog {
636636
+ jenkins::sysconfig { 'JENKINS_LOG':
637-
+ value => "$jenkins_logs_to_syslog",
637+
+ value => $jenkins_logs_to_syslog,
638638
+ }
639639
+ }
640640
+
@@ -974,7 +974,7 @@ class profile::jenkins::master (
974974
# separate log file eg. daemon.info
975975
if $jenkins_logs_to_syslog {
976976
jenkins::sysconfig { 'JENKINS_LOG':
977-
value => "$jenkins_logs_to_syslog",
977+
value => $jenkins_logs_to_syslog,
978978
}
979979
}
980980

docs/_openvox_8x/lang_classes.markdown

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ class base::linux {
6969
``` puppet
7070
# A class with parameters
7171
class apache (String $version = 'latest') {
72-
package {'httpd':
72+
package { 'httpd':
7373
ensure => $version, # Using the class parameter from above
7474
before => File['/etc/httpd.conf'],
7575
}
76-
file {'/etc/httpd.conf':
76+
file { '/etc/httpd.conf':
7777
ensure => file,
7878
owner => 'httpd',
7979
content => template('apache/httpd.conf.erb'), # Template from a module
8080
}
81-
service {'httpd':
81+
service { 'httpd':
8282
ensure => running,
8383
enable => true,
8484
subscribe => File['/etc/httpd.conf'],
@@ -209,7 +209,7 @@ Some resource attributes, such as the [relationship metaparameters][relationship
209209

210210
``` puppet
211211
class apache {
212-
service {'apache':
212+
service { 'apache':
213213
require => Package['httpd'],
214214
}
215215
}
@@ -371,11 +371,11 @@ Resource-like declarations look like [normal resource declarations][resource_dec
371371

372372
``` puppet
373373
# Specifying the "version" parameter:
374-
class {'apache':
374+
class { 'apache':
375375
version => '2.2.21',
376376
}
377377
# Declaring a class with no parameters:
378-
class {'base::linux':}
378+
class { 'base::linux': }
379379
```
380380

381381
Resource-like declarations use [resource-like behavior][resource-like]. (Multiple declarations prohibited; parameters can be overridden at compile-time.) You can provide a value for any class parameter by specifying it as resource attribute; any parameters not specified will follow the normal external/default/fail lookup path.
@@ -384,7 +384,7 @@ In addition to class-specific parameters, you can also specify a value for any [
384384

385385
``` puppet
386386
# Cause the entire class to be noop:
387-
class {'apache':
387+
class { 'apache':
388388
noop => true,
389389
}
390390
```

docs/_openvox_8x/lang_comments.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Shell-style comments (also known as Ruby-style comments) begin with a hash symbo
1212

1313
``` puppet
1414
# This is a comment
15-
file {'/etc/ntp.conf': # This is another comment
15+
file { '/etc/ntp.conf': # This is another comment
1616
ensure => file,
1717
owner => root,
1818
}

docs/_openvox_8x/lang_containment.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ntp {
3232
}
3333
3434
include ntp
35-
exec {'/usr/local/bin/update_custom_timestamps.sh':
35+
exec { '/usr/local/bin/update_custom_timestamps.sh':
3636
require => Class['ntp'],
3737
}
3838
```

docs/_openvox_8x/lang_data_resource_reference.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ They can be used wherever an array of references might be used. They can also go
6464
You can use a resource reference to access the values of a [resource][]'s attributes. To access a value, use square brackets and the name of an attribute (as a [string][]). This works much like [accessing hash values.][hash access]
6565

6666
``` puppet
67-
file { "/etc/first.conf":
67+
file { '/etc/first.conf':
6868
ensure => file,
69-
mode => "0644",
70-
owner => "root",
69+
mode => '0644',
70+
owner => 'root',
7171
}
7272
73-
file { "/etc/second.conf":
73+
file { '/etc/second.conf':
7474
ensure => file,
75-
mode => File["/etc/first.conf"]["mode"],
76-
owner => File["/etc/first.conf"]["owner"],
75+
mode => File['/etc/first.conf']['mode'],
76+
owner => File['/etc/first.conf']['owner'],
7777
}
7878
```
7979

@@ -115,7 +115,7 @@ To allow a resource reference of a _specific_ resource type --- in this example,
115115

116116
``` puppet
117117
Type[File] # Capitalized resource type name
118-
Type[Resource["file"]] # `Resource` data type, with type name in parameter as a string
118+
Type[Resource['file']] # `Resource` data type, with type name in parameter as a string
119119
Type[Resource[File]] # `Resource` data type, with capitalized resource type name
120120
```
121121

docs/_openvox_8x/lang_data_resource_type.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,24 @@ For example:
4040

4141
``` puppet
4242
# A resource declaration using a resource data type:
43-
File { "/etc/ntp.conf":
44-
mode => "0644",
45-
owner => "root",
46-
group => "root",
43+
File { '/etc/ntp.conf':
44+
mode => '0644',
45+
owner => 'root',
46+
group => 'root',
4747
}
4848
4949
# Equivalent to the above:
50-
Resource["file"] { "/etc/ntp.conf":
51-
mode => "0644",
52-
owner => "root",
53-
group => "root",
50+
Resource['file'] { '/etc/ntp.conf':
51+
mode => '0644',
52+
owner => 'root',
53+
group => 'root',
5454
}
5555
5656
# A resource default:
5757
File {
58-
mode => "0644",
59-
owner => "root",
60-
group => "root",
58+
mode => '0644',
59+
owner => 'root',
60+
group => 'root',
6161
}
6262
```
6363

@@ -119,21 +119,21 @@ All of these parameters are optional. They must be listed in order; if you need
119119

120120
Position | Parameter | Data Type | Default Value | Description
121121
---------| -----------------|-----------|---------------|------------
122-
1 | Resource type | `String` or `Resource` | nothing | A resource type, either as a string or a `Resource` data type value. If provided, this will turn this data type into a resource-specific data type. `Resource[Mytype]` and `Resource["mytype"]` are both 100% identical to the data type `Mytype`.
123-
2–∞ | Resource title | `String` | nothing | The title of some specific resource of this type. If provided, this will turn this data type into a usable [resource reference][] or array of resource references. `Resource[Mytype, "mytitle"]` and `Resource["mytype", "mytitle"]` are both 100% identical to the data type `Mytype["mytitle"]`.
122+
1 | Resource type | `String` or `Resource` | nothing | A resource type, either as a string or a `Resource` data type value. If provided, this will turn this data type into a resource-specific data type. `Resource[Mytype]` and `Resource['mytype']` are both 100% identical to the data type `Mytype`.
123+
2–∞ | Resource title | `String` | nothing | The title of some specific resource of this type. If provided, this will turn this data type into a usable [resource reference][] or array of resource references. `Resource[Mytype, 'mytitle']` and `Resource['mytype', 'mytitle']` are both 100% identical to the data type `Mytype['mytitle']`.
124124

125125

126126
### Examples
127127

128128
* `Resource[File]` --- the data type corresponding to the `file` resource type.
129129
* `Resource[File, '/tmp/foo']` --- a resource reference to the `file` resource whose title is `/tmp/foo`.
130-
* `Resource["file", '/tmp/foo']` --- a resource reference to the `file` resource whose title is `/tmp/foo`.
130+
* `Resource['file', '/tmp/foo']` --- a resource reference to the `file` resource whose title is `/tmp/foo`.
131131
* `Resource[File, '/tmp/foo', '/tmp/bar']` --- equivalent to `[ File['/tmp/foo'], File['/tmp/bar'] ]`.
132132

133133
Also:
134134

135135
* `Type[Resource[File]]` --- a synonym for the data type that _matches_ any [resource references][resource reference] to `file` resources. This is useful for, e.g., restricting the values of class or defined type parameters.
136-
* `Type[Resource["file"]]` --- another synonym for the data type that _matches_ any [resource references][resource reference] to `file` resources. This is useful for, e.g., restricting the values of class or defined type parameters.
136+
* `Type[Resource['file']]` --- another synonym for the data type that _matches_ any [resource references][resource reference] to `file` resources. This is useful for, e.g., restricting the values of class or defined type parameters.
137137

138138

139139
## The `Class` data type
@@ -159,7 +159,7 @@ Position | Parameter | Data Type | Default Value | Description
159159

160160
### Examples
161161

162-
* `Class["apache"]` --- a [class reference][] to class `apache`.
162+
* `Class['apache']` --- a [class reference][] to class `apache`.
163163

164164
Also:
165165

docs/_openvox_8x/lang_data_string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Each of these have slightly different behavior around syntax, interpolation feat
3838
## Bare words
3939

4040
``` puppet
41-
service { "ntp":
41+
service { 'ntp':
4242
ensure => running, # bare word string
4343
}
4444
```

0 commit comments

Comments
 (0)