summaryrefslogtreecommitdiffstats
path: root/salt/profile/lighttpd/init.sls
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-01-15 09:45:04 +0100
committerGeorg Pfuetzenreuter2023-01-15 09:45:04 +0100
commit2b40942a442a0f15b2d75289d4977a114cd81e72 (patch)
treef82a2d89b523fd9f323297f4b67384b9a722aa77 /salt/profile/lighttpd/init.sls
parentf1a4b0514c148d9b5477f5c2b11938445e4438b1 (diff)
downloadsalt-2b40942a442a0f15b2d75289d4977a114cd81e72.tar.gz
salt-2b40942a442a0f15b2d75289d4977a114cd81e72.tar.bz2
salt-2b40942a442a0f15b2d75289d4977a114cd81e72.zip
Import profiles/roles from salt-devel
- + renaming baseline to common Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'salt/profile/lighttpd/init.sls')
-rw-r--r--salt/profile/lighttpd/init.sls42
1 files changed, 42 insertions, 0 deletions
diff --git a/salt/profile/lighttpd/init.sls b/salt/profile/lighttpd/init.sls
new file mode 100644
index 0000000..1d4f9e9
--- /dev/null
+++ b/salt/profile/lighttpd/init.sls
@@ -0,0 +1,42 @@
+{%- set mypillar = 'profile:lighttpd' -%}
+{%- set vhosts = salt['pillar.get'](mypillar ~ ':vhosts') or [] -%}
+
+lighttpd_packages:
+ pkg.installed:
+ - pkgs:
+ - lighttpd
+
+{%- if vhosts | length > 0 %}
+lighttpd_directories:
+ file.directory:
+ - user: root
+ - group: lighttpd
+ - mode: '0750'
+ - clean: True
+ - require:
+ - pkg: lighttpd_packages
+ - file: lighttpd_files
+ - names:
+ - /etc/lighttpd/vhosts.d
+
+lighttpd_files:
+ file.managed:
+ - user: root
+ - group: lighttpd
+ - mode: '0640'
+ - template: jinja
+ - names:
+ - /etc/lighttpd/lighttpd.conf:
+ - source: salt:///{{ slspath }}/files/etc/lighttpd/lighttpd.conf.j2
+{%- for vhost, config in vhosts.items() %}
+ - /etc/lighttpd/vhosts.d/{{ vhost }}.conf:
+ - source: salt:///{{ slspath }}/files/etc/lighttpd/vhosts.conf.j2
+ - context:
+ vhostconfig: {{ config }}
+{%- endfor %}
+{%- endif %}
+
+lighttpd_service:
+ service.running:
+ - name: lighttpd.service
+ - enable: True