summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/add_custom_repos/tasks/ubuntu.yml7
-rw-r--r--ansible/roles/add_custom_repos/templates/sources.list.j23
2 files changed, 10 insertions, 0 deletions
diff --git a/ansible/roles/add_custom_repos/tasks/ubuntu.yml b/ansible/roles/add_custom_repos/tasks/ubuntu.yml
index c0ba89c0b..4658fe514 100644
--- a/ansible/roles/add_custom_repos/tasks/ubuntu.yml
+++ b/ansible/roles/add_custom_repos/tasks/ubuntu.yml
@@ -12,6 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
+- name: Check multiverse repository
+ shell: "apt-cache policy | grep {{ release }}/multiverse"
+ args:
+ executable: /bin/bash
+ register: multiverse_repos
+ ignore_errors: yes
+
- name: add custom repos
template:
src: sources.list.j2
diff --git a/ansible/roles/add_custom_repos/templates/sources.list.j2 b/ansible/roles/add_custom_repos/templates/sources.list.j2
index 4b50f45ce..61fbe43aa 100644
--- a/ansible/roles/add_custom_repos/templates/sources.list.j2
+++ b/ansible/roles/add_custom_repos/templates/sources.list.j2
@@ -2,4 +2,7 @@
deb [arch={{ YARD_IMG_ARCH }}] http://ports.ubuntu.com/ {{ release }}-backports main restricted universe multiverse
{% else %}
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ {{ release }}-backports main restricted universe multiverse
+ {% if multiverse_repos.rc != 0 %}
+deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ {{ release }} multiverse
+ {% endif %}
{% endif %}