Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: 127.0.0.1
- connection: local
- gather_facts: true
- tasks:
- - name: Block task
- block:
- - name: Do nothing
- ansible.builtin.shell: exit 1
- rescue:
- - name: Rescue tasks
- ansible.builtin.debug:
- msg: "Rescue task done."
- always:
- - name: Always task
- ansible.builtin.debug:
- msg: "Always task done."
- 2.10:
- PLAY [127.0.0.1] ***********************************************************************************************************************
- TASK [Gathering Facts] *****************************************************************************************************************
- ok: [127.0.0.1]
- TASK [Do nothing] **********************************************************************************************************************
- fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": "exit 1", "delta": "0:00:00.002001", "end": "2024-03-25 01:49:50.398914", "msg": "non-zero return code", "rc": 1, "start": "2024-03-25 01:49:50.396913", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
- TASK [Rescue tasks] ********************************************************************************************************************
- ok: [127.0.0.1] => {
- "msg": "Rescue task done."
- }
- TASK [Always task] *********************************************************************************************************************
- ok: [127.0.0.1] => {
- "msg": "Always task done."
- }
- PLAY RECAP *****************************************************************************************************************************
- 127.0.0.1 : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=1 ignored=0
- 2.9: не поддерживает FQCN и хочет просто shell иначе:
- ERROR! this task 'ansible.builtin.shell' has extra params, which is only allowed in the following modules: import_role, win_shell, command, include, win_command, import_tasks, include_role, script, include_vars, add_host, group_by, raw, shell, include_tasks, meta, set_fact
- The error appears to be in '/home/gitlab-runner/playbook.yml': line 9, column 11, but may
- be elsewhere in the file depending on the exact syntax problem.
- The offending line appears to be:
- block:
- - name: Do nothing
- ^ here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement