{"id":5118,"sha1":"79ce03292a1bf9fe6360b1649d572fc1adbb1bef","playbook":{"id":3012,"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":"aqua-lemur.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":["RM10018-update-wptoolkit.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"},{"id":192,"name":"subset:aqua-lemur.man-1.vm.plesk-server.com"}],"started":"2025-05-23T12:20:19.324458+01:00","ended":"2025-05-23T12:20:21.478486+01:00","duration":"00:00:02.154028","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/RM10018-update-wptoolkit.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Update Plesk panel.ini with ext-wp-toolkit settings (if Plesk server)\n  hosts: all\n  gather_facts: false\n\n  vars:\n    panel_ini_path: \"/usr/local/psa/admin/conf/panel.ini\"\n    section_header: \"[ext-wp-toolkit]\"\n    config_block: |\n      [ext-wp-toolkit]\n      showVirtualPatchesUpsellWhenRestrictedViaPlans = true\n      purchaseDeluxeGuardianBaseUrl = https://plesk.layershift.com/\n      virtualPatchesLicenseAdditionalLimit = 0\n      virtualPatchesLicensingForEndCustomers = false\n\n  tasks:\n    - name: Get the Plesk info\n      plesk_info:\n      register: plsk\n\n    - name: Conditional block for updating panel.ini (only on Plesk servers)\n      when: plsk.plesk_found\n      block:\n        - name: Check if section exists in panel.ini file\n          ansible.builtin.shell: \"grep -q '{{ section_header }}' {{ panel_ini_path }} && echo 'found' || echo 'not found'\"\n          register: section_exists_result\n          changed_when: false\n          args:\n            warn: false\n\n        - name: Set fact based on whether section exists\n          ansible.builtin.set_fact:\n            section_exists: \"{{ 'found' in section_exists_result.stdout }}\"\n\n        - name: Alert if section is already present\n          ansible.builtin.debug:\n            msg: \"\u26a0\ufe0f Section {{ section_header }} already exists in {{ panel_ini_path }}. No changes will be made.\"\n          when: section_exists\n\n        - name: Backup panel.ini before modifying\n          ansible.builtin.copy:\n            src: \"{{ panel_ini_path }}\"\n            dest: \"{{ panel_ini_path }}_{{ ansible_date_time.iso8601_basic }}\"\n            remote_src: true\n            mode: '0644'\n          when: not section_exists\n\n        - name: Append configuration block to panel.ini\n          ansible.builtin.lineinfile:\n            dest: \"{{ panel_ini_path }}\"\n            line: \"{{ config_block }}\"\n            create: false\n          when: not section_exists\n\n        - name: Notify user of successful update\n          ansible.builtin.debug:\n            msg: \"\u2705 Configuration successfully added to {{ panel_ini_path }}\"\n          when: not section_exists\n","created":"2025-05-23T12:20:19.345021+01:00","updated":"2025-05-23T12:20:19.345044+01:00","path":"/home/ssh-gateway/ansible/kuly/RM10018-update-wptoolkit.yaml"}