summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-01 07:34:41 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-01 07:34:41 +0000
commitf7a3cef287979664d1812cdd4dd88276732ec8b8 (patch)
treebe9a227350e0b6f1f13431fa98ca0f1896593088
parenta87c0902f957beaf93e62f3aeb48584caf871a27 (diff)
parentc935f66bb14bbba3747a37a195aa1c4f49d36219 (diff)
Merge "Introduced default values and remove unnecessary ones from ansible code image build code."
-rw-r--r--ansible/group_vars/all.yml5
-rw-r--r--ansible/image_uploaders/upload_ubuntu_image.yml2
-rw-r--r--ansible/roles/add_custom_repos/templates/sources.list.j24
-rw-r--r--ansible/roles/add_custom_repos/vars/main.yml3
-rw-r--r--ansible/roles/install_dependencies/tasks/RedHat.yml27
-rw-r--r--ansible/roles/install_image_dependencies/tasks/main.yml4
-rwxr-xr-xtests/ci/ansible_load_images.sh5
7 files changed, 11 insertions, 39 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
new file mode 100644
index 000000000..2690228c3
--- /dev/null
+++ b/ansible/group_vars/all.yml
@@ -0,0 +1,5 @@
+---
+clone_dest: /opt/tempT
+release: xenial
+target_os: Ubuntu
+ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw
diff --git a/ansible/image_uploaders/upload_ubuntu_image.yml b/ansible/image_uploaders/upload_ubuntu_image.yml
index dcfe6480c..1cf7d0a32 100644
--- a/ansible/image_uploaders/upload_ubuntu_image.yml
+++ b/ansible/image_uploaders/upload_ubuntu_image.yml
@@ -21,7 +21,7 @@
when: fdio
- os_image:
- name: "{{ ubuntu_image }}"
+ name: "{{ ubuntu_image_file | basename }}"
is_public: yes
disk_format: qcow2
container_format: bare
diff --git a/ansible/roles/add_custom_repos/templates/sources.list.j2 b/ansible/roles/add_custom_repos/templates/sources.list.j2
index 86be348f6..af741cb10 100644
--- a/ansible/roles/add_custom_repos/templates/sources.list.j2
+++ b/ansible/roles/add_custom_repos/templates/sources.list.j2
@@ -1,5 +1,5 @@
{% if YARD_IMG_ARCH == "arm64" %}
-deb [arch={{ YARD_IMG_ARCH }}] http://ports.ubuntu.com/ {{ ubuntu_release[target_os_version] }}-backports main restricted universe multiverse
+deb [arch={{ YARD_IMG_ARCH }}] http://ports.ubuntu.com/ {{ release }}-backports main restricted universe multiverse
{% else %}
-deb http://archive.ubuntu.com/ubuntu/ {{ ubuntu_release[target_os_version] }}-backports main restricted universe multiverse
+deb http://archive.ubuntu.com/ubuntu/ {{ release }}-backports main restricted universe multiverse
{% endif %}
diff --git a/ansible/roles/add_custom_repos/vars/main.yml b/ansible/roles/add_custom_repos/vars/main.yml
deleted file mode 100644
index 03ed6e446..000000000
--- a/ansible/roles/add_custom_repos/vars/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-ubuntu_release:
- "16.04": xenial
- "14.04": trusty \ No newline at end of file
diff --git a/ansible/roles/install_dependencies/tasks/RedHat.yml b/ansible/roles/install_dependencies/tasks/RedHat.yml
index b725933d0..a5d4d0b15 100644
--- a/ansible/roles/install_dependencies/tasks/RedHat.yml
+++ b/ansible/roles/install_dependencies/tasks/RedHat.yml
@@ -17,8 +17,6 @@
when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux']
- name: Install core packages
- # we need to recompile the kernel, but we don't need libvirtd it will
- # run in a container
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items:
- deltarpm
@@ -30,7 +28,6 @@
- screen
- git
- socat
- #
- sshpass
- qemu-kvm
- qemu-img
@@ -38,7 +35,6 @@
- libxslt-devel
- libffi-devel
- openssl-devel
- - zeromq2-devel
- nginx
- uwsgi
- uwsgi-plugin-python
@@ -47,25 +43,4 @@
- libffi-devel
- python-devel
- kpartx
- # don't install kernel-devel here it will trigger unwanted kernel upgrade
- # Mandatory Packages:
- # Don't use yum groups, they don't work, expand them manually
- # CentOS 'Development Tools' group
-# - autoconf
-# - automake
-# - binutils
-# - bison
-# - flex
-# - gcc
-# - gcc-c++
-# - gettext
-# - libtool
-# - make
-# - patch
-# - pkgconfig
-# - redhat-rpm-config
-# - rpm-build
-# - rpm-sign
- # Fedora 'C Development Tools' group
- # don't use ccache, it can get weird for kernel compiles
-# - ccache
+
diff --git a/ansible/roles/install_image_dependencies/tasks/main.yml b/ansible/roles/install_image_dependencies/tasks/main.yml
index 33d99af06..f3a3151c5 100644
--- a/ansible/roles/install_image_dependencies/tasks/main.yml
+++ b/ansible/roles/install_image_dependencies/tasks/main.yml
@@ -13,11 +13,11 @@
# limitations under the License.
---
- name: OS pre-workarounds
- include: "{{ target_os_family }}.yml"
+ include: "{{ ansible_os_family }}.yml"
- name: Install core packages
action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest"
register: pkg_mgr_results
retries: "{{ pkg_mgr_retries }}"
until: pkg_mgr_results|success
- with_items: "{{ install_dependencies[target_os_family] }}"
+ with_items: "{{ install_dependencies[ansible_os_family] }}"
diff --git a/tests/ci/ansible_load_images.sh b/tests/ci/ansible_load_images.sh
index 4f62024db..9a2d8ef18 100755
--- a/tests/ci/ansible_load_images.sh
+++ b/tests/ci/ansible_load_images.sh
@@ -24,9 +24,4 @@ ansible-playbook \
-e img_modify_playbook='ubuntu_server_cloudimg_modify.yml' \
-e target_os='Ubuntu' \
-e YARD_IMG_ARCH='amd64' \
- -e target_os_version='16.04' \
- -e target_os_family='Debian' \
- -e clone_dest='/usr/local/src' \
- -e ubuntu_image='yardstick-trusty-server.raw' \
- -e ubuntu_image_file='/tmp/workspace/yardstick/yardstick-trusty-server.raw' \
-vvv -i inventory.ini load_images.yml