In fabric python, how to access IP or hostname in the subroutine? Want to read configuration file "conf/ip_address.conf", read key/values (using ConfigParser) and then run jobs on remote servers.
Developing tool to backup/version control configuration files from large number of hosts. Idea is - store last modified timestamp of configuration files locally. Use that to get files only when they are modified.
thx,
I am assuming you need the IP or hostname of the remote host that a command is currently executing on. env.host_string provides this. You should be able to set up a custom task and run it with execute and within the "current host" can be retrieved through env.host_string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With