From fa1bcda166a762477b5bc277d47053e77ccd7219 Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sun, 23 Jun 2013 15:33:39 +1000 Subject: [PATCH 1/5] Comment blocks with link to Puppet doco --- UltiSnips/puppet.snippets | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/UltiSnips/puppet.snippets b/UltiSnips/puppet.snippets index e488038..855e63a 100644 --- a/UltiSnips/puppet.snippets +++ b/UltiSnips/puppet.snippets @@ -1,5 +1,9 @@ # Snippets for Puppet +######################################################################### +# Python helper code # +######################################################################### + global !p import vim import os.path @@ -32,6 +36,12 @@ def get_module_namespace_and_basename(): return "name" endglobal +############################################################################### +# Puppet Language Constructs # +# See http://docs.puppetlabs.com/puppet/latest/reference/lang_summary.html # +# # +############################################################################### + snippet define "Definition" b define ${1:`!p snip.rv = get_module_namespace_and_basename()`} { ${0:# body} @@ -45,6 +55,12 @@ class ${1:`!p snip.rv = get_module_namespace_and_basename()`} { } endsnippet +################################################################# +# Puppet Types # +# See http://docs.puppetlabs.com/references/latest/type.html # +# # +################################################################# + snippet File "Defaults for file" b File { owner => ${1:username}, @@ -114,4 +130,11 @@ service { '${1:name}': } endsnippet +######################################################################## +# Puppet Functions # +# See http://docs.puppetlabs.com/references/latest/function.html # +# # +######################################################################## + + # vim:ft=snippets: From 853eed2242da0ba59e32fd830323011ac84b6e1b Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sun, 23 Jun 2013 15:58:53 +1000 Subject: [PATCH 2/5] Removed superfluous line in the snippet --- UltiSnips/puppet.snippets | 1 - 1 file changed, 1 deletion(-) diff --git a/UltiSnips/puppet.snippets b/UltiSnips/puppet.snippets index 855e63a..dd3ec89 100644 --- a/UltiSnips/puppet.snippets +++ b/UltiSnips/puppet.snippets @@ -46,7 +46,6 @@ snippet define "Definition" b define ${1:`!p snip.rv = get_module_namespace_and_basename()`} { ${0:# body} } - endsnippet snippet class "Class declaration" b From 086e36719639512e44a585c5f85c764d52a9ea4b Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sun, 23 Jun 2013 16:00:15 +1000 Subject: [PATCH 3/5] Re-arranged Lanugage section so it is alphabetized --- UltiSnips/puppet.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UltiSnips/puppet.snippets b/UltiSnips/puppet.snippets index dd3ec89..8f32f90 100644 --- a/UltiSnips/puppet.snippets +++ b/UltiSnips/puppet.snippets @@ -42,14 +42,14 @@ endglobal # # ############################################################################### -snippet define "Definition" b -define ${1:`!p snip.rv = get_module_namespace_and_basename()`} { +snippet class "Class declaration" b +class ${1:`!p snip.rv = get_module_namespace_and_basename()`} { ${0:# body} } endsnippet -snippet class "Class declaration" b -class ${1:`!p snip.rv = get_module_namespace_and_basename()`} { +snippet define "Definition" b +define ${1:`!p snip.rv = get_module_namespace_and_basename()`} { ${0:# body} } endsnippet From 0a3c7288addb07997633a1bf1b686cff62351c44 Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sun, 23 Jun 2013 16:03:30 +1000 Subject: [PATCH 4/5] Re-arranged Types section so it is alphabetized --- UltiSnips/puppet.snippets | 63 +++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/UltiSnips/puppet.snippets b/UltiSnips/puppet.snippets index 8f32f90..d792ec7 100644 --- a/UltiSnips/puppet.snippets +++ b/UltiSnips/puppet.snippets @@ -60,17 +60,18 @@ endsnippet # # ################################################################# -snippet File "Defaults for file" b -File { - owner => ${1:username}, - group => ${2:groupname}, +snippet cron "Cron resource type" b +cron { '${1:name}': + user => ${2:user}, + command => '${3:command}', + minute => ${3:minute}, + hour => ${4:hour}, } endsnippet -# Resource types -snippet package "Package resource type" b -package { '${1:name}': - ensure => ${2:installed}, +snippet exec "Exec resource type" b +exec { '${1:command}': + refreshonly => true, } endsnippet @@ -80,12 +81,34 @@ file { '${1:name}': mode => ${3:mode}, endsnippet +snippet File "Defaults for file" b +File { + owner => ${1:username}, + group => ${2:groupname}, +} +endsnippet + snippet group "Group resource type" b group { '${1:groupname}': ensure => ${3:present}, gid => ${2:gid}, endsnippet +snippet mount "Mount resource type" b +mount { '${1:path}': + device => '${2:/dev}', + fstype => '${3:filesystem}', + ensure => mounted, + options => 'rw,errors=remount-ro', +} +endsnippet + +snippet package "Package resource type" b +package { '${1:name}': + ensure => ${2:installed}, +} +endsnippet + snippet user "user resource type" b user { '${1:username}': ensure => ${2:present}, @@ -97,30 +120,6 @@ user { '${1:username}': require => Group['${7:group'}], endsnippet -snippet exec "Exec resource type" b -exec { '${1:command}': - refreshonly => true, -} -endsnippet - -snippet cron "Cron resource type" b -cron { '${1:name}': - user => ${2:user}, - command => '${3:command}', - minute => ${3:minute}, - hour => ${4:hour}, -} -endsnippet - -snippet mount "Mount resource type" b -mount { '${1:path}': - device => '${2:/dev}', - fstype => '${3:filesystem}', - ensure => mounted, - options => 'rw,errors=remount-ro', -} -endsnippet - snippet service "Service resource type" b service { '${1:name}': hasstatus => true, From 78b53f9d6cd71166f98b0dd86b4a18c90f1014b2 Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sun, 23 Jun 2013 19:53:09 +1000 Subject: [PATCH 5/5] Removed empty lines in the section block comments --- UltiSnips/puppet.snippets | 3 --- 1 file changed, 3 deletions(-) diff --git a/UltiSnips/puppet.snippets b/UltiSnips/puppet.snippets index d792ec7..8e78aa3 100644 --- a/UltiSnips/puppet.snippets +++ b/UltiSnips/puppet.snippets @@ -39,7 +39,6 @@ endglobal ############################################################################### # Puppet Language Constructs # # See http://docs.puppetlabs.com/puppet/latest/reference/lang_summary.html # -# # ############################################################################### snippet class "Class declaration" b @@ -57,7 +56,6 @@ endsnippet ################################################################# # Puppet Types # # See http://docs.puppetlabs.com/references/latest/type.html # -# # ################################################################# snippet cron "Cron resource type" b @@ -131,7 +129,6 @@ endsnippet ######################################################################## # Puppet Functions # # See http://docs.puppetlabs.com/references/latest/function.html # -# # ########################################################################