ergo/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 24 Jul 2021 22:12:04 -0500
changeset 173 82f2bcbc5aca
parent 170 a20a6d03747f
child 174 431c6d5e5dd4
permissions -rw-r--r--
Fixed typo

---

- name: add ergo user
  become: yes
  user: name="ergo"

- name: download ergo
  become: yes
  unarchive:
    remote_src: yes
    src: "{{ergo_url}}"
    dest: "/tmp"
    creates: "/tmp/{{ergo_tar_name}}/"

- name: install ergo
  become: yes
  copy:
    src: "/tmp/{{ergo_tar_name}}/ergo"
    dest: "/usr/local/bin/"
    remote_src: yes
    owner: "root"
    group: "root"
    mode: "0755"
  notify: restart ergo

- name: create ergo dirs
  become: yes
  file:
    path: "{{item}}/ergo"
    owner: "ergo"
    group: "ergo"
    mode: "0755"
    state: "directory"
  loop:
    - "/etc"
    - "/var"

- name: configure ergo
  become: yes
  template:
    src: "config.yaml.j2"
    dest: "/etc/ergo/config.yaml"
    owner: "ergo"
    group: "ergo"
    mode: "0644"
  notify: reload ergo

- name: copy motd file
  become: yes
  copy:
    src: "{{ergo_motd}}"
    dest: "/etc/ergo/motd"
  notify: reload ergo

- name: install ergo service
  become: yes
  copy:
    src: "ergo.service"
    dest: "/lib/systemd/system/ergo.service"
    mode: "0644"
  notify: restart ergo

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