Skip to content

Commit 02d7837

Browse files
committed
fix systemctl template, default variables and add verifications in the test
1 parent 8320279 commit 02d7837

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed

defaults/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# override to disable go-ipfs setup
44
ipfs_enable: true
55

6-
ipfs_version: v0.4.19
6+
ipfs_version: v0.9.0
77
ipfs_arch: amd64
88
ipfs_home: /home/ipfs
99
ipfs_storage_max: 10G
@@ -21,8 +21,6 @@ ipfs_reprovider_strategy: all
2121

2222
# override to disable ipfs cluster setup
2323
ipfs_cluster_enable: true
24-
25-
ipfs_cluster_secret: "use `od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n' ; echo` to generate this"
2624
ipfs_cluster_arch: amd64
27-
ipfs_cluster_version: v0.10.0
25+
ipfs_cluster_version: v0.13.3
2826
ipfs_cluster_fd_max: 10000

molecule/default/molecule.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ driver:
66
platforms:
77
- name: instance-1
88
image: centos:8
9-
command: /sbin/init
9+
command: "/usr/sbin/init"
10+
volumes:
11+
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
1012
privileged: True
1113
groups:
1214
- ipfs_cluster
1315
provisioner:
1416
name: ansible
1517
inventory:
18+
group_vars:
19+
ipfs_cluster:
20+
ipfs_cluster_secret: "81643eba8fedcc4aa31fef6459e8b852a97c3cf3d0489158cb85166e8255e912"
1621
host_vars:
1722
instance-1:
1823
ipfs_peer_id: "QmUdZCogpVVrPMxdPHhtT2KuUuxNVi1uLb7UC4HwHBqejb"

molecule/default/verify.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
---
2-
# This is an example playbook to execute Ansible tests.
2+
# Validates if ipfs and ipfs-cluster are installed and running
33

44
- name: Verify
5-
hosts: all
5+
hosts: instance-1
66
gather_facts: false
77
tasks:
8-
- name: Example assertion
9-
assert:
10-
that: true
8+
- name: Check if IPFS is installed
9+
package:
10+
name: ipfs
11+
state: present
12+
check_mode: true
13+
register: install_ipfs
14+
failed_when: (install_ipfs is changed) or (install_ipfs is failed)
15+
16+
- name: Check if IPFS service is running
17+
service:
18+
name: ipfs
19+
state: started
20+
enabled: true
21+
check_mode: true
22+
register: service_ipfs
23+
failed_when: (service_ipfs is changed) or (service_ipfs is failed)
24+
25+
- name: Check if IPFS Cluster is installed
26+
package:
27+
name: ipfs-cluster
28+
state: present
29+
check_mode: true
30+
register: install_ipfs_cluster
31+
failed_when: (install_ipfs_cluster is changed) or (install_ipfs_cluster is failed)
32+
33+
- name: Check if IPFS Cluster service is running
34+
service:
35+
name: ipfs-cluster
36+
state: started
37+
enabled: true
38+
check_mode: true
39+
register: service_ipfs_cluster
40+
failed_when: (service_ipfs_cluster is changed) or (service_ipfs_cluster is failed)

templates/ipfs/etc/systemd/system/ipfs.service

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Description=IPFS daemon
33
After=network.target
44

55
[Service]
6-
Type=notify
76
User=ipfs
87
Group=ipfs
98
StateDirectory=ipfs

0 commit comments

Comments
 (0)