Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 | 47 |
48 | 48 |
49 user {'hg': | 49 user {'hg': |
50 comment => 'hgweb', | 50 comment => 'hgweb', |
51 groups => ['www-data'], | 51 groups => ['www-data'], |
52 home => '/home/hg', | 52 home => '/home/hg', |
53 managehome => true, | 53 managehome => true, |
54 shell => '/bin/bash', | 54 shell => '/bin/bash', |
55 } | 55 } |
56 | 56 |
57 | |
58 file {'/home/hg/.ssh': | 57 file {'/home/hg/.ssh': |
59 ensure => 'directory', | 58 ensure => 'directory', |
60 group => 'hg', | 59 group => 'hg', |
61 mode => 0750, | 60 mode => 0750, |
62 owner => 'hg', | 61 owner => 'hg', |
63 require => User['hg'], | 62 require => User['hg'], |
64 } | 63 } |
65 | 64 |
66 file {'/home/hg/web': | 65 file {'/home/hg/web': |
67 ensure => 'directory', | 66 ensure => 'directory', |
(...skipping 18 matching lines...) Expand all Loading... | |
86 content => template('hgweb/hgrc.erb'), | 85 content => template('hgweb/hgrc.erb'), |
87 group => 'hg', | 86 group => 'hg', |
88 mode => 0644, | 87 mode => 0644, |
89 owner => 'hg', | 88 owner => 'hg', |
90 require => [ | 89 require => [ |
91 Class['sitescripts'], | 90 Class['sitescripts'], |
92 Exec['hgaccess_init'], | 91 Exec['hgaccess_init'], |
93 ], | 92 ], |
94 } | 93 } |
95 | 94 |
96 | |
97 exec {'hgaccess_init': | 95 exec {'hgaccess_init': |
98 command => 'hg init .', | 96 command => 'hg init .', |
99 creates => '/home/hg/web/hgaccess/.hg', | 97 creates => '/home/hg/web/hgaccess/.hg', |
100 cwd => '/home/hg/web/hgaccess', | 98 cwd => '/home/hg/web/hgaccess', |
101 logoutput => true, | 99 logoutput => true, |
102 path => '/usr/local/bin:/usr/bin:/bin', | 100 path => '/usr/local/bin:/usr/bin:/bin', |
103 require => File['/home/hg/web/hgaccess'], | 101 require => File['/home/hg/web/hgaccess'], |
104 user => 'hg', | 102 user => 'hg', |
105 } | 103 } |
106 | 104 |
107 exec {'hgaccess_commit': | 105 exec {'hgaccess_commit': |
108 command => 'hg add . && hg commit -u Puppet -m "Initial commit"', | 106 command => 'hg add . && hg commit -u Puppet -m "Initial commit"', |
109 creates => '/home/hg/.ssh/authorized_keys', | 107 creates => '/home/hg/.ssh/authorized_keys', |
110 cwd => '/home/hg/web/hgaccess', | 108 cwd => '/home/hg/web/hgaccess', |
111 environment => ['PYTHONPATH=/opt/sitescripts'], | 109 environment => ['PYTHONPATH=/opt/sitescripts'], |
112 logoutput => true, | 110 logoutput => true, |
113 path => '/usr/local/bin:/usr/bin:/bin', | 111 path => '/usr/local/bin:/usr/bin:/bin', |
114 require => [ | 112 require => [ |
115 File['/home/hg/web/hgaccess/.hg/hgrc'], | 113 File['/home/hg/web/hgaccess/.hg/hgrc'], |
116 File['/home/hg/.ssh'], | 114 File['/home/hg/.ssh'], |
117 ], | 115 ], |
118 user => 'hg', | 116 user => 'hg', |
119 } | 117 } |
120 | 118 |
121 | |
Felix Dahlke
2015/08/17 18:05:03
Nit: Superfluous empty line? Can't tell if it's de
mathias
2015/08/17 18:16:45
It isn't. Wasn't.
| |
122 concat::fragment {'sshd_user_hg': | 119 concat::fragment {'sshd_user_hg': |
123 content => 'Match User hg | 120 content => 'Match User hg |
124 AllowTcpForwarding no | 121 AllowTcpForwarding no |
125 X11Forwarding no | 122 X11Forwarding no |
126 AllowAgentForwarding no | 123 AllowAgentForwarding no |
127 GatewayPorts no | 124 GatewayPorts no |
128 ForceCommand cd ~/web && PYTHONPATH=/opt/sitescripts hg-ssh $HGREPOS | 125 ForceCommand cd ~/web && PYTHONPATH=/opt/sitescripts hg-ssh $HGREPOS |
129 ', | 126 ', |
130 order => '99', | 127 order => '99', |
131 target => 'sshd_config', | 128 target => 'sshd_config', |
132 } | 129 } |
133 | |
134 | 130 |
135 file {'/etc/hgweb.ini': | 131 file {'/etc/hgweb.ini': |
136 mode => 644, | 132 mode => 644, |
137 require => Package[$required_packages], | 133 require => Package[$required_packages], |
138 source => 'puppet:///modules/hgweb/hgweb.ini', | 134 source => 'puppet:///modules/hgweb/hgweb.ini', |
139 } | 135 } |
140 | 136 |
141 file {'/opt/hgweb.fcgi': | 137 file {'/opt/hgweb.fcgi': |
142 mode => 755, | 138 mode => 755, |
143 require => File['/etc/hgweb.ini'], | 139 require => File['/etc/hgweb.ini'], |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 }, | 171 }, |
176 source => 'puppet:///modules/hgweb/nginx.conf', | 172 source => 'puppet:///modules/hgweb/nginx.conf', |
177 is_default => $is_default, | 173 is_default => $is_default, |
178 log => 'access_log_hg', | 174 log => 'access_log_hg', |
179 private_key => $private_key ? { | 175 private_key => $private_key ? { |
180 'undef' => undef, | 176 'undef' => undef, |
181 default => $private_key, | 177 default => $private_key, |
182 }, | 178 }, |
183 } | 179 } |
184 } | 180 } |
LEFT | RIGHT |