mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-10-29 17:40:08 +01:00
lala
This commit is contained in:
@@ -10,23 +10,20 @@
|
||||
ansible.builtin.set_fact:
|
||||
active_adapter: '{{ item }}'
|
||||
loop: '{{ ansible_facts.interfaces }}'
|
||||
when: 'item.startswith("eno")'
|
||||
- name: Display all interfaces name
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ ansible_default_ipv4.interface }}"
|
||||
when: '(item.startswith("eno") or item.startswith("enp")) and not item.endswith("avahi")'
|
||||
|
||||
|
||||
- name: Creating config
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
dest: "/etc/systemd/system/wol.service"
|
||||
dest: "/etc/systemd/system/wol@.service"
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Enable Wake On Lan
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart = /usr/sbin/ethtool --change {{ ansible_default_ipv4.interface }} wol g
|
||||
ExecStart = /usr/sbin/ethtool --change %i wol g
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
@@ -34,7 +31,9 @@
|
||||
mode: '0744'
|
||||
- name: Restart service wol, in all cases
|
||||
ansible.builtin.service:
|
||||
name: wol
|
||||
name: wol@{{ item }}
|
||||
state: restarted
|
||||
enabled: true
|
||||
become: true
|
||||
loop: '{{ ansible_facts.interfaces }}'
|
||||
when: '(item.startswith("eno") or item.startswith("enp")) and not item.endswith("avahi")'
|
||||
|
||||
Reference in New Issue
Block a user