main.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. # Configure chain spec and start joystream-node service on the servers
  3. - set_fact:
  4. chain_path: "{{ remote_code_path }}/chains/{{ result.result.id }}"
  5. - set_fact:
  6. network_path: "{{ chain_path }}/network"
  7. keystore_path: "{{ chain_path }}/keystore/"
  8. - set_fact:
  9. secret_path: "{{ network_path }}/secret"
  10. - name: Creating chains directory
  11. file:
  12. path: "{{ item }}"
  13. state: directory
  14. loop:
  15. - "{{ network_path }}"
  16. - name: Copy node key to remote host
  17. copy:
  18. dest: "{{ secret_path }}"
  19. content: "{{ subkey_output.stdout }}"
  20. - name: Copy auth directory to remote host
  21. copy:
  22. src: "{{ data_path }}/auth-{{ ansible_play_batch.index(inventory_hostname) }}/"
  23. dest: "{{ keystore_path }}"
  24. - name: Create a service file
  25. template:
  26. src: joystream-node.service.j2
  27. dest: /etc/systemd/system/joystream-node.service
  28. vars:
  29. template_keystore_path: "{{ keystore_path }}"
  30. template_secret_path: "{{ secret_path }}"
  31. template_remote_chain_spec_path: "{{ remote_chain_spec_path }}"
  32. become: yes
  33. - name: Start service joystream-node, if not started
  34. service:
  35. name: joystream-node
  36. state: started
  37. become: yes