mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
28 lines
717 B
YAML
28 lines
717 B
YAML
- hosts: omv
|
|
name: Enable WOL
|
|
become: true
|
|
tasks:
|
|
- name: Display all interfaces name
|
|
debug:
|
|
var: ansible_facts.interfaces
|
|
- name: Display all interfaces name
|
|
debug: msg="{{ item }}"
|
|
when: "{{ item }} | map('match','enp.*')"
|
|
with_items: "{{ ansible_interfaces }}"
|
|
- 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' |