---
- name: install nomachine node and RDP client
  yum:
    name:
      - "{{ nomachine_node_rpm }}"
      - freerdp.x86_64
      - remmina.x86_64
      - remmina-plugins-rdp.x86_64
      - git
      - "{{ nomachine_node_extra_pkg |join(',') }}"
    state: present
  tags: setup

- name: setup nx node
  template:
    src: nx_node.cfg
    dest: /usr/NX/etc/node.cfg
    owner: nx
    group: nx
    mode: 0644
  notify: restart_nx

- name: setup nx node server.cfg
  template:
    src: nx_server.cfg.j2
    dest: /usr/NX/etc/server.cfg
    owner: nx
    group: nx
    mode: 0644
  notify: restart_nx

- name: setup nx desktop
  template:
    src: start-desktop
    dest: /usr/local/bin/start-desktop
    owner: root
    group: root
    mode: 0755
