21 lines
550 B
YAML
21 lines
550 B
YAML
---
|
|
- name: Configure Windows PC
|
|
hosts: windows
|
|
gather_facts: yes
|
|
tasks:
|
|
- name: Проверка связи (Ping)
|
|
ansible.windows.win_ping:
|
|
|
|
- name: Узнать имя компьютера
|
|
ansible.windows.win_shell: hostname
|
|
register: host_out
|
|
|
|
- name: Показать имя
|
|
debug:
|
|
var: host_out.stdout_lines
|
|
|
|
# Пример: Создать папку на диске C
|
|
- name: Create directory
|
|
ansible.windows.win_file:
|
|
path: C:\Temp\FromSemaphore
|
|
state: directory |