Skip to content

Commit

Permalink
Properly restart apache after changes
Browse files Browse the repository at this point in the history
  • Loading branch information
athos-ribeiro committed May 26, 2018
1 parent e591564 commit 7f4a16a
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions salt/obs.sls
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,28 @@ enable_obs_site:
- user
- group

reload_apache:
service.running:
- name: apache2
- enable: True
- reload: True

{% if salt['grains.get']('db_setup') != 'done' %}
setup_database:
cmd.run:
- name: "RAILS_ENV=production bundle exec rake db:setup"
- cwd: /usr/share/obs/api
grains.present:
- name: db_setup
- value: done
{% endif %}

compile_assets:
cmd.run:
- name: "RAILS_ENV=production bundle exec rake assets:precompile"
- cwd: /usr/share/obs/api

restart_apache:
service.running:
- name: apache2
- enable: True
- watch_any:
- enable_obs_site
- disable_default_apache2_site
- file: /var/log/obs
- file: /usr/share/obs/api
- compile_assets

0 comments on commit 7f4a16a

Please sign in to comment.