Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
- Fail faster when upgrading apt.
- Provide a more descriptive message if apt traffic is redirected.
  • Loading branch information
emkll committed Jan 24, 2019
1 parent 4204d02 commit 088823f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
# redirects are followed when updating apt via apt.
- name: Upgrade apt without following redirects
shell : |
apt -o Acquire::http::AllowRedirect=false update
apt -o Acquire::http::AllowRedirect=false update && \
apt -o Acquire::http::AllowRedirect=false --only-upgrade -y install apt
become: yes
register: _apt_upgrade_command_output_results
changed_when: "'1 upgraded, 0 newly installed, 0 to remove' in _apt_upgrade_command_output_results.stdout"
tags: apt

- name: Inform user that apt traffic is being redirected
assert:
that: "{{ '302 Found' in _apt_upgrade_command_output_results.stdout }}"
fail_msg: "It appears your apt traffic is being redirected, SecureDrop cannot be installed. See issue #4058 for details"

- name: Get apt version
shell: dpkg-query --showformat='${Version}' --show apt
register: _apt_query_command_output_result
Expand Down

0 comments on commit 088823f

Please sign in to comment.