Ales Komarek | b08b9cd | 2014-09-08 16:01:03 +0200 | [diff] [blame] | 1 | {%- from "tftpd_hpa/map.jinja" import server with context %} |
| 2 | {%- if server.enabled %} |
| 3 | |
| 4 | tftpd_hpa_package: |
| 5 | pkg.installed: |
| 6 | - pkgs: {{ server.pkgs }} |
| 7 | |
Vasyl Saienko | d700598 | 2017-04-26 13:58:15 +0300 | [diff] [blame] | 8 | {{ server.config_file }}: |
| 9 | file.managed: |
| 10 | - name: {{ server.config_file }} |
| 11 | source: salt://tftpd_hpa/files/tftpd-hpa.conf |
| 12 | template: jinja |
| 13 | |
Ales Komarek | b08b9cd | 2014-09-08 16:01:03 +0200 | [diff] [blame] | 14 | tftpd_hpa_service: |
| 15 | service.running: |
| 16 | - name: {{ server.service }} |
Ales Komarek | 030a807 | 2014-09-09 15:36:17 +0200 | [diff] [blame] | 17 | - enable: true |
Ales Komarek | b08b9cd | 2014-09-08 16:01:03 +0200 | [diff] [blame] | 18 | - running: true |
Vasyl Saienko | d700598 | 2017-04-26 13:58:15 +0300 | [diff] [blame] | 19 | - watch: |
| 20 | - file: {{ server.config_file }} |
Ales Komarek | b08b9cd | 2014-09-08 16:01:03 +0200 | [diff] [blame] | 21 | |
Vasyl Saienko | d700598 | 2017-04-26 13:58:15 +0300 | [diff] [blame] | 22 | {{ server.path }}: |
| 23 | file.directory: |
| 24 | - makedirs: True |
| 25 | - name: {{ server.path }} |
| 26 | - user: {{ server.username }} |
| 27 | |
| 28 | {%- endif %} |