OK, sounds good, yes a script should do the trick. You can even write it in Python and later contribute a nice Ansible module :) :)
Here's inspiration: https://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#vmware https://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#misc https://docs.ansible.com/ansible/latest/modules/ovirt_mac_pool_module.html?highlight=mac https://docs.ansible.com/ansible/latest/modules/vmware_guest_module.html?highlight=mac You can click "Edit on Github" in top right corner to get right to the existing code for those modules. Thad +ThadGuidry <https://www.google.com/+ThadGuidry> On Mon, Nov 12, 2018 at 10:30 AM John Harmon <[email protected]> wrote: > > On Saturday, November 10, 2018 at 9:48:17 AM UTC-7, Thad Guidry wrote: >> >> John, >> >> What problem are you actually trying to solve ? Generating random >> numbers especially around MAC certainly can get you in trouble. Are you >> trying to generate a Pool and apply something 1 time from that Pool ? >> >> Explain the use case, and we could help a lot more. >> >> -Thad >> >> > Thad, > We clone systems in Oracle VM. There are a handful of steps to clean up > the vm.cfg from the clone, which has details about the VM. If you don't > change the MAC address (for instance), when you bring up the clone it will > pull the NIC from the live system (one of those wonderful Oracle VM > features). I am just trying to take a repetitive process and clean it up > without direct human intervention. That will prevent human error (in case > we miss something) and make it easier. I have all steps done except this > one. If there is just one nic it works fine too, but when testing it out I > happened to clone a system with 2 nics and I discovered the issue. I have > some systems with 3 nics. I think I will have to script it as Kai said. > > I know that messing with NIC MAC addresses can get you in trouble, but > right now we are just doing the same thing manually. The clones don't > usually last that long, and when done they are usually purged. I don't > believe any of our current VMs have AA in the fourth octet (and if they did > I could change it to something else), and then the last 2 octets are > randomized.... chances of hitting an existing MAC are about nil. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/556fe7eb-a3bb-4b1d-8610-d20976131ad0%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/556fe7eb-a3bb-4b1d-8610-d20976131ad0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAChbWaOrG6qCR%3DXyK7Lw1EO1TvyuB_U5v6xCdf38biTOKB9tKw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
