- name: Récupérer le hostname en onion
  command: "cat /var/lib/tor/{{ item.name }}/hostname"
  register: web_onion

- name: Configurer l'onion pour les pages perso de l'utilisateurice
  template:
    src: ../files/onion.conf.j2
    dest: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
  notify: reload nginx

- name: Activer la configuration nginx
  file:
    src: "/etc/nginx/sites-available/{{ item.name }}.onion.conf"
    dest: "/etc/nginx/sites-enabled/{{ item.name }}.onion.conf"
    state: link
