We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a lab situation where it would be really nice if I could just assign a static_ip value to the inventory items.
static_ip
I've prototyped out some cloud-init stuff, and it seems to work. I need to add it all to Ansible and provide something that can be done dynamically.
cloud-init
The text was updated successfully, but these errors were encountered:
Raw POC (nothing dynamic here):
@@ -1,8 +1,8 @@ #!/bin/bash # Take one argument from the commandline: VM name -if [ $# -gt 3 ] || [ $# -lt 1 ]; then - echo "Usage: $0 <node-name> {memory-MB} {vCPUs}" +if [ $# -gt 4 ] || [ $# -lt 1 ]; then + echo "Usage: $0 <node-name> {memory-MB} {vCPUs} {IP-address}" exit 1 fi @@ -94,7 +94,18 @@ - {{ vm_ssh_key }} _EOF_ - echo "instance-id: $1; local-hostname: $1" > $META_DATA + cat > $META_DATA << _EOF_ +instance-id: $1 +local-hostname: $1 +network-interfaces: | + auto eth0 + iface eth0 inet static + address $4 + network 192.168.3.0 + netmask 255.255.255.0 + broadcast 192.168.3.255 + gateway 192.168.3.1 +_EOF_ echo "$(date -R) Copying template image..." cp $IMAGE $DISK
Sorry, something went wrong.
leifmadsen
No branches or pull requests
I have a lab situation where it would be really nice if I could just assign a
static_ip
value to the inventory items.I've prototyped out some
cloud-init
stuff, and it seems to work. I need to add it all to Ansible and provide something that can be done dynamically.The text was updated successfully, but these errors were encountered: