You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-homelab/scripts/get_linode_ip.sh

8 lines
267 B
Bash

#!/bin/bash
linode_ip="$(ansible-inventory -i linode.yml --list | jq ._meta.hostvars | jq '."simple-linode"' | jq -r .ipv4[0])"
inventory_entry="root@${linode_ip}"
echo $inventory_entry
echo "[servers]" > linodehosts.ini
echo "${inventory_entry}" >> linodehosts.ini