From 294e9cbe1d14c06e5d39705f20a8a8a38e5081ff Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 2 Mar 2018 12:11:55 +0100 Subject: [PATCH] Set wheels-mirror for openSUSE Tumbleweed Unfortunately ansible_distribution is "openSUSE Tumbleweed" on tumbleweed, and the whitespace in there is harmful. as there isn't a version with tumbleweed, we can just replace distribution/version with "opensuse-tumbleweed". Change-Id: I21da4b5f851ec864dfb3cbf8ea6713bc12cda58f --- roles/configure-mirrors/tasks/mirror.yaml | 18 +++++++++--------- roles/configure-mirrors/vars/Suse.yaml | 6 ++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/roles/configure-mirrors/tasks/mirror.yaml b/roles/configure-mirrors/tasks/mirror.yaml index 34e2581c8..bea8b57e3 100644 --- a/roles/configure-mirrors/tasks/mirror.yaml +++ b/roles/configure-mirrors/tasks/mirror.yaml @@ -1,12 +1,3 @@ -- name: Install /etc/pip.conf configuration - become: yes - template: - dest: /etc/pip.conf - group: root - mode: 0644 - owner: root - src: etc/pip.conf.j2 - - name: Install .pydistutils.cfg configuration in homedir template: dest: ~/.pydistutils.cfg @@ -20,6 +11,15 @@ - "{{ ansible_os_family }}.yaml" - "default.yaml" +- name: Install /etc/pip.conf configuration + become: yes + template: + dest: /etc/pip.conf + group: root + mode: 0644 + owner: root + src: etc/pip.conf.j2 + - name: Setup distribution specific packaging mirrors include: "{{ item }}" static: no diff --git a/roles/configure-mirrors/vars/Suse.yaml b/roles/configure-mirrors/vars/Suse.yaml index db29c7444..5947d7121 100644 --- a/roles/configure-mirrors/vars/Suse.yaml +++ b/roles/configure-mirrors/vars/Suse.yaml @@ -1 +1,7 @@ package_mirror: "http://{{ mirror_fqdn }}/opensuse" +wheels_slug: "{%- if ansible_distribution == 'openSUSE Tumbleweed' -%} + opensuse-tumbleweed-{{ ansible_architecture | lower }} + {%- else -%} + {{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }} + {%- endif -%}" +wheel_mirror: "http://{{ mirror_fqdn }}/wheel/{{ wheels_slug }}"