diff --git a/fcgid.sls b/apache/fcgid.sls similarity index 100% rename from fcgid.sls rename to apache/fcgid.sls diff --git a/apache/init.sls b/apache/init.sls index 72e8de2..eb186cd 100644 --- a/apache/init.sls +++ b/apache/init.sls @@ -1,10 +1,47 @@ -apache2: -{% if grains['os_family'] == 'Debian' %} - pkg: - - installed -{% endif %} - service: - - running - - endable: True +include: + - apt + - apache.register_site + +{% if grains['os']=="Ubuntu" %} + +apache: + pkg.installed: + - name: apache2 + - order: 175 + service.running: + - name: apache2 + - enable: True + - order: 455 + +a2dissite 000-default: + cmd.run: + - order: 225 + - onlyif: ls /etc/apache2/sites-enabled/000-default + - watch_in: + - cmd: apache-reload - require: - - pkg: apache2 + - pkg: apache + +apache-reload: + cmd.wait: + - name: service apache2 reload + - order: 420 + +apache-restart: + cmd.wait: + - name: service apache2 restart + - order: 425 + +/etc/apache2/sites-available/default: + file.absent: + - order: 230 + - require: + - pkg: apache + +/etc/apache2/sites-available/default-ssl: + file.absent: + - order: 230 + - require: + - pkg: apache + +{% endif %} #END: os = ubuntu diff --git a/php5.sls b/apache/php5.sls similarity index 100% rename from php5.sls rename to apache/php5.sls diff --git a/register_site.sls b/apache/register_site.sls similarity index 100% rename from register_site.sls rename to apache/register_site.sls diff --git a/rewrite.sls b/apache/rewrite.sls similarity index 100% rename from rewrite.sls rename to apache/rewrite.sls diff --git a/init.sls b/init.sls deleted file mode 100644 index eb186cd..0000000 --- a/init.sls +++ /dev/null @@ -1,47 +0,0 @@ -include: - - apt - - apache.register_site - -{% if grains['os']=="Ubuntu" %} - -apache: - pkg.installed: - - name: apache2 - - order: 175 - service.running: - - name: apache2 - - enable: True - - order: 455 - -a2dissite 000-default: - cmd.run: - - order: 225 - - onlyif: ls /etc/apache2/sites-enabled/000-default - - watch_in: - - cmd: apache-reload - - require: - - pkg: apache - -apache-reload: - cmd.wait: - - name: service apache2 reload - - order: 420 - -apache-restart: - cmd.wait: - - name: service apache2 restart - - order: 425 - -/etc/apache2/sites-available/default: - file.absent: - - order: 230 - - require: - - pkg: apache - -/etc/apache2/sites-available/default-ssl: - file.absent: - - order: 230 - - require: - - pkg: apache - -{% endif %} #END: os = ubuntu