Can anyone share some experience or practical examples of loading hosts (and/or
roles) either from text file input or loaded dynamically into/out of arrays?
Actually, I seem to remember that arrays are lists with Python...right?
I'm looking to branch out a bit and stop hard-coding roles in my
Hi Jeff,
A text file with host strings delimited by newlines could be simply
loaded like so:
with open('/path/to/file') as fd:
env.hosts = [x.strip() for x in fd] # To clear out the trailing newlines
Or you could load from a Web service spitting out the same sort of format: