{"id":87,"sha1":"60d5455058e849b62cb83557245ec0803e1630af","playbook":{"id":87,"items":{"plays":1,"tasks":5,"results":1284,"hosts":374,"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/projects/RM9380/RM9380-generated-inventory"],"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":30,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["RM9380-check.yaml"]},"labels":[{"id":1,"name":"remote_user:root"},{"id":2,"name":"check:False"},{"id":3,"name":"tags:all"},{"id":16,"name":"RM9380"},{"id":17,"name":"jelastic"},{"id":18,"name":"autofs"}],"started":"2024-04-03T08:25:01.338611+01:00","ended":"2024-04-03T08:28:48.796261+01:00","duration":"00:03:47.457650","name":"RM9380 check autofs version","ansible_version":"2.16.4","client_version":"1.7.1","python_version":"3.10.10","server_version":"1.7.2.dev2","status":"failed","path":"/home/ssh-gateway/ansible/projects/RM9380/RM9380-check.yaml","controller":"ssh-gw-4.layershift.com","user":"root"},"content":"---\n- name: Playbook to check the mounts\n  hosts: all\n  gather_facts: false\n  vars:\n    ara_playbook_name: RM9380 check autofs version\n    ara_playbook_labels:\n      - RM9380\n      - jelastic\n      - autofs\n    save_folder: /home/ssh-gateway/ansible/projects/RM9380\n  tasks:\n    - name: Run the mount check\n      block:\n        - name: Check if the host is alive\n          ansible.builtin.ping:\n            data: \"alive\"\n          register: ping_result\n          ignore_errors: false\n          changed_when: false\n        - name: Run command to check the mounts\n          when: \"'rc' not in ping_result\"\n          ansible.builtin.shell: |\n            set -o pipefail\n            timeout -s SIGKILL 5 ls -la \"{{ folder }}\"  >/dev/null && (mount  | grep \"{{ folder }}\")\n          args:\n            executable: /bin/bash\n          register: cmd_result\n          changed_when: cmd_result.rc != 0\n      rescue:\n        - name: Save the stopped ones to a file\n          when: \"'rc' in ping_result\"\n          ansible.builtin.lineinfile:\n            path: \"{{ save_folder }}/dest_nodes_stopped.txt\"\n            mode: '0640'\n            create: true\n            line: '{{ inventory_hostname }} is stopped.'\n          delegate_to: 127.0.0.1\n        - name: Save the failed ones to another file\n          when: \"cmd_result.rc != 0\"\n          ansible.builtin.lineinfile:\n            path: \"{{ save_folder }}/dest_bad_mounts.txt\"\n            mode: '0640'\n            create: true\n            line: \"{{ nfsserver }}:{{ dstnodename }}{{ folder }}:{{ dstnodename }}:{{ folder }}\"\n          delegate_to: 127.0.0.1\n      always:\n        - name: Print all ok\n          when: (\"'alive' in ping_result\") and (cmd_result.rc == 0)\n          ansible.builtin.debug:\n            msg: \"All ok\"\n","created":"2024-04-03T08:25:01.362917+01:00","updated":"2024-04-03T08:25:01.362945+01:00","path":"/home/ssh-gateway/ansible/projects/RM9380/RM9380-check.yaml"}