From 191324087c0fc0524f8566de8eeec3e35e34dcca Mon Sep 17 00:00:00 2001 From: wutianwei Date: Tue, 4 Jul 2017 17:46:39 +0800 Subject: fetch openrc for functest We use openstack-ansible to deploy the openstack, the position of openrc is different from the before. change the apt source when use local apt repository Change-Id: I1c5492b294a8645f452868c9cf2fec2e0802f823 Signed-off-by: wutianwei --- .../ansible/roles/config-controller/tasks/Ubuntu.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml') diff --git a/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml index 53c2d502..c878ab7f 100644 --- a/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml +++ b/deploy/adapters/ansible/roles/config-controller/tasks/Ubuntu.yml @@ -13,3 +13,20 @@ dest: /etc/network/interfaces notify: - restart network service + +- name: check apt source + shell: "ping -c 2 {{LOCAL_REPOSITORY_IP}} > /dev/null" + register: checkresult + ignore_errors: "true" + +- name: change sources list(apt) + template: + src: sources.list.lab + dest: /etc/apt/sources.list + when: checkresult.rc == 0 + +- name: change sources list(apt) + template: + src: sources.list.official + dest: /etc/apt/sources.list + when: checkresult.rc != 0 -- cgit 1.2.3-korg