Install and configure:
Install the Ansible>=2.4:
$ sudo apt install ansible$ brew install ansibleClone this playbook:
$ git clone [email protected]:DLTcollab/ansible-iri-playbook.gitInstall the third-party roles:
$ ansible-galaxy install --roles-path ~/.ansible/roles -r requirements.yml- Add your SSH public key to your
fullnode,brokerandremote-worker, and make sure you can access them via SSH.
For quickly adding the SSH public key to multiple remote workers, please check Optional: Set up Remote Worker SSH Public Key.
- According to your SSH settings, add
fullnode,brokerandremote-workertoinventory.
For example:
[fullnode]
node ansible_host=192.168.0.201 ansible_user=ubuntu
| Keyword | Description |
|---|---|
| [fullnode] | The group name |
| node | The service name |
| ansible_host=192.168.0.201 | The hostname or the IP address of the service |
| ansible_user=ubuntu | The ID for SSH logging in to the service hardware |
- Test the connection:
$ ansible-playbook ping-all.yml- Modify the variables in
group_vars/*andhost_vars/*as you need.
Example:
| Assign RabbitMQ broker service hostname or IP address | File | Variable |
|---|---|---|
| IRI | ansible-iri-playbook/group_vars/fullnode/iri.yml | iri_remote_broker_host |
| Remote Worker | ansible-iri-playbook/group_vars/remote-worker/remote-worker.yml | remote_worker_broker |
- Build the whole infrastructure:
The default setting is to activate the RabbitMQ first, then the IRI and the remote workers. Beware that the RabbitMQ must be the first one, otherwise the connection between the services can not be set up.
$ ansible-playbook iri.ymlIf you are using de10nano-image system image to remote-worker, you could use the playbook to help you set up SSH access.
-
Add your remote-worker to
[remote-worker]group ininventory. -
Copy public key(
~/.ssh/id_rsa.pub) to allremote worker:
$ ansible-playbook setup-fpga-boards.yml- Test the connection:
$ ansible-playbook --limit remote-worker ping-all.ymlAfter modifying the fullnode variables, overwrite the existing setting:
$ ansible-playbook iri.yml -e overwrite=yesTo change service status:
$ ansible-playbook manage.yml -e systemd_status=[status]The acceptable [status] are
startedrestartedstopped
You could use the --limit to change the service status against one or more members.
$ ansible-playbook manage.yml --limit [group/host] -e systemd_status=[status]The acceptable [group/host] are
fullnodebrokerremote-workernoderemote-worker-1remote-worker-2remote-worker-3remote-worker-4