ipfs-cluster

jeffbr13.ipfs-cluster

Installs and configures the ipfs-cluster daemon.

Unique node IDs and private keys must be configured per-host.

You can use systemctl status ipfs and systemctl status ipfs-cluster to check the status of the new services.

Requirements

  • Ansible 2.2 (for service.use option)

Role Variables

Required Variables

As in jeffbr13.ipfs, the IPFS peer ID and private key must be set for each host in host_vars:

ipfs_peer_id: ""      # see below
ipfs_private_key: ""  # ipfs-key | base64

You must also generate an ipfs_cluster_secret to be shared by all hosts:

ipfs_cluster_secret: ""   # openssl rand -hex 32

Optional Variables

The following variables are available across the playbook:

ipfs_cluster_dist_url: https://dist.ipfs.io
ipfs_cluster_version: v0.2.1
ipfs_cluster_arch: amd64
ipfs_cluster_replication_factor: -1   # replicate files to all nodes
ipfs_cluster_listen_multiaddress: "/ip4/{{ ansible_default_ipv4.address }}/tcp/9096"
ipfs_cluster_http_api_listen_multiaddress: /ip4/127.0.0.1/tcp/9094
ipfs_cluster_http_gateway_listen_multiaddress: /ip4/127.0.0.1/tcp/9095

You can generate the ipfs_cluster_secret by running openssl rand -hex 32, or, if you don't have OpenSSL, od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n' ; echo.

ipfs-cluster listens on the machine's default IPv4 address (ansible_default_ipv4) as ascertained by Ansible. To customise this, e.g. for a private network, override ipfs_cluster_listen_multiaddress.

Example Playbook

In your playbook.yml:

- hosts: ipfs_cluster
  roles:
     - { role: jeffbr13.ipfs-cluster, ipfs_cluster_secret: ed3205fca12ec1584d063f9f16a7b72220f86e49e5c8e94625c0aace6b37d713}

For a host in host_vars/<hostname>.yml:

ipfs_peer_id: Qmagy4195bsbR6YmqwKUtj7j65QdnyDiH3uzVYB8F46r6j
ipfs_private_key: CAASqAkwggSkAgEAAoIBAQDB7ltlNV4QysC3m0HOySU2jjxnmrjZmOX8vi9UU/E6xu+3S6wCe/f1bxVATgqfHMXU4Sk5g4pmM3YocadrMe/WzeSLKGB0QPgcKAtcuBJZO8vQEWmMDxrFg/pOd4Z2LIrLKIQDeRmh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RcRoCwKBgQCERqR5Ih2F5e5iTCLyDJwkdjEKd08Jf3mpZlXF4gVlZrZARrW9vchLegcLvJUOrOsMs9t2HOjFmg9+tUlf+E4Z+RvndH0six9YrMPJc/tQ9r+bAE91mFLec2x5wJpO0P9SdJLic9jBhb6PL9kjdkClOaVxzSYMOx7etLgEeJtOaQKBgAVYOsf2EA3aoukh6mPTKVfKaV71mFRhIPcbT0mADaJ7mYh0fSV/FHahwRioKfweTFNEFVO15x97acBbfInA/ZARc+N08IKVfwr+vopcefXEqgE0PMGsI/fFduXYBbprdns62qGrEYAJkNE8E34AM2Afh9sWt9PJdUYpBagHc+dL

License

MIT

Author Information

This is an Ansible Galaxy distributable role based on https://github.com/hsanjuan/ansible-ipfs-cluster.

About

Collective pinning and composition for IPFS.

Install
ansible-galaxy install jeffbr13/ansible-ipfs-cluster
GitHub repository
License
mit
Downloads
37