You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.8 KiB

---
- hosts: groestlcoind
gather_facts: no
roles:
- ubuntu-16-04
vars:
- x_user: groestlcoin
- x_group: groestlcoin
- x_home: /home/groestlcoin
- x_config_dir: /home/groestlcoin/.groestlcoin
- x_download_url: https://github.com/Groestlcoin/groestlcoin/releases/download/v2.17.2/groestlcoin-2.17.2-x86_64-linux-gnu.tar.gz
- x_download_dest: /home/ubuntu/groestlcoin.tar.gz
- x_download_checksum: sha1:3f9e18082e89d0e73b0f2c4e1c8305052c7c8f77
- x_unarchive_dest: /home/groestlcoin/app
tasks:
- name: Create the groestlcoin group
become: yes
group:
name={{ x_group }}
state=present
- name: Create the groestlcoin user
become: yes
user:
name={{ x_user }}
group={{ x_group }}
state=present
system=yes
- name: Create the app directory
become: yes
file:
path={{ x_home }}/app
state=directory
owner={{ x_user }}
group={{ x_group }}
- name: Create the config directory
become: yes
file:
path={{ x_config_dir }}
state=directory
owner={{ x_user }}
group={{ x_group }}
- name: Download the groestlcoind
get_url:
url={{ x_download_url }}
dest={{ x_download_dest }}
checksum={{ x_download_checksum }}
- name: Unpack the application
become: yes
unarchive:
remote_src=yes
src={{ x_download_dest }}
dest={{ x_unarchive_dest }}
owner={{ x_user }}
group={{ x_group }}
- name: Move the application to the right folder
become: yes
command: mv {{ x_unarchive_dest }}/groestlcoin-2.17.2/bin/groestlcoind {{ x_unarchive_dest }}
- name: Set the application as executable
become: yes
file:
path: "{{ x_unarchive_dest }}/groestlcoind"
mode: "u=rwx"
- name: Set the application config
become: yes
copy:
src=config/groestlcoin.conf
dest={{ x_config_dir }}/groestlcoin.conf
owner={{ x_user }}
group={{ x_group }}
- name: Set the application files permissions
become: yes
file:
dest={{ x_home }}
owner={{ x_user }}
group={{ x_group }}
recurse=yes
- name: Add the systemd service
become: yes
copy:
src: systemd-services/groestlcoin-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: groestlcoin-rpc
state: restarted
- name: Enable the application to run on system startup
become: yes
systemd:
name: groestlcoin-rpc
enabled: yes