Open ze42 opened 3 years ago
Not sure why Amazonlinux fails.
mmm... might be a bug in salt I've seen some time ago, and might still be there.
Enabling and launching at the same time fails. Splitting into 2 states (service.enabled and service.running) might do the trick.
HI, this PR is quite old now but I' interested in reviewing it to merge it if possible because I'm facing the same bug.
I rebased this branch on master
, added an Inspec test
diff --git a/test/integration/default/controls/archive_spec.rb b/test/integration/default/controls/archive_spec.rb
index 432ad9a..a2a2c24 100644
--- a/test/integration/default/controls/archive_spec.rb
+++ b/test/integration/default/controls/archive_spec.rb
@@ -3,6 +3,9 @@
control 'mongodb components' do
title 'should be installed'
+ describe service('mongod') do
+ it { should be_running }
+ end
# describe package('unzip') do
# it { should be_installed }
# end
and I still have a problem with service not running
× mongodb components: should be installed (1 failed)
× Service mongod is expected to be running
expected that `Service mongod` is running
FYI: even removing those onlyif
, I don't have mongod
service running, even if the converge
pass
Testing daks test, and getting the same error, but...
Salt states in is running while applying...
ID: mongodb-service-running-database-mongod
Function: service.running
Name: mongod
Result: True
Comment: Service mongod has been enabled, and is running
Started: 12:46:32.712630
Duration: 637.408 ms
Changes:
----------
mongod:
True
And tests states it is not
× mongodb components: should be installed (1 failed)
× Service mongod is expected to be running
expected that `Service mongod` is running
Removing that test. If anyone has ideas about it...
Fix service detection to properly ensure the service is running. Command also updated at other service.running/dead onlyif.
Fixes https://github.com/saltstack-formulas/mongodb-formula/issues/93 with the change suggested there