{"id":5323,"sha1":"959582d2976eb6f61669955935ff6584a13c59aa","playbook":{"id":3203,"items":{"plays":1,"tasks":2,"results":2,"hosts":1,"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":"ynh7.man-1.vm.plesk-server.com","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":["update_360_plugins.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"},{"id":200,"name":"subset:ynh7.man-1.vm.plesk-server.com"}],"started":"2025-07-15T14:37:28.009382+01:00","ended":"2025-07-15T14:37:33.006132+01:00","duration":"00:00:04.996750","name":null,"ansible_version":"2.16.11","client_version":"1.7.2","python_version":"3.10.10","server_version":"1.7.2","status":"completed","path":"/home/ssh-gateway/ansible/kuly/update_360_plugins.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Playbook to run update script\n  hosts: all,!ivory-pine.man-1.vm.plesk-server.com\n  gather_facts: false\n  tasks:\n    - name: Get the info\n      plesk_info:\n      register: plsk\n    - name: Run the update\n      when: plsk.plesk_found\n      block:\n        - name: Run update\n          ansible.builtin.shell: |\n            set -o pipefail\n            curl -Ls https://deploy.thecode.casa/agent360_plugins/install.sh | bash -s {{ plugin }}\n          args:\n            executable: /bin/bash\n          register: host_out\n          changed_when: false\n            #        - name: Check 360 service status\n            #          ansible.builtin.shell: |\n            #            set -o pipefail\n            #            service_time=$(systemctl show -p ActiveEnterTimestamp agent360.service | awk -F'=' '{print $2}')\n            #            service_epoch=$(date -d \"$service_time\" +%s)\n            #            current_time=$(date +%s)\n            #            time_diff=$((current_time - service_epoch))\n            #            echo $time_diff\n            #          args:\n            #            executable: /bin/bash\n            #          register: time_difference_output\n            #          changed_when: false\n            #        - name: Determine if service was restarted recently\n            #          ansible.builtin.debug:\n            #            msg: \"Service was restarted recently.\"\n            #          when: time_difference_output.stdout | int > 1 and time_difference_output.stdout | int < 300\n            #        - name: Get services status\n            #          ansible.builtin.service_facts:\n            #        - name: See the status\n            #          ansible.builtin.debug:\n            #            msg: 'Service status is: {{ ansible_facts.services[\"agent360.service\"].state }}'\n              #        - name: Write to a file the failed one\n              #          when: '\"running\" not in ansible_facts.services[\"agent360.service\"].state'\n              #          ansible.builtin.lineinfile:\n              #            path: /home/ssh-gateway/ansible/kuly/stopped.txt\n              #            create: true\n              #            mode: '0644'\n              #            line: '{{ inventory_hostname }} is not running'\n              #          delegate_to: localhost\n","created":"2025-07-15T14:37:28.032757+01:00","updated":"2025-07-15T14:37:28.032787+01:00","path":"/home/ssh-gateway/ansible/kuly/update_360_plugins.yaml"}