Skip to content

Dynamic Ansible inventory generator written in Go as a "hello world" project.

License

Notifications You must be signed in to change notification settings

digaxfr/ansibleinv-digitalocean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ansibleinv-digitalocean

Dynamic Ansible inventory generator written in Go as a "hello world" project.

Inventory Hostname and IPs

Inventory hostnames are generated from the Droplet's human-readable name. ansible_host is then set to the Droplet's public IPv4 address.

$ ansible -i ../../../gopath/src/github.com/digaxfr/dyn-inv-digitalocean/do all -m debug -a "msg={{ ansible_host }}"
vps2 | SUCCESS => {
    "msg": "206.81.x.abc"
}
vps3 | SUCCESS => {
    "msg": "104.248.x.abc"
}

Building

go build do.go

Usage

ansible-playbook -i /path/to/do <playbook>

About

Dynamic Ansible inventory generator written in Go as a "hello world" project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages