zmcontrol start using ansible task

835 views Asked by At

I am trying to restart zimbra using adhoc command. Services has been restarted except swatchrc logger and snmp. I have tried also using playbook module. unfortunately same services are failed. But if i tried to run the zmprov start or restart on the server itself all services are okay no error found. do you have other understanding or expanation why some sevices is failling if it has been started or restarted using ansible?

[admin@ansible ansible]$ ansible mail -a "/opt/zimbra/bin/zmcontrol start" --become --become-user zimbra
mail.dci.com.ph | FAILED | rc=1 >>
Host mail.xxxxx.xxx.xxx
    Starting zmconfigd...Done.
    Starting logger...Failed.
Starting logswatch...failed.


    Starting mailbox...Done.
    Starting memcached...Done.
    Starting proxy...Done.
    Starting amavis...Done.
    Starting antispam...Done.
    Starting antivirus...Done.
    Starting opendkim...Done.
    Starting snmp...Failed.
creating /opt/zimbra/conf/snmpd.conf
creating /opt/zimbra/conf/swatchrc
Starting swatch...failed.


    Starting spell...Done.
    Starting mta...Done.
    Starting stats...Done.
    Starting service webapp...Done.
    Starting zimbra webapp...Done.
    Starting zimbraAdmin webapp...Done.
    Starting zimlet webapp...Done.non-zero return code

[admin@ansible ansible]$

Server host 
[zimbra@mail ~]$ zmcontrol stop
Host mail.xxxxx.xxx.xxx
    Stopping zmconfigd...Done.
    Stopping zimlet webapp...Done.
    Stopping zimbraAdmin webapp...Done.
    Stopping zimbra webapp...Done.
    Stopping service webapp...Done.
    Stopping stats...Done.
    Stopping mta...Done.
    Stopping spell...Done.
    Stopping snmp...Done.
    Stopping cbpolicyd...Done.
    Stopping archiving...Done.
    Stopping opendkim...Done.
    Stopping amavis...Done.
    Stopping antivirus...Done.
    Stopping antispam...Done.
    Stopping proxy...Done.
    Stopping memcached...Done.
    Stopping mailbox...Done.
    Stopping logger...Done.
    Stopping dnscache...Done.
    Stopping ldap...Done.
zimbra@mail ~]$ zmcontrol start
Host mail.xxxxx.xxx.xxx
    Starting ldap...Done.
    Starting zmconfigd...Done.
    Starting logger...Done.
    Starting mailbox...Done.
    Starting memcached...Done.
    Starting proxy...Done.
    Starting amavis...Done.
    Starting antispam...Done.
    Starting antivirus...Done.
    Starting opendkim...Done.
    Starting snmp...Done.
    Starting spell...Done.
    Starting mta...Done.
    Starting stats...Done.
    Starting service webapp...Done.
    Starting zimbra webapp...Done.
    Starting zimbraAdmin webapp...Done.
    Starting zimlet webapp...Done.
[zimbra@mail ~]$ 
1

There are 1 answers

0
Alexej On

Hi I don't know if you are still waiting for an answer but i made a similar question on the zimbra forum and a user told me it is because ansible does not load bashrc before running the command.

Link to the post: https://forums.zimbra.org/viewtopic.php?f=15&t=70346