Skip to content

Commit

Permalink
Add how to set an ansible task as softfailed
Browse files Browse the repository at this point in the history
Add how to set an ansible task as softfailed.
  • Loading branch information
hadeskun committed Dec 9, 2024
1 parent f4fec86 commit ddcbc2d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,16 @@ If the user does not wish to copy the role in the `roles` folder of this reposit
export ANSIBLE_ROLES_PATH=<the-dir-where-the-role-is-located>
. . . (run deployment as you would normally do)
```

### How to rewrite an ansible task to be softfailed automatically in OSADO

To softfailed an ansible task it is needed to add a msg attribute in the task following this format:
```shell

Check failure on line 282 in README.md

View workflow job for this annotation

GitHub Actions / Markdown lint (README.md)

Fenced code blocks should be surrounded by blank lines [Context: "```shell"]
msg: "[OSADO][softfail] [bsc or jsc]#[number] [short description]"
```

Check failure on line 284 in README.md

View workflow job for this annotation

GitHub Actions / Markdown lint (README.md)

Fenced code blocks should be surrounded by blank lines [Context: "```"]
Here a complete example:
```shell

Check failure on line 286 in README.md

View workflow job for this annotation

GitHub Actions / Markdown lint (README.md)

Fenced code blocks should be surrounded by blank lines [Context: "```shell"]
- name: Example of debug message with Bugzilla mention, minds to be intercepted by OSADO test
ansible.builtin.debug:
msg: "[OSADO][softfail] bsc#123456789 Here a generic message with some explanations."
```
8 changes: 0 additions & 8 deletions ansible/playbooks/registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,3 @@
ansible.builtin.command: zypper lr -u
register: repos_after
failed_when: repos_after.rc != 0

- name: Example of debug message with Bugzilla mention, minds to be intercepted by OSADO test
ansible.builtin.debug:
msg: "[OSADO][softfail] bsc#123456789 Here a generic message with some explanations."

- name: Example of debug message with Jira mention, minds to be intercepted by OSADO test
ansible.builtin.debug:
msg: "[OSADO][softfail] jsc#PROJECT-1234 Here a generic message with some explanations."

0 comments on commit ddcbc2d

Please sign in to comment.