Skip to content

Commit

Permalink
Merge pull request #17 from wandansible/current-network-state
Browse files Browse the repository at this point in the history
Print current network state before asking if changes should be applied.
  • Loading branch information
gizmoguy authored Jan 28, 2024
2 parents c934cbd + b6405c2 commit 9376922
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
---
- name: confirm network change
- name: Get current network state
ansible.builtin.command:
cmd: ip address show
register: _network_state
changed_when: false
when: network_wait_on_change
listen: confirm network change

- name: Prompt before changing network configuration
ansible.builtin.pause:
prompt: Please check the network configuration changes. Press enter to apply or ctrl-c to stop
prompt: |-
Current network state:
{{ _network_state.stdout }}
Please check the network configuration changes. Press enter to apply or ctrl-c to stop
when: network_wait_on_change
listen: confirm network change

- name: restart networking
ansible.builtin.service:
Expand Down

0 comments on commit 9376922

Please sign in to comment.