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

Side by Side Diff: modules/hgweb/manifests/init.pp

Issue 29469611: #1634 - Update file resource syntax in module hgweb (Closed)
Patch Set: Created June 20, 2017, 4:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # == Class: hgweb 1 # == Class: hgweb
2 # 2 #
3 # A hgweb server setup. 3 # A hgweb server setup.
4 # 4 #
5 # === Parameters: 5 # === Parameters:
6 # 6 #
7 # [*domain*] 7 # [*domain*]
8 # The auhority part of the URL the instance is associated with. 8 # The auhority part of the URL the instance is associated with.
9 # 9 #
10 # [*is_default*] 10 # [*is_default*]
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 comment => 'hgweb', 59 comment => 'hgweb',
60 groups => ['www-data'], 60 groups => ['www-data'],
61 home => '/home/hg', 61 home => '/home/hg',
62 managehome => true, 62 managehome => true,
63 shell => '/bin/bash', 63 shell => '/bin/bash',
64 } 64 }
65 65
66 file {'/home/hg/.ssh': 66 file {'/home/hg/.ssh':
67 ensure => 'directory', 67 ensure => 'directory',
68 group => 'hg', 68 group => 'hg',
69 mode => 0750, 69 mode => '0750',
70 owner => 'hg', 70 owner => 'hg',
71 require => User['hg'], 71 require => User['hg'],
72 } 72 }
73 73
74 file {'/home/hg/web': 74 file {'/home/hg/web':
75 ensure => 'directory', 75 ensure => 'directory',
76 group => 'hg', 76 group => 'hg',
77 mode => 0755, 77 mode => '0755',
78 owner => 'hg', 78 owner => 'hg',
79 require => User['hg'], 79 require => User['hg'],
80 } 80 }
81 81
82 file {'/home/hg/web/hgaccess': 82 file {'/home/hg/web/hgaccess':
83 ensure => 'directory', 83 ensure => 'directory',
84 group => 'hg', 84 group => 'hg',
85 mode => 0644, 85 mode => '0644',
86 owner => 'hg', 86 owner => 'hg',
87 recurse => true, 87 recurse => true,
88 replace => false, 88 replace => false,
89 require => File['/home/hg/web'], 89 require => File['/home/hg/web'],
90 source => $hgaccess, 90 source => $hgaccess,
91 } 91 }
92 92
93 file {'/home/hg/web/hgaccess/.hg/hgrc': 93 file {'/home/hg/web/hgaccess/.hg/hgrc':
94 content => template('hgweb/hgrc.erb'), 94 content => template('hgweb/hgrc.erb'),
95 group => 'hg', 95 group => 'hg',
96 mode => 0644, 96 mode => '0644',
97 owner => 'hg', 97 owner => 'hg',
98 require => [ 98 require => [
99 Class['sitescripts'], 99 Class['sitescripts'],
100 Exec['hgaccess_init'], 100 Exec['hgaccess_init'],
101 ], 101 ],
102 } 102 }
103 103
104 exec {'hgaccess_init': 104 exec {'hgaccess_init':
105 command => 'hg init .', 105 command => 'hg init .',
106 creates => '/home/hg/web/hgaccess/.hg', 106 creates => '/home/hg/web/hgaccess/.hg',
(...skipping 27 matching lines...) Expand all
134 X11Forwarding no 134 X11Forwarding no
135 AllowAgentForwarding no 135 AllowAgentForwarding no
136 GatewayPorts no 136 GatewayPorts no
137 ForceCommand cd ~/web && PYTHONPATH=/opt/sitescripts hg-ssh $HGREPOS 137 ForceCommand cd ~/web && PYTHONPATH=/opt/sitescripts hg-ssh $HGREPOS
138 ', 138 ',
139 order => '99', 139 order => '99',
140 target => 'sshd_config', 140 target => 'sshd_config',
141 } 141 }
142 142
143 file {'/etc/hgweb.ini': 143 file {'/etc/hgweb.ini':
144 mode => 644, 144 mode => '644',
mathias 2017/06/20 17:01:44 Now that we're at it, can't we make it uniform and
145 require => Package[$required_packages], 145 require => Package[$required_packages],
146 source => 'puppet:///modules/hgweb/hgweb.ini', 146 source => 'puppet:///modules/hgweb/hgweb.ini',
147 } 147 }
148 148
149 file {'/opt/hgweb.fcgi': 149 file {'/opt/hgweb.fcgi':
150 mode => 755, 150 mode => '755',
151 require => File['/etc/hgweb.ini'], 151 require => File['/etc/hgweb.ini'],
152 source => 'puppet:///modules/hgweb/hgweb.fcgi', 152 source => 'puppet:///modules/hgweb/hgweb.fcgi',
153 } 153 }
154 154
155 if $::operatingsystem == "Debian" { 155 if $::operatingsystem == "Debian" {
156 file {'init_script': 156 file {'init_script':
157 name => '/etc/systemd/system/hgweb.service', 157 name => '/etc/systemd/system/hgweb.service',
158 mode => 755, 158 mode => '755',
159 require => File['/opt/hgweb.fcgi'], 159 require => File['/opt/hgweb.fcgi'],
160 source => 'puppet:///modules/hgweb/hgweb.service', 160 source => 'puppet:///modules/hgweb/hgweb.service',
161 } 161 }
162 } else { 162 } else {
163 file {'init_script': 163 file {'init_script':
164 name => '/etc/init.d/hgweb', 164 name => '/etc/init.d/hgweb',
165 mode => 755, 165 mode => '755',
166 require => File['/opt/hgweb.fcgi'], 166 require => File['/opt/hgweb.fcgi'],
167 source => 'puppet:///modules/hgweb/hgweb.sh', 167 source => 'puppet:///modules/hgweb/hgweb.sh',
168 } 168 }
169 } 169 }
170 170
171 file {'/home/hg/web/robots.txt': 171 file {'/home/hg/web/robots.txt':
172 group => 'hg', 172 group => 'hg',
173 mode => 0644, 173 mode => '0644',
174 owner => 'hg', 174 owner => 'hg',
175 require => File['/home/hg/web'], 175 require => File['/home/hg/web'],
176 source => 'puppet:///modules/hgweb/robots.txt', 176 source => 'puppet:///modules/hgweb/robots.txt',
177 } 177 }
178 178
179 service {'hgweb': 179 service {'hgweb':
180 enable => true, 180 enable => true,
181 ensure => 'running', 181 ensure => 'running',
182 hasrestart => true, 182 hasrestart => true,
183 hasstatus => false, 183 hasstatus => false,
(...skipping 14 matching lines...) Expand all
198 content => template('hgweb/nginx.conf.erb'), 198 content => template('hgweb/nginx.conf.erb'),
199 is_default => $is_default, 199 is_default => $is_default,
200 global_config => template('hgweb/nginx_global.conf.erb'), 200 global_config => template('hgweb/nginx_global.conf.erb'),
201 log => 'access_log_hg', 201 log => 'access_log_hg',
202 private_key => $private_key ? { 202 private_key => $private_key ? {
203 'undef' => undef, 203 'undef' => undef,
204 default => $private_key, 204 default => $private_key,
205 }, 205 },
206 } 206 }
207 } 207 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld