From 429e10855115e9004c6f01bd1a1889b749531ede Mon Sep 17 00:00:00 2001 From: jsaliba Date: Thu, 14 Sep 2017 08:57:16 +0200 Subject: [PATCH] Trying to get Docker tests to work by running tests in privileged containers and installing EPEL repository for CentOS image. --- tasks/install.redhat.yml | 20 ++++++++++++++++++++ tests/site.yml | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tasks/install.redhat.yml b/tasks/install.redhat.yml index bb28223..725484c 100644 --- a/tasks/install.redhat.yml +++ b/tasks/install.redhat.yml @@ -1,5 +1,9 @@ --- +- name: Establish some role-related facts + set_fact: + mongodb_major_version: "{{ mongodb_version[0:3] }}" + - name: Add YUM repository template: src: mongodb.repo.j2 @@ -16,12 +20,28 @@ - "{{ mongodb_package }}" - numactl +# This step is needed when running CentOS in Docker since the docker image does not come with EPEL installed by default +- name: Install EPEL release + yum: + name: epel-release + state: present + - name: Install PyMongo package yum: name: python-pymongo state: latest when: not mongodb_pymongo_from_pip +# - name: Install python-devel +# yum: +# name: "python-devel" +# when: mongodb_pymongo_from_pip + +# - name: Install PIP +# yum: +# name: "python-pip" +# when: mongodb_pymongo_from_pip + - name: Install PIP yum: name: "{{ item }}" diff --git a/tests/site.yml b/tests/site.yml index 1ab4162..ff456d2 100644 --- a/tests/site.yml +++ b/tests/site.yml @@ -11,11 +11,12 @@ image: "{{ image_name }}" command: "/sbin/init" state: started + privileged: true with_items: - mongo1 - mongo2 - mongo3 - + - hosts: "{{ target }}" become: no gather_facts: yes