| This role can be used to power on a host via magic packet with wake on LAN.
Some hosts are not up all the time, due to energy saving considerations. To apply various tasks to the powered off host it needs to be powered on and this is exactly where this role is needed.
Install from Ansible Galaxy
ansible-galaxy install while_true_do.wakeonlan
Install from Github
git clone https://github.com/while-true-do/ansible-role-wakeonlan.git while_true_do.wakeonlan
Used Modules:
None.
# defaults/main.yml for wakeonlan
# wtd_wakeonlan_mac: ""
wtd_wakeonlan_broadcast: "255.255.255.0"
wtd_wakeonlan_delegation_host: "localhost"
wtd_wakeonlan_port: "7"
wtd_wakeonlan_wait_for_connection_timeout: "600"
Simple Example:
- hosts: servers
gather_facts: no
roles:
- { role: while_true_do.wakeonlan }
Advanced Example:
- hosts: servers
gather_facts: no
roles:
- { role: while_true_do.wakeonlan,
wtd_wakeonlan_mac: "aa:bb:cc:dd:ee:ff",
wtd_wakeonlan_delegation_host: "home-router"
}
All tests are located in test directory.
Basic testing:
bash ./tests/test-ansible.sh
bash ./tests/test-spelling.sh
bash ./tests/test-whitespace.sh
Thank you so much for considering to contribute. Every contribution helps us. We are really happy, when somebody is joining the hard work. Please have a look at the links first.
This work is licensed under a BSD License.
Site: while-true-do.org
Mail: hello@while-true-do.org