---

- name: Strip away configured tor hidden services files
  hosts: securedrop
  become: yes
  tasks:
    - name: Delete tor related keys
      file:
        state: absent
        path: "/var/lib/tor/services/{{ item }}"
      with_items:
        - ssh
        - journalist
        - source
      notify: disable tor
  handlers:
    - name: disable tor
      service:
        enabled: no
        name: tor
        state: stopped

- name: Halt boxes
  hosts: localhost
  connection: local
  tasks:
    - name: Halt vagrant instances
      molecule_vagrant:
        instance_name: "{{ item.name }}"
        instance_raw_config_args: "{{ item.instance_raw_config_args | default(omit) }}"
        platform_box: "{{ item.box }}"
        platform_box_version: "{{ item.box_version | default(omit) }}"
        platform_box_url: "{{ item.box_url | default(omit) }}"
        provider_name: "{{ molecule_yml.driver.provider.name }}"
        provider_memory: "{{ item.memory | default(omit) }}"
        provider_raw_config_args: "{{ item.raw_config_args | default(omit) }}"
        force_stop: yes
        state: halt
      register: server
      with_items: "{{ molecule_yml.platforms }}"
  vars:
    molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
    molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}"

---

- name: Strip away configured tor hidden services files
  hosts: securedrop
  become: yes
  tasks:
    - name: Delete tor related keys
      file:
        state: absent
        path: "/var/lib/tor/services/{{ item }}"
      with_items:
        - ssh
        - journalist
        - source
      notify: disable tor
  handlers:
    - name: disable tor
      service:
        enabled: yes
        name: tor
        state: stopped

- name: Halt boxes
  hosts: localhost
  connection: local
  tasks:
    - name: Halt vagrant instances
      molecule_vagrant:
        instance_name: "{{ item.name }}"
        instance_raw_config_args: "{{ item.instance_raw_config_args | default(omit) }}"
        platform_box: "{{ item.box }}"
        platform_box_version: "{{ item.box_version | default(omit) }}"
        platform_box_url: "{{ item.box_url | default(omit) }}"
        provider_name: "{{ molecule_yml.driver.provider.name }}"
        provider_memory: "{{ item.memory | default(omit) }}"
        provider_raw_config_args: "{{ item.raw_config_args | default(omit) }}"
        force_stop: yes
        state: halt
      register: server
      with_items: "{{ molecule_yml.platforms }}"
  vars:
    molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
    molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}"

Make sure tor starts up on reboot
Make sure tor starts up on reboot
