Comments (4)
I think this is a general problem with Ansible, and/or maybe systemd. You can do a wait_for
in a wrapping role — for the service to start up, and check based on this.
Otherwise, I've created a play to do this (I run 4 nodes, so adjust your output):
- hosts: minio
gather_facts: no
tasks:
- name: Check systemd minio status
command: systemctl status minio
register: minio_status
failed_when: not (minio_status.stdout_lines | select("match", "4 Online, 0 Offline."))
from ansible-minio.
Hi @katia-e, do you have any example of variables you used to configure the role to try to reproduce the issue?
from ansible-minio.
For example I set up the following config.yaml
:
- name: "Install Minio"
hosts: servers
roles:
- atosatto.minio
vars:
minio_server_datadirs:
- "/mnt/vdb"
- "/mnt/vdc"
- "/mnt/vdd"
This config cannot succeed due to the number of minio_server_datadirs
= 3 (should be 4+), so I expect minio to install correctly, but fail to start.
In result I see no failed tasks:
PLAY RECAP *************************************************************************************************************
195.134.212.39 : ok=13 changed=1 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
But MinIO service failed to start on the remote machine. With this issue I was wondering if it's possible to return error if MinIO failed to start. Otherwise Ansible reports success, while some tasks failed.
from ansible-minio.
I discovered this by accident when trying to change users and permissions are wrong.
One problem I found is that some issues actually the playbook may be returning OK because this check
ansible-minio/tasks/install-server.yml
Lines 86 to 90 in 15ad3a3
Actually not fail. And this may happens because take some seconds to systemd actually report the minio as failed because minio may take some time to report as failed for real
I'm not very sure how to implement a check for this, but maybe one very simple way would be give at least a few seconds (for sure no less than 5 seconds) to check at at the end of the playbook if the service still working.
Note about molecule tests & check if services are running
These types of check are complicated to test with docker and may require much larger docker images that have systemd or equivalent. If the current docker images already not works with these checks, not enable such checks when running inside containers could still valid, since on real VPS they are likely to work fine.
from ansible-minio.
Related Issues (14)
- Allow minio to bind to lower ports
- Secure user HOT 1
- Service does not start under Ubuntu 16.04 LTS HOT 6
- Fails to run from master branch HOT 6
- Why systemd Restart=on-success rule ? HOT 3
- Can't connect to SSL URL to get checksum HOT 3
- Suggestion to allow disable create/update the default user/group running minio and, if is created by this role, set `create_home: no` HOT 2
- Send output of StdErr to journald
- How can we scale minio cluster disks by this ansible for an already running cluster?
- Checksuming fails HOT 3
- cluster_nodes:
- Jinja2 template issue HOT 1
- Add OS/arch support matrix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-minio.