gchq / stroom-ansible

A home for all stroom related ansible playbooks, roles, etc.
Apache License 2.0
4 stars 6 forks source link

cron entry creation for non_docker_stroom doesn't work #20

Closed arterialplan closed 3 years ago

arterialplan commented 3 years ago

This is for dw-v7 branch Error message:

TASK [non_docker_stroom/update_config : Add APP log delivery task to crontab] *************************************************************************************************************************************************************
fatal: [stroom-ui-host-1]: FAILED! => changed=false
  msg: |-
    must be privileged to use -u

This is due to alreading being set to become_user: "{{ stroom_user }}" (in install_mixed_cluster.yml), but setting the user within the cron entry in ansible. Solution is to delete or comment out the user in the cron entry.

- name: Add APP log delivery task to crontab
  cron:
    name: "Add STROOM-APP-EVENTS cronjob"
    state: present
    #user: "{{ stroom_user }}"
    minute: "*"
    hour: "*"
    job: "{{ stroom_home_dir }}/bin/send_to_stroom.sh --cert {{ stroom_app_home_dir }}/certs/server.pem.crt --cacert {{ stroom_app_home_dir }}/certs/ca.pem.crt --delete-after-sending--file-regex '.*[a-z]+-[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}\\.log' --system STROOM --environment \"{{ environment_name }}\" {{ stroom_app_home_dir }}/logs/app/ STROOM_APP-EVENTS https://{{hostvars[groups['stroom_services_stack'][0]]['public_ip_address']}}/stroom/datafeeddirect >/dev/null 2>&1"
  tags:
    - deploy
    - configure

This will need to be done for all three cron entries

stroomdev00 commented 3 years ago

878ceb321dc5b962c884a90dd928ec907771059e