{"id":4452,"sha1":"f8101e4dadf80feb44091cf3e2db54ceacf75e33","playbook":{"id":2376,"items":{"plays":1,"tasks":2,"results":579,"hosts":296,"files":1,"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/bash-kvm-inventory-prod.sh"],"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":["agent360_check_version.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"}],"started":"2024-12-16T14:48:18.779158Z","ended":"2024-12-16T14:50:26.774474Z","duration":"00:02:07.995316","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/kuly/agent360_check_version.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Check if there is a need to upgrade agent360\n  hosts: all\n  gather_facts: false\n  vars:\n    latest_version: \"1.3.1\"\n  tasks:\n    - name: Get installed version and compare\n      ansible.builtin.shell: |\n        set -o pipefail\n        pip$(head -1  $(which agent360)| awk -F \"python\" '{print $2}') show agent360 | grep Version | awk '{ print $2 }'\n      args:\n        executable: /bin/bash\n      register: ver_out\n      changed_when: ver_out.rc != 0\n\n    - name: Log the ones need updating\n      when: ver_out.rc == 0 and ver_out.stdout < latest_version\n      ansible.builtin.lineinfile:\n        path: /home/ssh-gateway/ansible/kuly/agent360_need_upgrade.txt\n        create: true\n        mode: '0644'\n        line: '{{ inventory_hostname }} need upgrade - version {{ ver_out.stdout }}'\n      delegate_to: localhost\n","created":"2024-12-16T14:48:18.800186Z","updated":"2024-12-16T14:48:18.800208Z","path":"/home/ssh-gateway/ansible/kuly/agent360_check_version.yaml"}