{"id":3989,"sha1":"cebf89ee9f92c775d8c6da47695b4a2290220621","playbook":{"id":1998,"items":{"plays":1,"tasks":6,"results":86,"hosts":17,"files":6,"records":0},"arguments":{"version":null,"verbosity":2,"private_key_file":"/home/ssh-gateway/.ssh/id_rsa","remote_user":"root","connection":"ssh","timeout":null,"ssh_common_args":null,"sftp_extra_args":null,"scp_extra_args":null,"ssh_extra_args":null,"ask_pass":false,"connection_password_file":null,"force_handlers":false,"flush_cache":false,"become":false,"become_method":"sudo","become_user":null,"become_ask_pass":false,"become_password_file":null,"tags":["all"],"skip_tags":[],"check":false,"diff":false,"inventory":["/home/ssh-gateway/ansible/kuly/missing-im360"],"listhosts":false,"subset":null,"extra_vars":"Not saved by ARA as configured by 'ignored_arguments'","vault_ids":[],"ask_vault_pass":false,"vault_password_files":[],"forks":20,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["../projects/RM9718/RM9718-cron-install.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"}],"started":"2024-09-25T12:55:45.655245+01:00","ended":"2024-09-25T12:56:47.494894+01:00","duration":"00:01:01.839649","name":null,"ansible_version":"2.16.11","client_version":"1.7.2","python_version":"3.10.10","server_version":"1.7.2","status":"failed","path":"/home/ssh-gateway/ansible/projects/RM9718/RM9718-cron-install.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Playbook to install the random crons\n  hosts: all\n  gather_facts: false\n  roles:\n    - plesk\n  tasks:\n    - name: On plesk server check for imunify\n      ansible.builtin.shell: |\n        set -o pipefail\n        imunify360-agent version\n      args:\n        executable: /bin/bash\n      register: imun_out\n      failed_when: imun_out.rc != 0 and \"command not found\" not in imun_out.stderr\n      changed_when: false\n      ignore_errors: true\n\n    - name: If imunify is installed install and run script\n      when: imun_out.stdout is match('^\\\\d+\\\\.\\\\d+\\\\.\\\\d+')\n      block:\n        - name: Upload the script\n          ansible.builtin.slurp:\n            src: /home/ssh-gateway/ansible/projects/RM9718/setup_random_cron.sh\n          delegate_to: 127.0.0.1\n          register: file_contents\n\n        - name: Execute the script\n          ansible.builtin.shell: |\n            set -o pipefail\n            echo -e \"{{ file_contents.content }}\" | base64 -d > /tmp/setup_random_cron.sh\n            chmod 755 /tmp/setup_random_cron.sh\n            /tmp/setup_random_cron.sh\n            rm -f /tmp/setup_random_cron.sh\n          args:\n            executable: /bin/bash\n          changed_when: false\n\n    - name: Print error message when imunify360-agent is not found\n      when: imun_out.rc == 127 or \"command not found\" in imun_out.stderr\n      ansible.builtin.debug:\n        msg: \"Error: imunify360-agent command not found, skipping the rest of the steps...\"\n","created":"2024-09-25T12:55:45.680449+01:00","updated":"2024-09-25T12:55:45.680493+01:00","path":"/home/ssh-gateway/ansible/projects/RM9718/RM9718-cron-install.yaml"}