node/conf/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Fri, 01 May 2020 17:00:59 -0500
changeset 1 d3ef4e0b4baa
parent 0 474ccafc2349
child 2 0556e208fbee
permissions -rw-r--r--
Expose lnd and btcd to listening public ip.

---

- name: create node data dir
  become: yes
  file:
    path: "{{item}}"
    state: "directory"
    owner: "{{node_user}}"
    group: "{{node_user}}"
    mode: "0770"
  with_items:
    - "{{node_data_dir}}"
    - "{{node_log_dir}}"
    - "{{node_conf_dir}}"

- name: install conf
  become: yes
  template:
    src: "{{node_conf_template}}"
    dest: "{{node_conf_dir}}/{{node_type}}.conf"
    owner: "{{node_user}}"
    group: "{{node_user}}"
    mode: "0770"
  notify: restart node

- name: install node service
  become: yes
  template:
    src: "{{node_service_template}}"
    dest: "/lib/systemd/system/{{node_type}}.service"
    mode: "0644"
  notify: restart node

- name: ensure node is started
  become: yes
  systemd: service="{{node_type}}.service" enabled="yes" state="started" daemon_reload="yes"