Install and configure:
Install the Ansible>=2.4
:
$ sudo apt install ansible
$ brew install ansible
Clone this playbook:
$ git clone [email protected]:DLTcollab/ansible-iri-playbook.git
Install the third-party roles:
$ ansible-galaxy install --roles-path ~/.ansible/roles -r requirements.yml
- Add your SSH public key to your
fullnode
,broker
andremote-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
,broker
andremote-worker
toinventory
.
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.yml
If 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.yml
After modifying the fullnode variables, overwrite the existing setting:
$ ansible-playbook iri.yml -e overwrite=yes
To change service status:
$ ansible-playbook manage.yml -e systemd_status=[status]
The acceptable [status] are
started
restarted
stopped
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
fullnode
broker
remote-worker
node
remote-worker-1
remote-worker-2
remote-worker-3
remote-worker-4