Support other architectures in apt sources.list

The install-apt task of the bootstrap-host role obtains the apt
repository URL by performing an awk regex to match on "/ubuntu/".

Other architectures however, such as ppc64le, contain "/ubuntu-ports/"
in the URL which causes the regex to fail.

This patch modifies the awk regex to match any characters which exist
after "/ubuntu" and before the trailing "/".

Change-Id: I5417498dc89407edd642fd8f8fdce9745acb1759
This commit is contained in:
Chris Smart 2016-07-19 11:05:32 +10:00 committed by Kevin Carter (cloudnull)
parent 71ba5256c6
commit e2663c6a13

View File

@ -21,7 +21,7 @@
- apt-install-prerequisites
- name: Determine the existing Ubuntu repo configuration
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
shell: 'awk "/^deb .*ubuntu.*\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_repo
when:
- bootstrap_host_ubuntu_repo is not defined
@ -30,7 +30,7 @@
- find-apt-repo
- name: Determine the existing Ubuntu Security repo configuration
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }}-security main/ {print \$2; exit}" /etc/apt/sources.list'
shell: 'awk "/^deb .*ubuntu.*\/? {{ ansible_distribution_release }}-security main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_security_repo
when:
- bootstrap_host_ubuntu_security_repo is not defined