Обновить test-playbooks/win_dns_ps.yml
This commit is contained in:
@@ -1,20 +1,15 @@
|
|||||||
---
|
---
|
||||||
- name: Test Windows connection
|
- name: Check Windows DNS settings
|
||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
|
|
||||||
vars:
|
|
||||||
ansible_connection: winrm
|
|
||||||
ansible_port: 5985
|
|
||||||
ansible_winrm_scheme: http # явно указываем HTTP
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Test WinRM ping
|
- name: Check DNS servers
|
||||||
win_ping:
|
ansible.windows.win_shell: |
|
||||||
|
Get-DnsClientServerAddress -AddressFamily IPv4 |
|
||||||
|
Select-Object InterfaceAlias, ServerAddresses
|
||||||
|
register: dns_result
|
||||||
|
|
||||||
- name: Get hostname
|
- name: Display DNS settings
|
||||||
win_command: hostname
|
debug:
|
||||||
register: result
|
msg: "{{ dns_result.stdout }}"
|
||||||
|
|
||||||
- debug:
|
|
||||||
var: result.stdout
|
|
||||||
Reference in New Issue
Block a user