updated ipfs state
This commit is contained in:
parent
3db698db57
commit
4d6b8dd50d
41
states/ipfs/config.sls
Normal file
41
states/ipfs/config.sls
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
ipfs-set-storagemax:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs config Datastore.StorageMax "20GB"
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-headers-1:
|
||||
cmd.run:
|
||||
- name: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-headers-2:
|
||||
cmd.run:
|
||||
#- name: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:8888", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
|
||||
- name: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-api:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs config Addresses.API "/ip4/0.0.0.0/tcp/5001"
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-gateway:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8888"
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
9
states/ipfs/defaults.yaml
Normal file
9
states/ipfs/defaults.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
ipfs:
|
||||
enabled: true
|
||||
install_dir: /usr/local/apps
|
||||
release_dir: /usr/local/apps/releases
|
||||
mirror: https://dl.google.com/go/
|
||||
version: 1.15.5
|
||||
os: linux
|
||||
arch: amd64
|
@ -1,89 +1,5 @@
|
||||
---
|
||||
ipfs-group:
|
||||
group.present:
|
||||
- name: ipfs
|
||||
- gid: 899
|
||||
|
||||
ipfs-user:
|
||||
user.present:
|
||||
- name: ipfs
|
||||
- uid: 899
|
||||
- gid: 899
|
||||
- home: /var/lib/ipfs
|
||||
- allow_uid_change: true
|
||||
- allow_gid_change: true
|
||||
|
||||
ipfs-dir:
|
||||
file.directory:
|
||||
- name: /var/lib/ipfs
|
||||
- user: ipfs
|
||||
- group: ipfs
|
||||
- mode: 0750
|
||||
- recurse:
|
||||
- user
|
||||
|
||||
ipfs-init:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs init
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- success_retcodes:
|
||||
- 0
|
||||
- 1
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-storagemax:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs config Datastore.StorageMax "20GB"
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-headers-1:
|
||||
cmd.run:
|
||||
- name: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-headers-2:
|
||||
cmd.run:
|
||||
#- name: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:8888", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
|
||||
- name: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-api:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs config Addresses.API "/ip4/0.0.0.0/tcp/5001"
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-set-gateway:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8888"
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-service-file:
|
||||
file.managed:
|
||||
- name: /etc/systemd/system/ipfs.service
|
||||
- source: salt://ipfs/ipfs.service
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-service:
|
||||
service.running:
|
||||
- name: ipfs
|
||||
- enable: true
|
||||
- require:
|
||||
- file: ipfs-dir
|
||||
include:
|
||||
- .install
|
||||
- .config
|
||||
- .service
|
34
states/ipfs/install.sls
Normal file
34
states/ipfs/install.sls
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
ipfs-group:
|
||||
group.present:
|
||||
- name: ipfs
|
||||
- gid: 899
|
||||
|
||||
ipfs-user:
|
||||
user.present:
|
||||
- name: ipfs
|
||||
- uid: 899
|
||||
- gid: 899
|
||||
- home: /var/lib/ipfs
|
||||
- allow_uid_change: true
|
||||
- allow_gid_change: true
|
||||
|
||||
ipfs-dir:
|
||||
file.directory:
|
||||
- name: /var/lib/ipfs
|
||||
- user: ipfs
|
||||
- group: ipfs
|
||||
- mode: 0750
|
||||
- recurse:
|
||||
- user
|
||||
|
||||
ipfs-init:
|
||||
cmd.run:
|
||||
- name: /usr/local/sbin/ipfs init
|
||||
- runas: ipfs
|
||||
- cwd: /var/lib/ipfs
|
||||
- success_retcodes:
|
||||
- 0
|
||||
- 1
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
12
states/ipfs/kernelmap.yaml
Normal file
12
states/ipfs/kernelmap.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
Linux:
|
||||
os: "linux"
|
||||
|
||||
Darwin:
|
||||
os: "darwin"
|
||||
|
||||
FreeBSD:
|
||||
os: "freebsd"
|
||||
|
||||
NetBSD:
|
||||
os: "netbsd"
|
14
states/ipfs/map.jinja
Normal file
14
states/ipfs/map.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
{%- import_yaml "golang/defaults.yaml" as default_settings -%}
|
||||
|
||||
{%- import_yaml "golang/kernelmap.yaml" as kernelmap -%}
|
||||
{%- import_yaml "golang/osarchmap.yaml" as osarchmap -%}
|
||||
|
||||
{%- set defaults = salt['grains.filter_by'](default_settings,
|
||||
default='golang',
|
||||
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
|
||||
merge=salt['grains.filter_by'](kernelmap, grain='kernel')
|
||||
)
|
||||
)
|
||||
-%}
|
||||
|
||||
{%- set golang = salt['pillar.get']('golang', default=defaults, merge=True) -%}
|
21
states/ipfs/osarchmap.yaml
Normal file
21
states/ipfs/osarchmap.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
amd64:
|
||||
arch: "amd64"
|
||||
|
||||
x86_64:
|
||||
arch: "amd64"
|
||||
|
||||
386:
|
||||
arch: "386"
|
||||
|
||||
arm64:
|
||||
arch: "arm64"
|
||||
|
||||
armv6l:
|
||||
arch: "armv6l"
|
||||
|
||||
armv7l:
|
||||
arch: "armv6l"
|
||||
|
||||
armhf:
|
||||
arch: "armv6l"
|
14
states/ipfs/service.sls
Normal file
14
states/ipfs/service.sls
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
ipfs-service-file:
|
||||
file.managed:
|
||||
- name: /etc/systemd/system/ipfs.service
|
||||
- source: salt://ipfs/ipfs.service
|
||||
- watch-in:
|
||||
- service: ipfs-service
|
||||
|
||||
ipfs-service:
|
||||
service.running:
|
||||
- name: ipfs
|
||||
- enable: true
|
||||
- require:
|
||||
- file: ipfs-dir
|
Loading…
Reference in New Issue
Block a user