{"id":5105,"sha1":"d5a4f20ba79b1c1ed42ebad19477b10852094b54","playbook":{"id":2999,"items":{"plays":1,"tasks":1,"results":1,"hosts":1,"files":1,"records":0},"arguments":{"version":null,"verbosity":0,"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/generated_inventory.ini"],"listhosts":false,"subset":"vibrant-cricket.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":["upload_ini_to_hosts.yml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"},{"id":191,"name":"subset:vibrant-cricket.man-1.vm.plesk-server.com"}],"started":"2025-05-23T11:18:50.948107+01:00","ended":"2025-05-23T11:18:51.683501+01:00","duration":"00:00:00.735394","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/upload_ini_to_hosts.yml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Upload panel.ini files to each host in generated inventory\n  hosts: all\n  gather_facts: false\n  vars:\n    local_file_dir: \"fetched_files\"\n    remote_dest_path: \"/usr/local/psa/admin/conf/panel.ini\"\n\n  tasks:\n    - name: Find matching ini file in local directories\n      ansible.builtin.find:\n        paths: \"{{ local_file_dir }}\"\n        patterns: \"{{ inventory_hostname }}-panel.ini\"\n        recurse: true\n      register: found_ini_files\n\n    - name: Fail if no matching .ini file is found\n      ansible.builtin.assert:\n        that:\n          - found_ini_files.files | length == 1\n        fail_msg: \"Expected exactly one matching .ini file for {{ inventory_hostname }} but found {{ found_ini_files.files | length }}.\"\n\n    - name: Upload the matched ini file to the remote host\n      ansible.builtin.copy:\n        src: \"{{ found_ini_files.files[0].path }}\"\n        dest: \"{{ remote_dest_path }}\"\n        owner: root\n        group: root\n        mode: '0644'\n      notify: Validate file upload\n\n    - name: Show success message\n      ansible.builtin.debug:\n        msg: \"Uploaded {{ found_ini_files.files[0].path }} to {{ inventory_hostname }} at {{ remote_dest_path }}\"\n\n  handlers:\n    - name: Validate file upload\n      ansible.builtin.stat:\n        path: \"{{ remote_dest_path }}\"\n      register: uploaded_file\n      until: uploaded_file.stat.exists\n      retries: 5\n      delay: 1\n\n    - name: Debug file existence\n      ansible.builtin.debug:\n        msg: \"File {{ remote_dest_path }} exists on {{ inventory_hostname }}: {{ uploaded_file.stat.exists }}\"\n","created":"2025-05-23T11:18:50.962628+01:00","updated":"2025-05-23T11:18:50.962649+01:00","path":"/home/ssh-gateway/ansible/kuly/upload_ini_to_hosts.yml"}