Browse Source

Remove app.weave states

master
Sean Johnson 4 years ago
parent
commit
d57030dbaf
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/weave/defaults.yaml
  2. 5
      app/weave/init.sls
  3. 47
      app/weave/install.sls
  4. 3
      app/weave/map.jinja
  5. 6
      app/weave/service.sls
  6. 2
      app/weave/templates/weave.j2
  7. 15
      app/weave/templates/weave.service.j2
  8. 2
      top.sls

2
app/weave/defaults.yaml

@ -1,2 +0,0 @@
---
{}

5
app/weave/init.sls

@ -1,5 +0,0 @@
---
include:
- app.weave.install
- app.weave.service

47
app/weave/install.sls

@ -1,47 +0,0 @@
---
{% 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 }}

3
app/weave/map.jinja

@ -1,3 +0,0 @@
{% import_yaml "app/weave/defaults.yaml" as defaults %}
{% set secrets = salt.pillar.get("weave", {}) %}}

6
app/weave/service.sls

@ -1,6 +0,0 @@
---
enable weave.service:
service.running:
- name: weave.service
- enable: true

2
app/weave/templates/weave.j2

@ -1,2 +0,0 @@
WEAVE_PASSWORD="{{ secrets.encrypt_secret }}"
PEERS="{% for _, peer in peers.items() %}{{ peer | first }} {% endfor %}"

15
app/weave/templates/weave.service.j2

@ -1,15 +0,0 @@
[Unit]
Description=Weave Network
Documentation=http://docs.weave.works/weave/latest_release/
Requires=docker.service
After=docker.service
[Service]
EnvironmentFile=-/etc/default/weave
ExecStartPre=/usr/local/bin/weave launch --no-restart $PEERS
ExecStart=/usr/bin/docker attach weave
ExecStop=/usr/local/bin/weave stop
[Install]
WantedBy=multi-user.target

2
top.sls

@ -40,7 +40,7 @@ base:
'roles:weave_net':
- match: grain
- app.weave
- weave_net
'roles:nginx_server':
- match: grain

Loading…
Cancel
Save