Fix warnings

This commit is contained in:
Sergei Antipov 2018-02-15 13:14:31 +07:00
parent bd80043e76
commit 2aa63f5f16
7 changed files with 22 additions and 18 deletions

View File

@ -88,9 +88,13 @@ before_install:
- sudo pip install docker-py==1.5.0
# Pull docker image or build it
- >
if [ -f tests/Dockerfile.${DISTRIBUTION}_${DIST_VERSION} ]; then
if [ -f tests/Dockerfile.${DISTRIBUTION}_${DIST_VERSION} ]
then
sudo docker build --rm=true --file=tests/Dockerfile.${DISTRIBUTION}_${DIST_VERSION}
--tag ${DISTRIBUTION}:${DIST_VERSION} tests; else sudo docker pull ${DISTRIBUTION}:${DIST_VERSION}; fi
--tag ${DISTRIBUTION}:${DIST_VERSION} tests
else
sudo docker pull ${DISTRIBUTION}:${DIST_VERSION}
fi
- sudo ln -s ${PWD} /etc/ansible/roles/greendayonfire.mongodb
script:

View File

@ -4,10 +4,10 @@ dependencies: []
galaxy_info:
author: Sergei Antipov
company: 2GIS
company: Self-employed
description: Manage MongoDB with authentication and replica sets
license: GPLv2
min_ansible_version: 2.0
min_ansible_version: 2.4
platforms:
- name: Ubuntu
versions:

View File

@ -32,8 +32,9 @@
- name: Create log if missing
file: state=touch dest={{ mongodb_systemlog_path }} owner={{ mongodb_user }} group={{mongodb_user}} mode=0755
when: logfile_stat is defined and not logfile_stat.stat.exists
when: mongodb_systemlog_destination == "file"
when: ( logfile_stat is defined
and not logfile_stat.stat.exists
and mongodb_systemlog_destination == "file" )
- name: Ensure dbpath directory
file:

View File

@ -4,7 +4,7 @@
stat: path=/sbin/init
register: sbin_init
changed_when: false
always_run: yes # side-effect free, so it can be run in check-mode as well
check_mode: no
- name: Establish some role-related facts
set_fact:

View File

@ -7,15 +7,15 @@
- "{{ ansible_os_family }}.yml"
- name: Include installation on Debian-based OS
include: "install.{{ ansible_os_family | lower }}.yml"
include_tasks: "install.{{ ansible_os_family | lower }}.yml"
tags: [mongodb]
- name: Include configuration.yml
include: configure.yml
include_tasks: configure.yml
tags: [mongodb]
- name: Include replication and auth configuration
include: replication_init_auth.yml
include_tasks: replication_init_auth.yml
when: ( mongodb_replication_replset
and mongodb_replication_replset != ''
and mongodb_security_authorization == 'enabled'
@ -23,7 +23,7 @@
tags: [mongodb]
- name: Include replication configuration
include: replication.yml
include_tasks: replication.yml
when: mongodb_replication_replset and mongodb_replication_replset != ''
tags: [mongodb]
@ -33,7 +33,7 @@
-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
check_mode: no
ignore_errors: true
when: ( mongodb_security_authorization == 'enabled'
and (not mongodb_replication_replset
@ -42,7 +42,7 @@
tags: [mongodb]
- name: Include authorization configuration
include: auth_initialization.yml
include_tasks: auth_initialization.yml
when: ( mongodb_security_authorization == 'enabled'
and (not mongodb_replication_replset
or mongodb_replication_replset == '')
@ -88,6 +88,6 @@
tags: [mongodb]
- name: Include MMS Agent configuration
include: mms-agent.yml
include_tasks: mms-agent.yml
when: mongodb_mms_api_key != ""
tags: [mongodb]

View File

@ -16,7 +16,7 @@
register: mongodb_replica_init
ignore_errors: true
- include: auth_initialization.yml
- include_tasks: auth_initialization.yml
when: mongodb_replica_init|failed
- name: Replication configuration | 2nd Pt

View File

@ -6,7 +6,7 @@
gather_facts: no
tasks:
- name: Run MongoDB cluster in Docker
docker:
docker_container:
name: "{{ item }}"
image: "{{ image_name }}"
command: "/sbin/init"
@ -31,4 +31,3 @@
roles:
- role: greendayonfire.mongodb
when: "'mongo_replicas' in group_names"