---
- name: Add apt.cgrates.vhost in nginx
  become: true
  ansible.builtin.template:
    src: nginx.conf.j2
    dest: "/etc/nginx/sites-available/apt.cgrates.org.vhost"
    mode: "0600"
    owner: "{{ rootUser }}"

- name: Create a symlink for apt.cgrates.org
  become: true
  ansible.builtin.file:
    src: "/etc/nginx/sites-available/apt.cgrates.org.vhost"
    dest: "/etc/nginx/sites-enabled/apt.cgrates.org.vhost"
    state: link

- name: Restart the nginx so the change take effects
  become: true
  ansible.builtin.command: "/etc/init.d/nginx reload"
