ansible/playbooks/wol_enable.yml
2023-09-18 17:12:38 +02:00

24 lines
597 B
YAML

- hosts: omv
name: Enable WOL
become: true
tasks:
- name: Display all interfaces name
debug:
var: "{{ ansible_interfaces | select('match','ens.*') | list | first }}"
- name: Creating config
become: yes
ansible.builtin.copy:
dest: "/etc/systemd/system/wol.service"
content: |
[Unit]
Description=Enable Wake On Lan
[Service]
Type=oneshot
ExecStart = /usr/sbin/ethtool --change enp2s0 wol g
[Install]
WantedBy=basic.target
owner: root
mode: '0744'