---
#- name: Install linx

- name: Create linx user
  user:
    create_home: yes
    home: /var/lib/linx
    system: yes
    state: present
    password: "!"
    update_password: always
    name: linx

- name: Create linx config dir
  file:
    path: /etc/linx
    state: directory

- name: Deploy configuration file
  template:
    src: "linx/server.conf.j2"
    dest: "/etc/linx/server.conf"
    mode: 0644

- name: Install linx systemd unit
  template:
    src: "systemd/system/linx-server.service.j2"
    dest: "/etc/systemd/system/linx-server.service"
    mode: 0644
  notify: Restart linx-server

- name: Load and activate linx systemd unit
  systemd:
    name: linx-server.service
    daemon_reload: true
    enabled: true
    state: started
