List of hosts by MacAdress + Connexion if computer is in standby

Hello,

I am considering using Ansible to achieve a certain goal, but as I get more informed, I feel that Ansible may not be the right tool. Unless, perhaps, I missed some information?

Result sought:

Use Ansible to quickly install softwares on Ubuntu 18.4 computers in a computer room (school).

Questions:

  • Create a list of hosts uses IP addresses. But these addresses are not fixed, so can’t I create the list of hosts by naming them with their MacAdress?

  • Ansible seems to be designed for connection to servers, machines that are constantly on. But the classrooms computers are often in standby, when they are not used. I have tried some direct SSH connection and it seems that this cannot be done if the target computer is in standby. Is Ansible also facing this obstacle?

Thank you in advance for your help :slight_smile:

Seb

Hello,

I am considering using Ansible to achieve a certain goal, but as I get more informed, I feel that Ansible may not be the right tool. Unless, perhaps, I missed some information?

Result sought:

Use Ansible to quickly install softwares on Ubuntu 18.4 computers in a computer room (school).

https://docs.ansible.com/ansible/latest/modules/apt_module.html

Questions:

  • Create a list of hosts uses IP addresses. But these addresses are not fixed, so can’t I create the list of hosts by naming them with their MacAdress?

I’m an Ansible beginner myself and there might be a better way but an idea is to address all machines and then use
conditionals to assign tasks to MAC addresses
https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html

https://stackoverflow.com/questions/40224460/getting-mac-address-from-ansible-facts-in-role

  • Ansible seems to be designed for connection to servers, machines that are constantly on. But the classrooms computers are often in standby, when they are not used. I have tried some direct SSH connection and it seems that this cannot be done if the target computer is in standby. Is Ansible also facing this obstacle?

There are ways to run Ansible in a pull way like https://docs.ansible.com/ansible/latest/cli/ansible-pull.html
(there might be others)

You can use Wake-on-LAN to wake the machines up to be able to manage them
https://docs.ansible.com/ansible/latest/modules/wakeonlan_module.html
(and shut them down again when done)

I’d look into something like ddns getting your dhcp server to update dns for you

Then you can use the machine hostname?

Wake on LAN

Etc

Ok, thanx guys :slight_smile: