Skip to content

Commit

Permalink
infra: groestlcoind uses the node role
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed May 12, 2019
1 parent 1bf8422 commit 7261b9c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 121 deletions.
File renamed without changes.
117 changes: 12 additions & 105 deletions infra/deployment/groestlcoind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,110 +3,17 @@
gather_facts: no
roles:
- ubuntu-16-04
- node

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
- node_user: groestlcoin
- node_group: groestlcoin
- node_data_folder: '.groestlcoin'
- node_download_url: https://github.com/Groestlcoin/groestlcoin/releases/download/v2.17.2/groestlcoin-2.17.2-x86_64-linux-gnu.tar.gz
- node_download_checksum: sha1:3f9e18082e89d0e73b0f2c4e1c8305052c7c8f77
- node_compressed_file: /home/ubuntu/groestlcoin.tar.gz
- node_daemon_file: groestlcoin-2.17.2/bin/groestlcoind
- node_config_file: config/nodes/groestlcoin.conf
- node_config_filename: groestlcoin.conf
- node_executable: groestlcoind
- node_service_name: groestlcoin-rpc
16 changes: 0 additions & 16 deletions infra/deployment/systemd-services/groestlcoin-rpc.service

This file was deleted.

0 comments on commit 7261b9c

Please sign in to comment.