Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installs release-upgrader in prepare-servers role #5792

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
SecureDrop cannot be installed. For details, see
https://github.com/freedomofpress/securedrop/issues/4058
- name: Install python and packages required by installer
raw: apt install -y python3 apt-transport-https dnsutils ubuntu-release-upgrader-core
register: _apt_install_prereqs_results
changed_when: "'0 upgraded, 0 newly installed, 0 to remove' not in _apt_install_prereqs_results.stdout"

- name: Remove cloud-init
apt:
name: cloud-init
state: absent
purge: yes
tags:
- apt

- name: Install python and packages required by installer
raw: apt install -y python apt-transport-https dnsutils
register: _apt_install_prereqs_results
changed_when: "'0 upgraded, 0 newly installed, 0 to remove' not in _apt_install_prereqs_results.stdout"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I revised the order of these tasks, because we must ensure that python3 is present before using an Ansible module. That's why the previous tasks are using raw, because we aren't sure yet.

10 changes: 10 additions & 0 deletions molecule/testinfra/common/test_release_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
testinfra_hosts = [test_vars.app_hostname, test_vars.monitor_hostname]


def test_release_manager_installed(host):
"""
The securedrop-config package munges `do-release-upgrade` settings
that assume the release-upgrader logic is installed. On hardware
installs of Ubuntu, it is, but the VM images we use in CI may
remove it to make the boxes leaner.
"""
assert host.package("ubuntu-release-upgrader-core").is_installed


def test_release_manager_upgrade_channel(host):
"""
Ensures that the `do-release-upgrade` command will not
Expand Down
1 change: 1 addition & 0 deletions molecule/testinfra/common/test_system_hardening.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def test_no_ecrypt_messages_in_logs(host, logfile):
@pytest.mark.parametrize('package', [
'cloud-init',
'libiw30',
'python-is-python2',
'snapd',
'wireless-tools',
'wpasupplicant',
Expand Down