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

Make yes/no handling consistent with other roles. #5

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tasks/check-git-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
ansible.builtin.pause:
prompt: >-
One or more git repo sanity checks failed,
do you wish to continue with the play? (y/n)
do you wish to continue with the play? (yes/no)
register: _sanity_check_git_repo_continue
when: _sanity_check_git_branch.changed or _sanity_check_dirty_git_tree.changed

- name: Check user response to see if we should continue or not
ansible.builtin.assert:
that: >-
_sanity_check_git_repo_continue.user_input | bool
or _sanity_check_git_repo_continue.user_input == "y"
or _sanity_check_git_repo_continue.user_input | lower == "y"
fail_msg: >-
User response "{{ _sanity_check_git_repo_continue.user_input }}" is not "yes"
success_msg: "Git repo sanity check overriden"
Expand Down
4 changes: 2 additions & 2 deletions tasks/check-hostname.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
changed_when: >-
"evaluated_to" in _sanity_check_hostname

- name: Ask user if they want to continue after failed hostname sanity check

Check failure on line 20 in tasks/check-hostname.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

no-handler

Tasks that run when changed should likely be handlers.
ansible.builtin.pause:
prompt: >-
The current hostname on the machine does not match the hostname in the ansible inventory,
do you wish to continue with the play? (y/n)
do you wish to continue with the play? (yes/no)
register: _sanity_check_hostname_continue
when: _sanity_check_hostname.changed

- name: Check user response to see if we should continue or not
ansible.builtin.assert:
that: >-
_sanity_check_hostname_continue.user_input | bool
or _sanity_check_hostname_continue.user_input == "y"
or _sanity_check_hostname_continue.user_input | lower == "y"
fail_msg: >-
User response "{{ _sanity_check_hostname_continue.user_input }}" is not "yes"
success_msg: "Hostname sanity check overriden"
Expand Down
Loading