nostr/build/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 22 Jul 2023 15:50:36 -0500
changeset 217 e69a030975c4
parent 216 dendrite/build/tasks/main.yaml@6c85835d4621
child 219 0faea2a7570f
permissions -rw-r--r--
Split out nostr install and build roles.

---

- name: install golang
  become: yes
  apt: name="golang-go"

- name: unarchive nostr relayer
  unarchive:
    remote_src: yes
    src: "{{relayer_tar}}"
    dest: "/tmp/"
    creates: "{{relayer_build_dir}}"

- name: check if relayer build exists
  stat:
    path: "{{relayer_build_dir}}/whitelisted/whitelisted"
  register: build_file

- name: build relayer
  command: "go build"
  args:
    chdir: "{{relayer_build_dir}}/whitelisted"
  when: not build_file.stat.exists

- name: create build server dir
  become: yes
  file:
    path: "{{relayer_srv_dir}}"
    mode: "0755"
    state: "directory"
  when: not build_file.stat.exists

- name: copy bin to build server dir
  become: yes
  copy:
    remote_src: yes
    src: "{{relayer_build_dir}}/whitelisted/whitelisted"
    dest: "{{relayer_srv_dir}}/nostr-relayer-whitelisted"
  when: not build_file.stat.exists