From 986678b733c0525d0f5017746453c9331f66e4ad Mon Sep 17 00:00:00 2001 From: jsaliba Date: Thu, 14 Sep 2017 10:56:34 +0200 Subject: [PATCH] Moved EPEL installation command to Docker file. Travis now uses custom Docker image built from CentOS Dockerfile. nolog re-enabled for user admin checking. --- .travis.yml | 2 +- tasks/install.redhat.yml | 6 ------ tasks/main.yml | 5 ++--- tests/Dockerfile.centos_7-builded | 7 +++++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 660be23..6a81584 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ env: # MONGODB_VERSION=3.2 - > DISTRIBUTION=centos - DIST_VERSION=7 + DIST_VERSION=7-builded MONGODB_VERSION=3.4 # - > # distribution=ubuntu-upstart diff --git a/tasks/install.redhat.yml b/tasks/install.redhat.yml index d265621..afa0229 100644 --- a/tasks/install.redhat.yml +++ b/tasks/install.redhat.yml @@ -20,12 +20,6 @@ - "{{ 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 diff --git a/tasks/main.yml b/tasks/main.yml index aa5eda6..94d1121 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,11 +27,10 @@ when: mongodb_replication_replset and mongodb_replication_replset != '' tags: [mongodb] -- name: Check user admin is exists +- name: Check where admin user already exists command: > mongo --quiet -u {{ mongodb_user_admin_name }} \ -p {{ mongodb_user_admin_password }} --port {{ mongodb_net_port }} --eval 'db.version()' admin - register: mongodb_user_admin_check changed_when: false always_run: yes # side-effect free, so it can be run in check-mode as well @@ -39,7 +38,7 @@ when: ( mongodb_security_authorization == 'enabled' and (not mongodb_replication_replset or mongodb_replication_replset == '') ) - # no_log: true + no_log: true tags: [mongodb] - name: Include authorization configuration diff --git a/tests/Dockerfile.centos_7-builded b/tests/Dockerfile.centos_7-builded index 19ba849..d86860a 100644 --- a/tests/Dockerfile.centos_7-builded +++ b/tests/Dockerfile.centos_7-builded @@ -1,10 +1,13 @@ FROM centos:7 # This is needed so that ansible managed to read "ansible_default_ipv4" -RUN yum install iproute +RUN yum install iproute -y + +# This step is needed since standard CentOS docker image does not come with EPEL installed by default +RUN yum install epel-release # we can has SSH EXPOSE 22 # pepare for takeoff -CMD ["/usr/sbin/init"] \ No newline at end of file +CMD ["/usr/sbin/init"]