node/conf/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 10 May 2020 17:28:15 -0500
changeset 3 74f60cd1440b
parent 2 0556e208fbee
child 4 9934a00b9e97
permissions -rw-r--r--
Config tweaks

---

- 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: "0644"
  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"