|
@ -3,104 +3,17 @@ |
|
|
gather_facts: no |
|
|
gather_facts: no |
|
|
roles: |
|
|
roles: |
|
|
- ubuntu-16-04 |
|
|
- ubuntu-16-04 |
|
|
|
|
|
- node |
|
|
|
|
|
|
|
|
vars: |
|
|
vars: |
|
|
- ltc_user: ltc |
|
|
- node_user: ltc |
|
|
- ltc_group: ltc |
|
|
- node_group: ltc |
|
|
- ltc_home: /home/ltc |
|
|
- node_data_folder: '.litecoin' |
|
|
- ltc_config_dir: /home/ltc/.litecoin |
|
|
- node_download_url: https://download.litecoin.org/litecoin-0.16.3/linux/litecoin-0.16.3-x86_64-linux-gnu.tar.gz |
|
|
- ltc_download_url: https://download.litecoin.org/litecoin-0.16.3/linux/litecoin-0.16.3-x86_64-linux-gnu.tar.gz |
|
|
- node_download_checksum: sha1:963e958bf5dd045fd70d787d6830f64962ae977d |
|
|
- ltc_download_dest: /home/ubuntu/ltc.tar.gz |
|
|
- node_compressed_file: /home/ubuntu/litecoin.tar.gz |
|
|
- ltc_download_checksum: sha1:963e958bf5dd045fd70d787d6830f64962ae977d |
|
|
- node_daemon_file: litecoin-0.16.3/bin/litecoind |
|
|
- ltc_unarchive_dest: /home/ltc/app |
|
|
- node_config_file: config/nodes/litecoin.conf |
|
|
|
|
|
- node_config_filename: litecoin.conf |
|
|
tasks: |
|
|
- node_executable: litecoind |
|
|
- name: Create the ltc group |
|
|
- node_service_name: ltc-rpc |
|
|
become: yes |
|
|
|
|
|
group: |
|
|
|
|
|
name={{ ltc_group }} |
|
|
|
|
|
state=present |
|
|
|
|
|
|
|
|
|
|
|
- name: Create the ltc user |
|
|
|
|
|
become: yes |
|
|
|
|
|
user: |
|
|
|
|
|
name={{ ltc_user }} |
|
|
|
|
|
group={{ ltc_group }} |
|
|
|
|
|
state=present |
|
|
|
|
|
system=yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Create the app directory |
|
|
|
|
|
become: yes |
|
|
|
|
|
file: |
|
|
|
|
|
path={{ ltc_home }}/app |
|
|
|
|
|
state=directory |
|
|
|
|
|
owner={{ ltc_user }} |
|
|
|
|
|
group={{ ltc_group }} |
|
|
|
|
|
|
|
|
|
|
|
- name: Create the config directory |
|
|
|
|
|
become: yes |
|
|
|
|
|
file: |
|
|
|
|
|
path={{ ltc_config_dir }} |
|
|
|
|
|
state=directory |
|
|
|
|
|
owner={{ ltc_user }} |
|
|
|
|
|
group={{ ltc_group }} |
|
|
|
|
|
|
|
|
|
|
|
- name: Download the ltcd |
|
|
|
|
|
get_url: |
|
|
|
|
|
url={{ ltc_download_url }} |
|
|
|
|
|
dest={{ ltc_download_dest }} |
|
|
|
|
|
checksum={{ ltc_download_checksum }} |
|
|
|
|
|
|
|
|
|
|
|
- name: Unpack the application |
|
|
|
|
|
become: yes |
|
|
|
|
|
unarchive: |
|
|
|
|
|
remote_src=yes |
|
|
|
|
|
src={{ ltc_download_dest }} |
|
|
|
|
|
dest={{ ltc_unarchive_dest }} |
|
|
|
|
|
owner={{ ltc_user }} |
|
|
|
|
|
group={{ ltc_group }} |
|
|
|
|
|
|
|
|
|
|
|
- name: Move the application to the right folder |
|
|
|
|
|
become: yes |
|
|
|
|
|
command: mv {{ ltc_unarchive_dest }}/litecoin-0.16.3/bin/litecoind {{ ltc_unarchive_dest }} |
|
|
|
|
|
|
|
|
|
|
|
- name: Set the application config |
|
|
|
|
|
become: yes |
|
|
|
|
|
copy: |
|
|
|
|
|
src=config/litecoin.conf |
|
|
|
|
|
dest={{ ltc_config_dir }}/litecoin.conf |
|
|
|
|
|
owner={{ ltc_user }} |
|
|
|
|
|
group={{ ltc_group }} |
|
|
|
|
|
|
|
|
|
|
|
- name: Set the application files permissions |
|
|
|
|
|
become: yes |
|
|
|
|
|
file: |
|
|
|
|
|
dest={{ ltc_home }} |
|
|
|
|
|
owner={{ ltc_user }} |
|
|
|
|
|
group={{ ltc_group }} |
|
|
|
|
|
recurse=yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Add the systemd service |
|
|
|
|
|
become: yes |
|
|
|
|
|
copy: |
|
|
|
|
|
src: systemd-services/ltc-rpc.service |
|
|
|
|
|
dest: /etc/systemd/system/ |
|
|
|
|
|
owner: root |
|
|
|
|
|
group: root |
|
|
|
|
|
|
|
|
|
|
|
- name: Pick up systemd changes |
|
|
|
|
|
become: yes |
|
|
|
|
|
systemd: |
|
|
|
|
|
daemon_reload: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Restart the application |
|
|
|
|
|
become: yes |
|
|
|
|
|
systemd: |
|
|
|
|
|
name: ltc-rpc |
|
|
|
|
|
state: restarted |
|
|
|
|
|
|
|
|
|
|
|
- name: Enable the application to run on system startup |
|
|
|
|
|
become: yes |
|
|
|
|
|
systemd: |
|
|
|
|
|
name: ltc-rpc |
|
|
|
|
|
enabled: yes |
|
|
|
|
|