Christian Boltz 33ee6f
phpmyadmin:
Christian Boltz 33ee6f
  pkg.installed:
Christian Boltz 33ee6f
    - pkgs:
Christian Boltz 33ee6f
      - apache2-mod_apparmor
Christian Boltz 33ee6f
      - apache2-prefork
Christian Boltz 33ee6f
      - phpMyAdmin
Christian Boltz 33ee6f
Christian Boltz 33ee6f
  service.running:
Christian Boltz 33ee6f
    - enable: True
Christian Boltz 33ee6f
    - name: apache2
Christian Boltz 33ee6f
Christian Boltz 33ee6f
/etc/apache2/vhosts.d/pmya.opensuse.org.conf:
Christian Boltz 33ee6f
  file.managed:
Christian Boltz 33ee6f
    - listen_in:
Christian Boltz 33ee6f
      - service: apache2
Christian Boltz 33ee6f
    - source: salt://profile/phpmyadmin/files/apache-vhost.conf
Christian Boltz 33ee6f
Christian Boltz 33ee6f
/etc/apache2/conf.d/phpMyAdmin.htpass:
Christian Boltz 33ee6f
  file.managed:
Christian Boltz 33ee6f
    - contents_pillar: profile:phpmyadmin:htpasswd
Christian Boltz 33ee6f
Christian Boltz 33ee6f
{% for key, value in pillar.profile.phpmyadmin.config.items() %}
Christian Boltz 33ee6f
{% if value != 'false' and value != 'true' %}
Christian Boltz 33ee6f
  {% set value = "'%s'" % value %}  # add quotes around non-boolean values
Christian Boltz 33ee6f
{% endif %}
Christian Boltz 33ee6f
phpmyadmin_config_{{ key }}:
Christian Boltz 33ee6f
  file.append:
Christian Boltz 33ee6f
    - name: /etc/phpMyAdmin/config.inc.php
Christian Boltz 33ee6f
    - text: $cfg['Servers'][$i]['{{ key }}'] = {{ value }};
Christian Boltz 33ee6f
{% endfor %}
Christian Boltz 33ee6f
Christian Boltz 33ee6f
# see profile/countdown/apache.sls for /etc/sysconfig/apache2