Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
adds the private instance ip as a new parameter for the template
Browse files Browse the repository at this point in the history
keeps the parameter {IP} for backwards compatibility
  • Loading branch information
mathewmeconry committed Aug 14, 2018
1 parent 8abfea8 commit bc00ed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Just use the same command
## Templates
For templates are following parameters available:
{HOST} = instance id
{IP} = instance public ip
{IP} or {PublicIP} = instance public ip
{PrivateIP} = instance private ip

If you need more just create a feature request
## Contributing
Expand Down
3 changes: 3 additions & 0 deletions icinga2-aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def writeTemplate(template, targetFile, targetFolder):
with open(icinga2ConfigDir + 'conf.d/hosts/' + targetFolder + '/' + targetFile + '.conf', 'w') as out:
template = template
template = template.replace('{HOST}', instance.id)
template = template.replace('{PublicIP}', instance.public_ip_address)
template = template.replace('{PrivateIP}', instance.private_ip_address)
# Backwards compatibility
template = template.replace('{IP}', instance.public_ip_address)
out.write(template)
out.flush()
Expand Down

0 comments on commit bc00ed5

Please sign in to comment.