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 --- .../roles/config-controller/tasks/Ubuntu.yml | 17 ++++++++++ .../config-controller/templates/sources.list.lab | 7 +++++ .../templates/sources.list.official | 36 ++++++++++++++++++++++ .../ansible/roles/config-controller/vars/main.yml | 10 ++++++ 4 files changed, 70 insertions(+) create mode 100644 deploy/adapters/ansible/roles/config-controller/templates/sources.list.lab create mode 100644 deploy/adapters/ansible/roles/config-controller/templates/sources.list.official create mode 100644 deploy/adapters/ansible/roles/config-controller/vars/main.yml (limited to 'deploy/adapters/ansible/roles/config-controller') 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 diff --git a/deploy/adapters/ansible/roles/config-controller/templates/sources.list.lab b/deploy/adapters/ansible/roles/config-controller/templates/sources.list.lab new file mode 100644 index 00000000..b1e00d05 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-controller/templates/sources.list.lab @@ -0,0 +1,7 @@ +deb [ arch=amd64 ] http://{{LOCAL_REPOSITORY_IP}}/ubuntu/ xenial main restricted universe multiverse +deb [ arch=amd64 ] http://{{LOCAL_REPOSITORY_IP}}/ubuntu/ xenial-security main restricted universe multiverse +deb [ arch=amd64 ] http://{{LOCAL_REPOSITORY_IP}}/ubuntu/ xenial-updates main restricted universe multiverse + +deb-src [ arch=amd64 ] http://{{LOCAL_REPOSITORY_IP}}/ubuntu/ xenial main restricted universe multiverse +deb-src [ arch=amd64 ] http://{{LOCAL_REPOSITORY_IP}}/ubuntu/ xenial-security main restricted universe multiverse +deb-src [ arch=amd64 ] http://{{LOCAL_REPOSITORY_IP}}/ubuntu/ xenial-updates main restricted universe multiverse diff --git a/deploy/adapters/ansible/roles/config-controller/templates/sources.list.official b/deploy/adapters/ansible/roles/config-controller/templates/sources.list.official new file mode 100644 index 00000000..799e4b58 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-controller/templates/sources.list.official @@ -0,0 +1,36 @@ +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. + +deb http://archive.ubuntu.com/ubuntu/ xenial main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted + +## Uncomment the following two lines to add software from the 'universe' +## repository. +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://archive.ubuntu.com/ubuntu/ xenial universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial universe +deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates universe + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +# deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted +# deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted +deb http://archive.ubuntu.com/ubuntu/ xenial-security universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial-security universe +# deb http://archive.ubuntu.com/ubuntu/ xenial-security multiverse +# deb-src http://archive.ubuntu.com/ubuntu/ xenial-security multiverse + diff --git a/deploy/adapters/ansible/roles/config-controller/vars/main.yml b/deploy/adapters/ansible/roles/config-controller/vars/main.yml new file mode 100644 index 00000000..783ea0d0 --- /dev/null +++ b/deploy/adapters/ansible/roles/config-controller/vars/main.yml @@ -0,0 +1,10 @@ +# ############################################################################# +# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# ############################################################################# +--- +LOCAL_REPOSITORY_IP: "192.168.137.222" -- cgit 1.2.3-korg