cfdd service unit is a virtual service now

master
Sean Johnson 4 years ago
parent 9b18918157
commit bb367524e8
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 9FA15B87469EA850
  1. 6
      app/cfdd/install.sls
  2. 4
      app/cfdd/map.jinja
  3. 10
      app/cfdd/service.sls
  4. 2
      app/cfdd/templates/cfdd@.service.j2

@ -9,7 +9,7 @@ fetch cfdd binary:
- source_hash: {{ package.binary_checksum | yaml_squote }}
- mode: 0755
write systemd cfdd.service:
write systemd cfdd@.service:
file.managed:
- name: /lib/systemd/system/cfdd.service
- source: salt://app/cfdd/templates/cfdd.service.j2
@ -21,9 +21,9 @@ reload systemd units:
module.run:
- name: service.systemctl_reload
systemd drop-in cfdd.service.d:
systemd drop-in cfdd@.service.d:
file.directory:
- name: /lib/systemd/system/cfdd.service.d
- name: /lib/systemd/system/cfdd@.service.d
- user: root
- group: root
- mode: 0644

@ -15,6 +15,6 @@
{%- if settings.get("domain_record") is none -%}
{{ raise("Required value 'settings.domain_record' is not defined") }}
{%- endif -%}
{%- if settings.get("monitor_interface") is none -%}
{{ raise("Required value 'settings.monitor_interface' is not defined") }}
{%- if settings.get("interfaces") is none -%}
{{ raise("Required value 'settings.interfaces' is not defined") }}
{%- endif -%}

@ -1,7 +1,11 @@
---
enable cfdd.service:
{% set interfaces = salt.pillar.get("cfdd:interfaces", []) %}
{% for interface in interfaces -%}
enable cfdd{{ interface }}.service:
service.running:
- name: cfdd.service
- name: cfdd@{{ interface }}.service
- enable: true
- no_block: true
- no_block: true
{%- endfor %}

@ -13,7 +13,7 @@ Environment=CF_TOKEN={{ cloudflare_token }}
Environment=FILTER_UNROUTABLE={{ filter_unroutable }}
Environment=DOMAIN={{ domain_base }}
Environment=RECORD_NAME={{ domain_record }}
Environment=INTERFACE={{ monitor_interface }}
Environment=INTERFACE=%i
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save