mirror of
https://github.com/jbowdre/vagrant-saltlab.git
synced 2024-12-28 03:12:19 +00:00
further work on webserver state
- rename apache->webserver state - configure firewall rules to permit http/https - fix index.html path
This commit is contained in:
parent
c63091e3a7
commit
62bd4a6f35
5 changed files with 37 additions and 8 deletions
|
@ -1,7 +0,0 @@
|
|||
install_apache:
|
||||
pkg.installed:
|
||||
- name: {{ pillar['pkgs']['apache'] }}
|
||||
service.running:
|
||||
- require:
|
||||
- pkg: {{ pillar['pkgs']['apache'] }}
|
||||
- name: {{ pillar['pkgs']['apache'] }}
|
|
@ -6,4 +6,4 @@ base:
|
|||
- users
|
||||
'roles:web':
|
||||
- match: grain
|
||||
- apache
|
||||
- webserver
|
||||
|
|
7
srv/salt/webserver/index.html
Normal file
7
srv/salt/webserver/index.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><title>Salt rocks</title></head>
|
||||
<body>
|
||||
<h1>This file brought to you by Salt</h1>
|
||||
</body>
|
||||
</html>
|
25
srv/salt/webserver/init.sls
Normal file
25
srv/salt/webserver/init.sls
Normal file
|
@ -0,0 +1,25 @@
|
|||
install_apache:
|
||||
pkg.installed:
|
||||
- name: {{ pillar['pkgs']['apache'] }}
|
||||
service.running:
|
||||
- name: {{ pillar['pkgs']['apache'] }}
|
||||
- require:
|
||||
- pkg: {{ pillar['pkgs']['apache'] }}
|
||||
|
||||
install_html_file:
|
||||
file.managed:
|
||||
- name: /var/www/html/index.html
|
||||
- source: salt://webserver/index.html
|
||||
- require:
|
||||
- pkg: {{ pillar['pkgs']['apache'] }}
|
||||
|
||||
configure_firewall:
|
||||
pkg.installed:
|
||||
- name: firewalld
|
||||
firewalld.present:
|
||||
- require:
|
||||
- pkg: firewalld
|
||||
- name: public
|
||||
- services:
|
||||
- http
|
||||
- https
|
|
@ -1,3 +1,7 @@
|
|||
uninstall_apache:
|
||||
pkg.removed:
|
||||
- name: {{ pillar['pkgs']['apache'] }}
|
||||
|
||||
remove_html_file:
|
||||
file.absent:
|
||||
- name: /var/www/html/index.html
|
Loading…
Reference in a new issue