Not an ansible response (use command or shell to execute), but can retrieve
the iLO network settings and change with:
# This is coded against iLO4!
# Run as root
cd /var/tmp # or where ever you would like to have your temporary files
#
# Get the current configuration
#
hponcfg --writeconfig ilo
#
# Delete the directory information and user information portions of the xml
file.
#
sed -i '/^ <DIR_INFO/,/^ <\/DIR_INFO/d' ilo
sed -i '/^ <USER_INFO/,/^ <\/USER_INFO/d' ilo
#
# Compute your new ip address. Note, OCT4 is based on RHEL 7 type OS using
eth0 as the NIC.
# Adjust as needed.
#
BASE_IP=11.11.11.
OCT4=$(ifconfig eth0 | grep inet | awk '{ print $2 }' | cut -d. -f4)
#
# You will probably also want to change the netmask and default gateway.
# The netmask can be found at: SUBNET_MASK
# and the gateway at: GATEWAY_IP_ADDRESS
# Change accordingly.
#
sed -i "s|^\( <IP_ADDRESS VALUE = \"\).*|\1${BASE_IP}${OCT4}\"/>|" ilo
#
# Write the new ip to the iLO
#
hponcfg --file ilo
On Saturday, October 20, 2018 at 11:38:38 AM UTC-4, LJ Medina wrote:
>
> Hello,
> I'm trying to assign ILO IP addresses to a range of systems, using a
> different subnet than their host IP, just matching the fourth octet. For
> example, if their IP would be 10.10.10.10, I want their ILO IP to be
> 11.11.11.10.( Plan is to use "hponcfg" module to configure the host's ILO
> after I obtain this address)
> What is the best way to achieve this with ansible?
--
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/a3d5783b-cb70-466d-b99c-22911190da94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.