---
- name: Clobber relay.c in Tor {{ tor_release }} with custom relay.c from repo
  become: yes
  become_user: "{{ ssh_username }}"
  copy:
    src: "~{{ ssh_username }}/FingerprintSecureDrop/relay.c"
    dest: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}/src/or/relay.c"
    remote_src: True

- name: Configure Tor {{ tor_release }}
  become: yes
  become_user: "{{ ssh_username }}"
  command: ./configure
  args:
    chdir: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"

- name: Make Tor {{ tor_release }}
  become: yes
  become_user: "{{ ssh_username }}"
  command: make
  args:
    chdir: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"

- name: Install Tor {{ tor_release }}
  become: yes
  command: make install
  args:
    chdir: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"

- name: Configure torrc disable entry guards
  become: yes
  lineinfile:
    dest: /usr/local/etc/tor/torrc
    regexp: "{{ item.regexp }}"
    line: "{{ item.line }}"
    create: yes
  with_items:
    - regexp: "^Entryguards"
      line: "Entryguards 0"
    - regexp: "^ControlPort"
      line: "ControlPort 9051"
    - regexp: "^CookieAuthentication"
      line: "CookieAuthentication 1"

---
- name: Clobber relay.c in Tor {{ tor_release }} with custom relay.c from repo
  become: yes
  become_user: "{{ ssh_username }}"
  copy:
    src: "~{{ ssh_username }}/FingerprintSecureDrop/relay.c"
    dest: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}/src/or/relay.c"
    remote_src: True

- name: Configure Tor {{ tor_release }}
  become: yes
  become_user: "{{ ssh_username }}"
  command: ./configure
  args:
    chdir: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"

- name: Make Tor {{ tor_release }}
  become: yes
  become_user: "{{ ssh_username }}"
  command: make
  args:
    chdir: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"

- name: Install Tor {{ tor_release }}
  become: yes
  command: make install
  args:
    chdir: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"

- name: Configure torrc disable entry guards
  become: yes
  lineinfile:
    dest: /usr/local/etc/tor/torrc
    regexp: "{{ item.regexp }}"
    line: "{{ item.line }}"
    create: yes
  with_items:
    - regexp: "^UseEntryGuards"
      line: "UseEntryGuards 0"
    - regexp: "^ControlPort"
      line: "ControlPort 9051"
    - regexp: "^CookieAuthentication"
      line: "CookieAuthentication 1"

Correct syntax for 'UseEntryGuards' in torrc
Correct syntax for 'UseEntryGuards' in torrc
