Skip to content

Commit

Permalink
Use Salt templating for the Homu db location
Browse files Browse the repository at this point in the history
  • Loading branch information
aneeshusa committed Apr 12, 2017
1 parent 2a9a41c commit 7590fb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion homu/files/cfg.toml
Expand Up @@ -292,4 +292,4 @@ context = 'continuous-integration/appveyor/branch'
context = 'continuous-integration/appveyor/branch'

[db]
file = "/var/homu/main.db"
file = "{{ db }}"
18 changes: 11 additions & 7 deletions homu/init.sls
Expand Up @@ -32,13 +32,23 @@ homu:
- file: /home/servo/homu/cfg.toml
- file: /etc/init/homu.conf
{{ salt['file.dirname'](homu.db) }}:
file.directory:
- user: servo
- group: servo
- dir_mode: 700
- require_in:
- file: /home/servo/homu/cfg.toml
/home/servo/homu/cfg.toml:
file.managed:
- source: salt://{{ tpldir }}/files/cfg.toml
- template: jinja
- user: servo
- group: servo
- mode: 644
- template: jinja
- context:
db: {{ homu.db }}
/etc/init/homu.conf:
file.managed:
Expand All @@ -49,9 +59,3 @@ homu:
- require:
- pip: homu
- file: /home/servo/homu/cfg.toml
/var/homu:
file.directory:
- user: servo
- group: servo
- dir_mode: 700
1 change: 1 addition & 0 deletions homu/map.jinja
@@ -1,5 +1,6 @@
{%
set homu = {
'db': '/var/homu/main.db',
'rev': '3d2e2bb95af6227e9a87bb92a221f3dcda030816'
}
%}

0 comments on commit 7590fb0

Please sign in to comment.