Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tasks/main.yml: ignore errors during LUN assignment if ansible is in check mode #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johanneskastl
Copy link
Contributor

ignore errors during LUN assignment if ansible is in check mode aka variable 'ansible_check_mode' is set to 'true'

Errors like the following can be ignored in check mode, as the iSCSI object have not been created:

failed: [iscsiserver01] (item=[{'wwn': 'iqn.2020-03.foo.example:iscsiserver01', 'initiators': ['node01', 'node02', 'node03']}, {'path': '/dev/sdd', 'name': 'test3', 'type': 'block'}]) => {"ansible_loop_var": "item", "changed": false, "cmd": "targetcli '/iscsi/iqn.2020-03.foo.example:iscsiserver01/tpg1 status'", "error": "No such path /iscsi/iqn.2020-03.foo.example:iscsiserver01\n", "item": [{"initiators": ["node01", "node02", "node03"], "wwn": "iqn.2020-03.foo.example:iscsiserver01"}, {"name": "test3", "path": "/dev/sdd", "type": "block"}], "msg": "ISCSI object doesn't exists", "output": ""}

…check mode, aka variable 'ansible_check_mode' is set to 'true'

Errors like the following can be ignored in check mode, as the iSCSI object have not been created:
```
failed: [iscsiserver01] (item=[{'wwn': 'iqn.2020-03.foo.example:iscsiserver01', 'initiators': ['node01', 'node02', 'node03']}, {'path': '/dev/sdd', 'name': 'test3', 'type': 'block'}]) => {"ansible_loop_var": "item", "changed": false, "cmd": "targetcli '/iscsi/iqn.2020-03.foo.example:iscsiserver01/tpg1 status'", "error": "No such path /iscsi/iqn.2020-03.foo.example:iscsiserver01\n", "item": [{"initiators": ["node01", "node02", "node03"], "wwn": "iqn.2020-03.foo.example:iscsiserver01"}, {"name": "test3", "path": "/dev/sdd", "type": "block"}], "msg": "ISCSI object doesn't exists", "output": ""}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant