{"id":985,"sha1":"18e49cf75c69f867f2bb2d4afb39805170d6b854","playbook":{"id":984,"items":{"plays":1,"tasks":4,"results":4,"hosts":2,"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/bash-kvm-inventory-prod.sh"],"listhosts":false,"subset":"friendly-wildcat.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":["projects/RM9682/RM9682.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"},{"id":13,"name":"plesk"},{"id":87,"name":"panelini"},{"id":90,"name":"subset:friendly-wildcat.man-1.vm.plesk-server.com"}],"started":"2024-08-07T12:53:21.430414+01:00","ended":"2024-08-07T12:53:24.222092+01:00","duration":"00:00:02.791678","name":"RM9682.yaml","ansible_version":"2.16.4","client_version":"1.7.1","python_version":"3.10.10","server_version":"1.7.1","status":"completed","path":"/home/ssh-gateway/ansible/projects/RM9682/RM9682.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Playbook to parse plesk ini file\n  hosts: all\n  gather_facts: false\n  vars:\n    ini_file: /usr/local/psa/admin/conf/panel.ini\n    ara_playbook_name: RM9682.yaml\n    ara_playbook_labels:\n      - plesk\n      - panelini\n  tasks:\n    - name: Run plesk command and capture output\n      ansible.builtin.shell: |\n        set -o pipefail\n        /sbin/plesk -v | grep \"Product version\" | cut -d \":\" -f2\n      args:\n        executable: /bin/bash\n      register: plsk_out\n      changed_when: false\n    - name: Run the script when it is a Plesk server upload and execute script\n      when: \"'Plesk' in plsk_out.stdout\"\n      block:\n        - name: Read the localfile\n          ansible.builtin.slurp:\n            src: /home/ssh-gateway/ansible/projects/RM9682/configure_plesk_updates.sh\n          delegate_to: 127.0.0.1\n          register: file_contents\n        - name: Execute uploaded script\n          ansible.builtin.shell: |\n            set -o pipefail\n            echo -e \"{{ file_contents.content }}\" | base64 -d > /tmp/configure_plesk_updates.sh\n            chmod 755 /tmp/configure_plesk_updates.sh\n            cp \"{{ ini_file }}\" \"{{ ini_file }}\".back-$(date +%s)\n            /tmp/configure_plesk_updates.sh\n          args:\n            executable: /bin/bash\n          register: updates_out\n          changed_when: true\n        - name: Show debug\n          ansible.builtin.debug:\n            var: updates_out\n","created":"2024-08-07T12:53:21.449254+01:00","updated":"2024-08-07T12:53:21.449277+01:00","path":"/home/ssh-gateway/ansible/projects/RM9682/RM9682.yaml"}