latest WIP
This commit is contained in:
16
Sublime/Puppet/Snippets/Parameter.tmSnippet
Normal file
16
Sublime/Puppet/Snippets/Parameter.tmSnippet
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>${1:name} => "${2:value}",$0</string>
|
||||
<key>name</key>
|
||||
<string>Parameter</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>=</string>
|
||||
<key>uuid</key>
|
||||
<string>8261BD6F-38ED-4AB3-A20B-29AFDE01EE36</string>
|
||||
</dict>
|
||||
</plist>
|
||||
74
Sublime/Puppet/Snippets/baseclass.sublime-snippet
Normal file
74
Sublime/Puppet/Snippets/baseclass.sublime-snippet
Normal file
@@ -0,0 +1,74 @@
|
||||
<snippet>
|
||||
<content><![CDATA[# Class: ${1:name}
|
||||
#
|
||||
# This class installs ${1:name}
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# Actions:
|
||||
# - Install ${1:name}
|
||||
# - Manage ${1:name} service
|
||||
#
|
||||
# Requires:
|
||||
#
|
||||
# Sample Usage:
|
||||
#
|
||||
class ${1:name} \{
|
||||
class install \{
|
||||
package \{
|
||||
"${2:package}":
|
||||
ensure => present;
|
||||
\}
|
||||
\}
|
||||
|
||||
class config \{
|
||||
file \{
|
||||
"/etc/${1:name}":
|
||||
ensure => directory,
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 700,
|
||||
require => Class["install"];
|
||||
|
||||
"/etc/${1:name}/${3:config}":
|
||||
ensure => present,
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 600,
|
||||
require => Class["install"];
|
||||
#content => template ("${1:name}/${3:config}.erb");
|
||||
#source => [
|
||||
# "puppet://$server/modules/${1:name}/\$\{fqdn\}.conf",
|
||||
# "puppet://$server/modules/${1:name}/${1:name}.conf"
|
||||
#];
|
||||
\}
|
||||
|
||||
#logrotate::file { "${1:name}":
|
||||
# source => "/etc/logrotate.d/${1:name}",
|
||||
# log => "/var/log/${4:logfile}.log",
|
||||
#\}
|
||||
\}
|
||||
|
||||
class service \{
|
||||
service \{ "${1:name}":
|
||||
enable => true,
|
||||
ensure => running,
|
||||
#hasrestart => true,
|
||||
#hasstatus => true,
|
||||
require => Class["config"],
|
||||
\}
|
||||
\}
|
||||
|
||||
include install
|
||||
include config
|
||||
include service
|
||||
|
||||
Class["install"] ->
|
||||
Class["config"] ->
|
||||
Class["service"]
|
||||
\}
|
||||
${0}]]></content>
|
||||
<tabTrigger>baseclass</tabTrigger>
|
||||
<scope>source.puppet</scope>
|
||||
<description>baseclass</description>
|
||||
</snippet>
|
||||
23
Sublime/Puppet/Snippets/case.tmSnippet
Normal file
23
Sublime/Puppet/Snippets/case.tmSnippet
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>case \$${1:variable} {
|
||||
"${2:value}": {
|
||||
${3:# code}
|
||||
}
|
||||
default: {
|
||||
${4:# code}
|
||||
}
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>case</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>case</string>
|
||||
<key>uuid</key>
|
||||
<string>4C76CA5D-F7F7-4354-AAAD-1F8B00D73823</string>
|
||||
</dict>
|
||||
</plist>
|
||||
21
Sublime/Puppet/Snippets/class.tmSnippet
Normal file
21
Sublime/Puppet/Snippets/class.tmSnippet
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string># Class: $1
|
||||
#
|
||||
#
|
||||
class ${1:name} {
|
||||
${2:# resources}
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>class</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>class</string>
|
||||
<key>uuid</key>
|
||||
<string>2D3C6C03-B268-42B1-A856-33FB0437B00E</string>
|
||||
</dict>
|
||||
</plist>
|
||||
23
Sublime/Puppet/Snippets/cron.tmSnippet
Normal file
23
Sublime/Puppet/Snippets/cron.tmSnippet
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>cron { "${1:name}":
|
||||
command => "${2:command}",
|
||||
user => "${3:root}",
|
||||
month => "${4:*}",
|
||||
monthday => "${5:*}",
|
||||
hour => "${6:*}",
|
||||
minute => "${7:*}",
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>cron</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>cron</string>
|
||||
<key>uuid</key>
|
||||
<string>C22C1778-E61D-40EC-8E06-4B4A5ABEC0E7</string>
|
||||
</dict>
|
||||
</plist>
|
||||
22
Sublime/Puppet/Snippets/define.tmSnippet
Normal file
22
Sublime/Puppet/Snippets/define.tmSnippet
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string># Define: $1
|
||||
# Parameters:
|
||||
# $2
|
||||
#
|
||||
define ${1:name} (${2:arguments}) {
|
||||
${3:# puppet code}
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>define</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>define</string>
|
||||
<key>uuid</key>
|
||||
<string>22538B08-D4D6-4172-B672-77893A6D8E40</string>
|
||||
</dict>
|
||||
</plist>
|
||||
18
Sublime/Puppet/Snippets/else.tmSnippet
Normal file
18
Sublime/Puppet/Snippets/else.tmSnippet
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>else {
|
||||
${1:# enter puppet code}
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>else</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>else</string>
|
||||
<key>uuid</key>
|
||||
<string>B3E52D1C-3A49-44FA-8D1E-2910567F22C4</string>
|
||||
</dict>
|
||||
</plist>
|
||||
20
Sublime/Puppet/Snippets/exec.tmSnippet
Normal file
20
Sublime/Puppet/Snippets/exec.tmSnippet
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>exec { "${1:name}":
|
||||
command => "${2:/bin/echo}",
|
||||
#path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin",
|
||||
#refreshonly => true,
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>exec</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>exec</string>
|
||||
<key>uuid</key>
|
||||
<string>849952B4-0D8A-4B5F-996D-35D531AAAE81</string>
|
||||
</dict>
|
||||
</plist>
|
||||
18
Sublime/Puppet/Snippets/file.tmSnippet
Normal file
18
Sublime/Puppet/Snippets/file.tmSnippet
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>file { "${1:name}":
|
||||
ensure => ${2:file},
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>file</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>file</string>
|
||||
<key>uuid</key>
|
||||
<string>C84524F5-B248-4A4B-87B9-69DCA93C393F</string>
|
||||
</dict>
|
||||
</plist>
|
||||
18
Sublime/Puppet/Snippets/group.tmSnippet
Normal file
18
Sublime/Puppet/Snippets/group.tmSnippet
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>group { "${1:name}":
|
||||
gid => $2,
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>group</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>group</string>
|
||||
<key>uuid</key>
|
||||
<string>44C1B58A-0EF0-4022-A9EF-2D3B432C83FE</string>
|
||||
</dict>
|
||||
</plist>
|
||||
18
Sublime/Puppet/Snippets/if.tmSnippet
Normal file
18
Sublime/Puppet/Snippets/if.tmSnippet
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>if ${1:test} {
|
||||
${2:# enter puppet code}
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>if</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>if</string>
|
||||
<key>uuid</key>
|
||||
<string>A60AC7AD-8710-4CCB-9A52-D8B84ABDD521</string>
|
||||
</dict>
|
||||
</plist>
|
||||
18
Sublime/Puppet/Snippets/package.tmSnippet
Normal file
18
Sublime/Puppet/Snippets/package.tmSnippet
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>package { "${1:name}":
|
||||
ensure => ${2:installed},
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>package</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>package</string>
|
||||
<key>uuid</key>
|
||||
<string>1A1C51EE-AC6D-4F7F-A342-4D6DE1F4FAD3</string>
|
||||
</dict>
|
||||
</plist>
|
||||
19
Sublime/Puppet/Snippets/selector.tmSnippet
Normal file
19
Sublime/Puppet/Snippets/selector.tmSnippet
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>\$${1:variable} ? {
|
||||
"${2:key}" => "${3:value}",
|
||||
default => "${4:value}",
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>selector</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>?</string>
|
||||
<key>uuid</key>
|
||||
<string>88BA23C0-A6AD-4115-A765-9074BB8C85BD</string>
|
||||
</dict>
|
||||
</plist>
|
||||
13
Sublime/Puppet/Snippets/service.sublime-snippet
Normal file
13
Sublime/Puppet/Snippets/service.sublime-snippet
Normal file
@@ -0,0 +1,13 @@
|
||||
<snippet>
|
||||
<content><![CDATA[service \{ "$1":
|
||||
enable => true,
|
||||
ensure => running,
|
||||
#hasrestart => true,
|
||||
#hasstatus => true,
|
||||
#require => Class["config"],
|
||||
\}
|
||||
]]></content>
|
||||
<tabTrigger>service</tabTrigger>
|
||||
<scope>source.puppet</scope>
|
||||
<description>service</description>
|
||||
</snippet>
|
||||
23
Sublime/Puppet/Snippets/user.tmSnippet
Normal file
23
Sublime/Puppet/Snippets/user.tmSnippet
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>user { "${1:name}":
|
||||
comment => "${2:First Last}",
|
||||
home => "${3:/home/$1}",
|
||||
ensure => ${4:present},
|
||||
#shell => "/bin/bash",
|
||||
#uid => '501',
|
||||
#gid => '20'
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>user</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>user</string>
|
||||
<key>uuid</key>
|
||||
<string>831FA574-7FC1-47B7-BDD3-67E3E94E8188</string>
|
||||
</dict>
|
||||
</plist>
|
||||
23
Sublime/Puppet/Snippets/yumrepo.tmSnippet
Normal file
23
Sublime/Puppet/Snippets/yumrepo.tmSnippet
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>yumrepo { "${1:name}":
|
||||
baseurl => "${2}",
|
||||
descr => "${3:The $1 repository}",
|
||||
enabled => "${4:1}",
|
||||
gpgcheck => "${5:1}",
|
||||
gpgkey => "${6:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-$1}",
|
||||
mirrorlist => "${7}"
|
||||
}$0</string>
|
||||
<key>name</key>
|
||||
<string>yumrepo</string>
|
||||
<key>scope</key>
|
||||
<string>source.puppet</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>yumrepo</string>
|
||||
<key>uuid</key>
|
||||
<string>7AC2033D-9B16-4127-8E03-0F8AD7220920</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user