Browse Source

Split up weave formula

master
Sean Johnson 4 years ago
parent
commit
7e0bc7858a
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. 2
      app/cfdd/install.sls
  2. 42
      app/weave/init.sls
  3. 47
      app/weave/install.sls
  4. 6
      app/weave/service.sls

2
app/cfdd/install.sls

@ -20,6 +20,8 @@ write systemd cfdd@.service:
reload systemd units:
module.run:
- name: service.systemctl_reload
- onchanges:
- file: write systemd cfdd@.service
systemd drop-in cfdd@.service.d:
file.directory:

42
app/weave/init.sls

@ -1,41 +1,5 @@
---
{% from "app/weave/map.jinja" import secrets with context %}
{% set peer_ipaddrs = salt["mine.get"]("datacenter:"~grains["datacenter"], "public_ipaddrs", tgt_type="grain") %}
fetch latest weave-net release:
file.managed:
- source: https://git.io/weave
- name: /usr/local/bin/weave
- skip_verify: true
- user: root
- group: root
- mode: 0755
write systemd weave.service:
file.managed:
- source: salt://app/weave/templates/weave.service.j2
- name: /lib/systemd/system/weave.service
- user: root
- group: root
- mode: 0643
- template: jinja
systemd drop-in weave.service.d:
file.directory:
- name: /lib/systemd/system/weave.service.d
- user: root
- group: root
- mode: 0644
write envfile weave:
file.managed:
- source: salt://app/weave/templates/weave.j2
- name: /etc/default/weave
- user: root
- group: root
- mode: 0755
- template: jinja
- context:
secrets: {{ secrets | tojson }}
peers: {{ peer_ipaddrs | tojson }}
include:
- app.weave.install
- app.weave.service

47
app/weave/install.sls

@ -0,0 +1,47 @@
---
{% from "app/weave/map.jinja" import secrets with context %}
{% set peer_ipaddrs = salt["mine.get"]("datacenter:"~grains["datacenter"], "public_ipaddrs", tgt_type="grain") %}
fetch latest weave-net release:
file.managed:
- source: https://git.io/weave
- name: /usr/local/bin/weave
- skip_verify: true
- user: root
- group: root
- mode: 0755
write systemd weave.service:
file.managed:
- source: salt://app/weave/templates/weave.service.j2
- name: /lib/systemd/system/weave.service
- user: root
- group: root
- mode: 0640
- template: jinja
reload systemd units:
module.run:
- name: service.systemctl_reload
- onchanges:
- file: write systemd weave.service
systemd drop-in weave.service.d:
file.directory:
- name: /lib/systemd/system/weave.service.d
- user: root
- group: root
- mode: 0644
write envfile weave:
file.managed:
- source: salt://app/weave/templates/weave.j2
- name: /etc/default/weave
- user: root
- group: root
- mode: 0750
- template: jinja
- context:
secrets: {{ secrets | tojson }}
peers: {{ peer_ipaddrs | tojson }}

6
app/weave/service.sls

@ -0,0 +1,6 @@
---
enable weave.service:
service.running:
- name: weave.service
- enable: true
Loading…
Cancel
Save