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

Fix prompt when there are multiple hosts in the ansible play #34

Merged
merged 1 commit into from
Dec 15, 2024
Merged
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
9 changes: 6 additions & 3 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,27 @@
- name: Prompt before changing network configuration
ansible.builtin.pause:
prompt: |-
Current network state:
Current network state for {{ item }}:

{{ _network_state.stdout }}
{{ hostvars[item]["_network_state"].stdout }}

Please check the network configuration changes. Press enter to apply or ctrl-c to stop
when: network_wait_on_change
loop: "{{ play_hosts }}"
when:
- network_wait_on_change
- hostvars[item]["_network_state"] is defined
listen: confirm network change

- name: restart networking

Check failure on line 24 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.service:
name: networking.service
state: restarted

- name: restart ifupdown-wait-online

Check failure on line 29 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.service:
name: ifupdown-wait-online.service
state: restarted

- name: netplan apply

Check failure on line 34 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 34 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command:
cmd: netplan apply
Loading