Skip to content

This role can be used to power on a host via magic packet with wake on LAN.

License

Notifications You must be signed in to change notification settings

while-true-do/ansible-role-wakeonlan

Build Status

Ansible Role: wakeonlan

| This role can be used to power on a host via magic packet with wake on LAN.

Motivation

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.

Installation

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

Requirements

Used Modules:

Dependencies

None.

Role Variables

# 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"

Example Playbook

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"
      }

Testing

All tests are located in test directory.

Basic testing:

bash ./tests/test-ansible.sh
bash ./tests/test-spelling.sh
bash ./tests/test-whitespace.sh

Contribute / Bugs

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.

License

This work is licensed under a BSD License.

Author Information

Site: while-true-do.org

Mail: hello@while-true-do.org

About

This role can be used to power on a host via magic packet with wake on LAN.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages