Christian Boltz 856cd0
# zypper-formula already uses/blocks the "apache2" name :-(
Christian Boltz 856cd0
apache2_running:
Christian Boltz 856cd0
  service.running:
Christian Boltz 856cd0
    - enable: True
Christian Boltz 856cd0
    - name: apache2
Christian Boltz 856cd0
Christian Boltz 37c275
{% set mediawiki = salt['pillar.get']('mediawiki:wikis', {}) %}
Christian Boltz 37c275
{% for wiki, data in mediawiki.items() %}
Christian Boltz 856cd0
Christian Boltz 856cd0
/etc/apache2/vhosts.d/{{ wiki }}.opensuse.org.conf:
Christian Boltz 856cd0
  file.managed:
Christian Boltz 856cd0
    - context:
Christian Boltz 37c275
      version: '{{ data.get('version', salt['pillar.get']('mediawiki:default_version')) }}'
Christian Boltz 856cd0
      wiki: {{ wiki }}
Christian Boltz 856cd0
    - listen_in:
Christian Boltz 856cd0
      - service: apache2
Christian Boltz 856cd0
    - source: salt://profile/wiki/files/apache-vhost.conf
Christian Boltz 856cd0
    - template: jinja
Christian Boltz 856cd0
Christian Boltz 856cd0
{% endfor %}
Christian Boltz 856cd0
Christian Boltz 856cd0
/etc/sysconfig/apache2:
Christian Boltz 856cd0
  file.replace:
Christian Boltz 856cd0
    - pattern: ^APACHE_MODULES=.*$
Christian Boltz 856cd0
    # original line:       "actions alias          auth_basic authn_file authz_host authz_groupfile authz_core authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir reqtimeout authn_core php7 rewrite"
Christian Boltz 012c58
    - repl: APACHE_MODULES="        alias apparmor auth_basic authn_file authz_host authz_groupfile authz_core authz_user               dir env expires include log_config mime negotiation setenvif     socache_shmcb         reqtimeout authn_core php7 rewrite remoteip status"
Christian Boltz 856cd0
    - listen_in:
Christian Boltz 856cd0
      - service: apache2
Christian Boltz 5656be
430cbc
# This is handled in /etc/logrotate.d/apache2 since Leap 15.x (same/duplicate entry there)
430cbc
# removing the file on newer Leap versions to avoid  errors in logrotate (duplicate entry...)
Christian Boltz 5656be
/etc/logrotate.d/apache2-wiki:
430cbc
  file.absent