lnurld/server/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 22 Jul 2023 23:27:09 -0500
changeset 218 1db4800bc4f5
parent 217 nostr/relayer/tasks/main.yaml@e69a030975c4
permissions -rw-r--r--
Got lnurld running.

---

- name: add lnurld user
  become: yes
  user: name="{{lnurld_user}}" shell="/bin/false" system="yes"

- name: install lnurld bin
  become: yes
  get_url:
    url: "{{lnurld_bin_url}}"
    dest: "/usr/local/bin/lnurld"
    mode: "0755"
  notify: restart lnurld service

- name: create lnurld data dir
  become: yes
  file:
    path: "{{lnurld_data_dir}}"
    mode: "0710"
    owner: "{{lnurld_user}}"
    group: "{{lnurld_user}}"
    state: "directory"

- name: create lnurld etc dir
  become: yes
  file:
    path: "/etc/lnurld/"
    mode: "0755"
    state: "directory"

- name: install lnurld config
  become: yes
  template:
    src: "config.yaml.j2"
    dest: "/etc/lnurld/config.yaml"
    owner: "{{lnurld_user}}"
    group: "{{lnurld_user}}"
    mode: "0600"
  notify: restart lnurld service

- name: install lnurld systemd service
  become: yes
  template:
    src: "lnurld.service.j2"
    dest: "/lib/systemd/system/lnurld.service"
  notify: restart lnurld service

- name: ensure service is started
  become: yes
  systemd: name="lnurld.service" enabled="yes" state="started"