Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: modules/adblockplus/manifests/mercurial/extension.pp

Issue 29526640: #3044 - Introduce class adblockplus::mercurial (Closed)
Left Patch Set: Created Aug. 24, 2017, 4:02 p.m.
Right Patch Set: For comment 5 Created Aug. 24, 2017, 6:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « modules/adblockplus/manifests/mercurial.pp ('k') | modules/adblockplus/templates/mercurial/hgext.erb » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # == Type: adblockplus::mercurial::extension 1 # == Type: adblockplus::mercurial::extension
2 # 2 #
3 # Setup rotation for a particular log file. 3 # Setup rotation for a particular log file.
4 # 4 #
5 # === Parameters: 5 # === Parameters:
mathias 2017/08/24 16:40:52 Please document parameters $config and $package, t
f.lopez 2017/08/24 17:45:58 Acknowledged.
6 #
7 # [*config*]
8 # Overwrite the default hgrc.d/$name file for Mercurial extensions.
9 #
10 # [*package*]
11 # Overwrite the default package/extension options.
6 # 12 #
7 # === Examples: 13 # === Examples:
8 # 14 #
9 # adblockplus::mercurial::extension {'example': 15 # adblockplus::mercurial::extension {'example':
10 # name => 'pager', 16 # name => 'pager',
11 # config => { 17 # config => {
12 # content => join([ 18 # content => join([
13 # '[extensions]', 19 # '[extensions]',
14 # 'pager = ', 20 # 'pager = ',
15 # '[pager]', 21 # '[pager]',
16 # 'pager = LESS=FSRX less', 22 # 'pager = LESS=FSRX less',
17 # ], "\n"), 23 # ], "\n"),
18 # } 24 # }
19 # } 25 # }
20 # 26 #
21 # adblockplus::mercurial::extension {'hggit': 27 # adblockplus::mercurial::extension {'hggit':
22 # package => { 28 # package => {
23 # 'ensure' => 'latest', 29 # 'ensure' => 'latest',
24 # 'name' => 'hg-git', 30 # 'name' => 'hg-git',
25 # 'provider' => 'pip', 31 # 'provider' => 'pip',
32 # 'install_options' => ['https://pypi.python.org/pypi/hg-git'],
26 # }, 33 # },
27 # } 34 # }
28 # 35 #
29 # adblockplus::mercurial::extension {'hgext.git': 36 # adblockplus::mercurial::extension {'hgext.git':
30 # package => { 37 # package => {
31 # 'ensure' => 'absent', 38 # 'ensure' => 'absent',
32 # 'name' => 'mercurial-git', 39 # 'name' => 'mercurial-git',
33 # }, 40 # },
34 # } 41 # }
35 # 42 #
(...skipping 17 matching lines...) Expand all
53 # https://forge.puppet.com/puppetlabs/stdlib#merge 60 # https://forge.puppet.com/puppetlabs/stdlib#merge
54 ensure_resource('file', "$name.rc", merge({ 61 ensure_resource('file', "$name.rc", merge({
55 content => $default_content, 62 content => $default_content,
56 ensure => ensure_file_state($adblockplus::mercurial::ensure), 63 ensure => ensure_file_state($adblockplus::mercurial::ensure),
57 path => "/etc/mercurial/hgrc.d/$name.rc", 64 path => "/etc/mercurial/hgrc.d/$name.rc",
58 }, $config)) 65 }, $config))
59 66
60 # https://docs.puppet.com/puppet/latest/lang_relationships.html 67 # https://docs.puppet.com/puppet/latest/lang_relationships.html
61 File["$name.rc"] <- Package['mercurial'] 68 File["$name.rc"] <- Package['mercurial']
62 69
63 ensure_resource('package', 'python-dev')
mathias 2017/08/24 16:40:52 ?
f.lopez 2017/08/24 17:45:58 This is needed for installing pip packages (for hg
64
65 # https://docs.puppet.com/puppet/latest/function.html#defined 70 # https://docs.puppet.com/puppet/latest/function.html#defined
66 if defined('$package') { 71 if defined('$package') {
67 72
68 ensure_resource('package', $name, merge({ 73 ensure_resource('package', $name, merge({
69 ensure => $adblockplus::mercurial::ensure, 74 ensure => $adblockplus::mercurial::ensure,
70 require => Package['python-dev'], 75 require => Package['python-dev'],
71 }, $package)) 76 }, $package))
72 77
73 Package[$name] <- Package['mercurial'] 78 Package[$name] <- Package['mercurial']
74 } 79 }
75 } 80 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld