refactoring

This commit is contained in:
Robert Kaussow 2017-12-22 12:59:12 +01:00
parent a0ca07c3ab
commit 19e868e238
2 changed files with 28 additions and 12 deletions

9
handlers/main.yml Normal file
View File

@ -0,0 +1,9 @@
---
- name: Restart mongodb
systemd:
name: mongod
state: restarted
enabled: yes
daemon_reload: yes
listen:
- "mongod_restart"

View File

@ -1,14 +1,21 @@
---
- name: add mongodb repo
yum-repository:
name: mongodb-org-3.4
description: MongoDB Repository
baseurl: https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck: yes
enabled: yes
gpgkey: https://www.mongodb.org/static/pgp/server-3.4.asc
- block:
- name: Add mongodb repo
yum-repository:
name: mongodb-org-3.4
description: MongoDB Repository
baseurl: https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck: yes
enabled: yes
gpgkey: https://www.mongodb.org/static/pgp/server-3.4.asc
notify:
- mongod_restart
- name: install mongodb package
package:
name: 'mongodb-org'
state: latest
- name: Install mongodb package
package:
name: 'mongodb-org'
state: latest
notify:
- mongod_restart
become: True
become_user: root