author | ymh <ymh.work@gmail.com> |
Fri, 23 Dec 2016 13:23:50 +0100 | |
changeset 485 | 7b84847868a9 |
parent 428 | 76a47f714766 |
permissions | -rw-r--r-- |
28 | 1 |
class sysconfig::apache ( |
2 |
$vhost = hiera('sysconfig::params::vhost', $sysconfig::params::vhost), |
|
3 |
) inherits sysconfig::params { |
|
4 |
notify {'apache': name => "\$vhost : ${vhost}", withpath => true } |
|
5 |
||
6 |
$apache_packages = [ |
|
7 |
'httpd' |
|
8 |
] |
|
9 |
$corpus_folders = [ |
|
10 |
"/var/www/corpusdelaparole", |
|
318
5564f5065f81
add a root url for corpus back apis. it is set to the same than root api for the moment
ymh <ymh.work@gmail.com>
parents:
28
diff
changeset
|
11 |
"/var/www/corpusdelaparole/corpus-back", |
28 | 12 |
"/var/www/corpusdelaparole/drupal" |
13 |
] |
|
14 |
||
15 |
package { $apache_packages: |
|
16 |
ensure => present, |
|
17 |
} |
|
18 |
||
19 |
service { "httpd": |
|
20 |
ensure => running, |
|
21 |
enable => true, |
|
22 |
require => Package['httpd'] |
|
23 |
} |
|
24 |
||
25 |
file { $corpus_folders: |
|
26 |
ensure => directory, |
|
27 |
owner => 'apache', |
|
28 |
group => 'apache', |
|
29 |
require => Package['httpd'] |
|
30 |
} |
|
31 |
||
32 |
file { "/etc/www": |
|
33 |
ensure => directory, |
|
34 |
} |
|
35 |
||
36 |
file { ["/etc/httpd/conf.d/userdir.conf", "/etc/httpd/conf.d/autoindex.conf"]: |
|
37 |
ensure => absent, |
|
38 |
require => Package['httpd'], |
|
39 |
notify => Service['httpd'] |
|
40 |
} |
|
41 |
file { "/etc/httpd/conf/httpd.conf": |
|
42 |
ensure => file, |
|
43 |
source => "puppet:///modules/sysconfig/httpd/httpd.conf", |
|
44 |
require => Package['httpd'], |
|
45 |
notify => Service['httpd'] |
|
46 |
} |
|
47 |
file { "/etc/httpd/conf.d/welcome.conf": |
|
48 |
ensure => file, |
|
49 |
source => "puppet:///modules/sysconfig/httpd/welcome.conf", |
|
50 |
require => Package['httpd'], |
|
51 |
notify => Service['httpd'] |
|
52 |
} |
|
53 |
file { "/etc/httpd/conf.d/10-corpusdelaparole.conf": |
|
54 |
ensure => file, |
|
55 |
content => template("sysconfig/httpd/vhost.conf.erb"), |
|
56 |
require => [Package['httpd'], File['/etc/www'], File[$corpus_folders]], |
|
57 |
notify => Service['httpd'] |
|
58 |
} |
|
59 |
||
60 |
exec { "open-http-port": |
|
61 |
command => "firewall-cmd --permanent --add-port=80/tcp", |
|
62 |
path => [ '/bin', '/usr/bin', '/usr/local/bin' ] |
|
63 |
}-> |
|
64 |
exec { "open-http-port-reload": |
|
65 |
command => "firewall-cmd --reload", |
|
66 |
path => [ '/bin', '/usr/bin', '/usr/local/bin' ] |
|
67 |
} |
|
68 |
||
69 |
#remove |
|
70 |
#/etc/httpd/conf.d/userdir.conf |
|
71 |
#/etc/httpd/conf.d/autotindex.conf |
|
72 |
#/etc/httpd/conf.d/welcome.conf |
|
73 |
||
74 |
} |