Merge remote-tracking branch 'upstream/master' into feature/function_snippets
Conflicts: UltiSnips/puppet.snippets
This commit is contained in:
commit
86b126f8c1
@ -1,5 +1,9 @@
|
|||||||
# Snippets for Puppet
|
# Snippets for Puppet
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
# Python helper code #
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
global !p
|
global !p
|
||||||
import vim
|
import vim
|
||||||
import os.path
|
import os.path
|
||||||
@ -32,12 +36,10 @@ def get_module_namespace_and_basename():
|
|||||||
return "name"
|
return "name"
|
||||||
endglobal
|
endglobal
|
||||||
|
|
||||||
snippet define "Definition" b
|
###############################################################################
|
||||||
define ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
# Puppet Language Constructs #
|
||||||
${0:# body}
|
# See http://docs.puppetlabs.com/puppet/latest/reference/lang_summary.html #
|
||||||
}
|
###############################################################################
|
||||||
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet class "Class declaration" b
|
snippet class "Class declaration" b
|
||||||
class ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
class ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
||||||
@ -45,17 +47,29 @@ class ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
|||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet File "Defaults for file" b
|
snippet define "Definition" b
|
||||||
File {
|
define ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
|
||||||
owner => ${1:username},
|
${0:# body}
|
||||||
group => ${2:groupname},
|
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
# Resource types
|
#################################################################
|
||||||
snippet package "Package resource type" b
|
# Puppet Types #
|
||||||
package { '${1:name}':
|
# See http://docs.puppetlabs.com/references/latest/type.html #
|
||||||
ensure => ${2:installed},
|
#################################################################
|
||||||
|
|
||||||
|
snippet cron "Cron resource type" b
|
||||||
|
cron { '${1:name}':
|
||||||
|
user => ${2:user},
|
||||||
|
command => '${3:command}',
|
||||||
|
minute => ${3:minute},
|
||||||
|
hour => ${4:hour},
|
||||||
|
}
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet exec "Exec resource type" b
|
||||||
|
exec { '${1:command}':
|
||||||
|
refreshonly => true,
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@ -65,12 +79,34 @@ file { '${1:name}':
|
|||||||
mode => ${3:mode},
|
mode => ${3:mode},
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet File "Defaults for file" b
|
||||||
|
File {
|
||||||
|
owner => ${1:username},
|
||||||
|
group => ${2:groupname},
|
||||||
|
}
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet group "Group resource type" b
|
snippet group "Group resource type" b
|
||||||
group { '${1:groupname}':
|
group { '${1:groupname}':
|
||||||
ensure => ${3:present},
|
ensure => ${3:present},
|
||||||
gid => ${2:gid},
|
gid => ${2:gid},
|
||||||
endsnippet
|
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
|
snippet user "user resource type" b
|
||||||
user { '${1:username}':
|
user { '${1:username}':
|
||||||
ensure => ${2:present},
|
ensure => ${2:present},
|
||||||
@ -82,30 +118,6 @@ user { '${1:username}':
|
|||||||
require => Group['${7:group'}],
|
require => Group['${7:group'}],
|
||||||
endsnippet
|
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
|
snippet service "Service resource type" b
|
||||||
service { '${1:name}':
|
service { '${1:name}':
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
@ -117,7 +129,6 @@ endsnippet
|
|||||||
########################################################################
|
########################################################################
|
||||||
# Puppet Functions #
|
# Puppet Functions #
|
||||||
# See http://docs.puppetlabs.com/references/latest/function.html #
|
# See http://docs.puppetlabs.com/references/latest/function.html #
|
||||||
# #
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
snippet alert "Alert Function" !b
|
snippet alert "Alert Function" !b
|
||||||
|
Loading…
Reference in New Issue
Block a user