Skip to content

Commit 75c9107

Browse files
committed
Updates
Use valid ansible inventory group names Update to latest configuration version Template some more options
1 parent 7f9e050 commit 75c9107

File tree

8 files changed

+132
-119
lines changed

8 files changed

+132
-119
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that fits you best. Otherwise follow these steps:
1313

1414
0. Make sure you have ansible installed: `pip install ansible`.
1515
1. Fill in `inventory.yml` and place the hostnames of your nodes under the `[ipfs]` group.
16-
2. Edit the `group_vars/ipfs.yml` and `group_vars/ipfs-cluster.yml` file
16+
2. Edit the `group_vars/ipfs.yml` and `group_vars/ipfs_cluster.yml` file
1717
setting the right configuration values, including generating an
1818
[IPFS Cluster secret](https://cluster.ipfs.io/documentation/guides/security/#the-cluster-secret)
1919
with `od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n' ; echo`
@@ -24,7 +24,7 @@ that fits you best. Otherwise follow these steps:
2424
4. Run `make`.
2525

2626
`make` will run ansible for the `ipfs` and the `ipfs-cluster` roles, which
27-
apply to the `[ipfs]` and `[ipfs-cluster]` inventory group. Upon successful,
27+
apply to the `[ipfs]` and `[ipfs_cluster]` inventory group. Upon successful,
2828
both `go-ipfs` and `ipfs-cluster` should be running in the nodes (they are
2929
installed under `/usr/local/bin` and run by a created `ipfs` system user).
3030

group_vars/ipfs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ ipfs_bloom_filter_size: 1048576 # 1MB
77
ipfs_api_listen: /ip4/127.0.0.1/tcp/5001
88
ipfs_fd_max: 4092
99
ipfs_use_badger: false
10+
ipfs_discovery: false
11+
ipfs_disk_sync: true
12+
ipfs_routing: dht
13+
ipfs_disable_bandthwidth_metrics: false
14+
ipfs_reprovider_strategy: all
File renamed without changes.

inventory.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[ipfs]
22
# Write here your ipfs nodes
33

4-
[ipfs-cluster:children]
4+
[ipfs_cluster:children]
55
ipfs

ipfs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- hosts: ipfs
22
roles:
33
- ipfs
4-
- hosts: ipfs-cluster
4+
- hosts: ipfs_cluster
55
roles:
66
- ipfs-cluster

roles/ipfs-cluster/templates/peerstore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% for host in groups['ipfs-cluster'] %}
1+
{% for host in groups['ipfs_cluster'] %}
22
{% if hostvars[host]['ipfs_cluster_peer_addr'] is defined %}
33
{{ hostvars[host]['ipfs_cluster_peer_addr'] }}
44
{% endif %}

roles/ipfs-cluster/templates/service.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"disable_repinning": {{ ipfs_cluster_disable_repinning | default(true) | lower }},
3030
"follower_mode": {{ ipfs_cluster_follower_mode | default(false) | lower }},
3131
"peer_addresses": [
32-
{% for host in groups['ipfs-cluster'] %}
32+
{% for host in groups['ipfs_cluster'] %}
3333
{% if hostvars[host]['ipfs_cluster_peer_addr'] is defined %}
3434
"{{ hostvars[host]['ipfs_cluster_peer_addr'] }}"{% if not loop.last %},{% endif %}
3535

Lines changed: 121 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
11
{
2-
"API": {
3-
"HTTPHeaders": {}
2+
"Identity": {
3+
"PeerID": "{{ ipfs_peer_id }}",
4+
"PrivKey": "{{ ipfs_private_key }}"
5+
},
6+
"Datastore": {
7+
"StorageMax": "{{ ipfs_storage_max }}",
8+
"StorageGCWatermark": 90,
9+
"BloomFilterSize": {{ ipfs_bloom_filter_size }},
10+
"GCPeriod": "1h",
11+
"HashOnRead": false,
12+
{% if ipfs_use_badger | default(False) %}
13+
"Spec": {
14+
"child": {
15+
"path": "badgerds",
16+
"syncWrites": {{ ipfs_disk_sync | default(True) | to_json }},
17+
"truncate": true,
18+
"type": "badgerds"
19+
},
20+
"prefix": "badger.datastore",
21+
"type": "measure"
22+
}
23+
{% else %}
24+
"Spec": {
25+
"mounts": [
26+
{
27+
"child": {
28+
"path": "blocks",
29+
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
30+
"sync": {{ ipfs_disk_sync | default(True) | to_json }},
31+
"type": "flatfs"
32+
},
33+
"mountpoint": "/blocks",
34+
"prefix": "flatfs.datastore",
35+
"type": "measure"
36+
},
37+
{
38+
"child": {
39+
"compression": "none",
40+
"path": "datastore",
41+
"type": "levelds"
42+
},
43+
"mountpoint": "/",
44+
"prefix": "leveldb.datastore",
45+
"type": "measure"
46+
}
47+
],
48+
"type": "mount"
49+
}
50+
{% endif %}
451
},
552
"Addresses": {
653
"API": "{{ ipfs_api_listen | default('/ip4/127.0.0.1/tcp/5001') }}",
@@ -42,130 +89,70 @@
4289
"/ip6/::/tcp/4002/ws"
4390
]
4491
},
45-
"Bootstrap": [
46-
"/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
47-
"/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
48-
"/dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
49-
"/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
50-
"/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
51-
"/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
52-
"/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
53-
"/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
54-
"/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
55-
"/ip6/2604:a880:1:20::203:d001/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
56-
"/ip6/2400:6180:0:d0::151:6001/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
57-
"/ip6/2604:a880:800:10::4a:5001/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
58-
"/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"
59-
],
60-
"Datastore": {
61-
"BloomFilterSize": {{ ipfs_bloom_filter_size }},
62-
"GCPeriod": "1h",
63-
"HashOnRead": false,
64-
{% if ipfs_use_badger | default(False) %}
65-
"Spec": {
66-
"child": {
67-
"path": "badgerds",
68-
"syncWrites": true,
69-
"truncate": true,
70-
"type": "badgerds"
71-
},
72-
"prefix": "badger.datastore",
73-
"type": "measure"
74-
},
75-
{% else %}
76-
"Spec": {
77-
"mounts": [
78-
{
79-
"child": {
80-
"path": "blocks",
81-
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
82-
"sync": true,
83-
"type": "flatfs"
84-
},
85-
"mountpoint": "/blocks",
86-
"prefix": "flatfs.datastore",
87-
"type": "measure"
88-
},
89-
{
90-
"child": {
91-
"compression": "none",
92-
"path": "datastore",
93-
"type": "levelds"
94-
},
95-
"mountpoint": "/",
96-
"prefix": "leveldb.datastore",
97-
"type": "measure"
98-
}
99-
],
100-
"type": "mount"
101-
},
102-
{% endif %}
103-
"StorageGCWatermark": 90,
104-
"StorageMax": "{{ ipfs_storage_max }}"
92+
"Mounts": {
93+
"IPFS": "/ipfs",
94+
"IPNS": "/ipns",
95+
"FuseAllowOther": false
10596
},
10697
"Discovery": {
10798
"MDNS": {
108-
"Enabled": {{ ipfs_discovery | default(False) | lower }},
99+
"Enabled": {{ ipfs_discovery | default(False) | to_json }},
109100
"Interval": 10
110101
}
111102
},
112-
"Experimental": {
113-
"FilestoreEnabled": false,
114-
"Libp2pStreamMounting": false,
115-
"P2pHttpProxy": false,
116-
"PreferTLS": false,
117-
"QUIC": true,
118-
"ShardingEnabled": false,
119-
"StrategicProviding": false,
120-
"UrlstoreEnabled": false
103+
"Routing": {
104+
"Type": "{{ ipfs_routing | default('dht') }}"
105+
},
106+
"Ipns": {
107+
"RepublishPeriod": "",
108+
"RecordLifetime": "",
109+
"ResolveCacheSize": 128
121110
},
111+
"Bootstrap": [
112+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
113+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
114+
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
115+
"/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
116+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
117+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa"
118+
],
122119
"Gateway": {
123-
"APICommands": [],
124120
"HTTPHeaders": {
125121
"Access-Control-Allow-Headers": [
126-
"X-Requested-With",
127-
"Range",
128-
"User-Agent"
122+
"X-Requested-With",
123+
"Range",
124+
"User-Agent"
129125
],
130126
"Access-Control-Allow-Methods": [
131-
"GET"
127+
"GET"
132128
],
133129
"Access-Control-Allow-Origin": [
134-
"*"
130+
"*"
135131
]
136132
},
137-
"NoFetch": false,
138-
"PathPrefixes": [],
139133
"RootRedirect": "",
140-
"Writable": false
141-
},
142-
"Identity": {
143-
"PeerID": "{{ ipfs_peer_id }}",
144-
"PrivKey": "{{ ipfs_private_key }}"
145-
},
146-
"Ipns": {
147-
"RepublishPeriod": "",
148-
"RecordLifetime": "",
149-
"ResolveCacheSize": 128
150-
},
151-
"Mounts": {
152-
"FuseAllowOther": false,
153-
"IPFS": "/ipfs",
154-
"IPNS": "/ipns"
155-
},
156-
"Pubsub": {
157-
"DisableSigning": false,
158-
"Router": "",
159-
"StrictSignatureVerification": false
160-
},
161-
"Reprovider": {
162-
"Interval": "12h",
163-
"Strategy": "all"
134+
"Writable": false,
135+
"PathPrefixes": [],
136+
"APICommands": [],
137+
"NoFetch": false,
138+
"NoDNSLink": false,
139+
"PublicGateways": {{ ipfs_public_gateways | default(None) | to_nice_json(indent=2) | indent(6) }}
164140
},
165-
"Routing": {
166-
"Type": "dht"
141+
"API": {
142+
"HTTPHeaders": {}
167143
},
168144
"Swarm": {
145+
"DisableBandwidthMetrics": {{ ipfs_disable_bandwidth_metrics | default(False) | lower }},
146+
"DisableNatPortMap": true,
147+
"DisableRelay": false,
148+
"EnableAutoNATService": false,
149+
"EnableAutoRelay": false,
150+
"EnableRelayHop": false,
151+
"Transports": {
152+
"Network": {},
153+
"Security": {},
154+
"Multiplexers": {}
155+
},
169156
"AddrFilters": [
170157
{% if ipfs_addr_filters is defined %}
171158
{% for p in ipfs_addr_filters %}
@@ -199,12 +186,33 @@
199186
"HighWater": {{ ipfs_connmgr_high_water | default(2000) }},
200187
"LowWater": {{ ipfs_connmgr_low_water | default(1500) }},
201188
"Type": "basic"
202-
},
203-
"DisableBandwidthMetrics": {{ ipfs_disable_bandwidth_metrics | default(false) | lower }},
204-
"DisableNatPortMap": true,
205-
"DisableRelay": false,
206-
"EnableAutoNATService": false,
207-
"EnableAutoRelay": false,
208-
"EnableRelayHop": false
189+
}
190+
},
191+
"AutoNAT": {},
192+
"Pubsub": {
193+
"DisableSigning": false,
194+
"Router": ""
195+
},
196+
"Peering": {
197+
"Peers": null
198+
},
199+
"Reprovider": {
200+
"Interval": "12h",
201+
"Strategy": "{{ ipfs_reprovider_strategy | default('all') }}"
202+
},
203+
"Experimental": {
204+
"FilestoreEnabled": false,
205+
"Libp2pStreamMounting": false,
206+
"P2pHttpProxy": false,
207+
"ShardingEnabled": false,
208+
"StrategicProviding": false,
209+
"UrlstoreEnabled": false,
210+
"GraphsyncEnabled": false
211+
},
212+
"Plugins": {
213+
"Plugins": null
214+
},
215+
"Pinning": {
216+
"RemoteServices": null
209217
}
210218
}

0 commit comments

Comments
 (0)