0

I'm trying to implement an Ansible command to create or retain a logfile for an open source repo I'm contributing to:

- name: Create (or retain) the {{ celery_application_name }} log file
  copy: content=""
        dest={{ celery_log_file }}
        owner={{ celery_user }}
        group={{ celery_group }}
        force=no

The issue is that this command is hanging unexpectedly. Basically the playbook stalls on this command (only sometimes) and then TravisCI times out because no further logs get called for ten minutes. See for instance this failed build

Is there something incorrect with what I'm doing to create or retain the logfile? Is there a better way to implement this command to avoid Ansible hanging?

Here is the relevant code in the GitHub repo: https://github.com/jcalazan/ansible-django-stack/blob/master/roles/celery/tasks/setup_supervisor.yml

YPCrumble
  • 26,610
  • 23
  • 107
  • 172
  • 2
    Are you sure you don't want [file: state=touch dest=...](https://docs.ansible.com/ansible/2.6/modules/file_module.html#file-module) rather than a `copy` with no content? – mdaniel Sep 12 '18 at 02:21
  • @MatthewLDaniel The current implementation follows [this accepted answer](https://stackoverflow.com/a/34929776/2532070) but I'm trying one of the alternatives now. – YPCrumble Sep 12 '18 at 02:37

0 Answers0