Is it possible to jump to the next task without waiting for any Reason Code / Output?

107 views
Skip to first unread message

Julián Jamardo

unread,
Aug 6, 2014, 6:00:59 AM8/6/14
to ansible...@googlegroups.com
Hi everybody,

I'm deploying Adobe CQ projects with Ansible, everything works fine except the restart at the end of the deployment.

The excerpt of the my playbook:

  - name: Stop of CQ instance
    command: sudo /etc/init.d/cq stop

  - name: make sure CQ is stopped
    service: name=cq state=stopped 
       (The Stop works fine, it checks the state and jumps to the next Task)


   
  - name: Start of CQ instance 
    command:
sudo /etc/init.d/cq start     ( The instance starts well but the playbook stops here and ignores the further tasks )


 
I think it is because it doesn't get any Return Code..
Is there a possibility to jump to the next task without any Return Code / Output?
Afterwards I would check if the port 4503 is available and go on cleaning the dispatcher cache and deleting the precompiled jsps as my last tasks.

  - name: CQ Port Monitoring
    wait_for: port=4503 delay=300

  - name: Clean Dispatcher Cache
    shell: rm -rf /opt/daycq/dispatcher/cache/publish*/*

  - name: Delete precompiled jsps
    command: curl -X DELETE http://localhost:4503/var/classes/org/apache/jsp/apps/ -u {{username}}:{{password}}


Thank you in advance

Best regards,
Julián Jamardo

Karl E. Jorgensen

unread,
Aug 6, 2014, 2:02:12 PM8/6/14
to ansible...@googlegroups.com
Hi

On Wed, Aug 06, 2014 at 03:00:59AM -0700, Julián Jamardo wrote:
> Hi everybody,
>
> I'm deploying Adobe CQ projects with Ansible, everything works fine except the
> restart at the end of the deployment.
>
> The excerpt of the my playbook:
>
> - name: Stop of CQ instance
> command: sudo /etc/init.d/cq stop
>
> - name: make sure CQ is stopped
> service: name=cq state=stopped (The Stop works fine, it checks the
> state and jumps to the next Task)
>
> [wNR84w9g]
>
> - name: Start of CQ instance
> command: sudo /etc/init.d/cq start ( The instance starts well but the
> playbook stops here and ignores the further tasks )

I have seen that before on badly written init scripts that do not
detach from the TTY properly. (Or fails to become a process group
leader - not sure which).

Try an experiment: Start the CQ service using ansible. And watch
ansible hang. Leave it hanging. Then (from a different ssh session),
stop the service manually. Does ansible then continue?

If so, it is likely that the CQ instance has the terminal open that
was used for starting it.

Short of fixing the init script, making ansible run:

sudo nohup e/tc/init.d/cq start

may work then.

>
> [AAAAAElFTk]
>
> I think it is because it doesn't get any Return Code..
> Is there a possibility to jump to the next task without any Return Code /
> Output?
> Afterwards I would check if the port 4503 is available and go on cleaning the
> dispatcher cache and deleting the precompiled jsps as my last tasks.
>
> - name: CQ Port Monitoring
> wait_for: port=4503 delay=300
>
> - name: Clean Dispatcher Cache
> shell: rm -rf /opt/daycq/dispatcher/cache/publish*/*
>
> - name: Delete precompiled jsps
> command: curl -X DELETE http://localhost:4503/var/classes/org/apache/jsp/
> apps/ -u {{username}}:{{password}}
>
>
> Thank you in advance
>
> Best regards,
> Julián Jamardo
>

--
Karl E. Jorgensen

Michael DeHaan

unread,
Aug 7, 2014, 5:20:41 PM8/7/14
to ansible...@googlegroups.com
yeah ansible contains some prevention for bad init scripts where it will daemonize around them to "trick" them into returning.

It's occasionally not perfect.

I'm not familiar with Adobe CQ, but what OS are you managing when this happens?



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20140806180200.GA31039%40hawking.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages