Read and Write Files ExampleΒΆ

This example illustrates how to read from and write to files on all the servers in the inventory.

python3 examples/read_and_write_files/main.py

This code reads from and writes to a file on a server.

yield Operation("Read and Write", composite=True)
yield Read_file(path='example.txt', hosts=inventory()[0][0]['host'])
yield Write_file(path='example.txt', text='hello world')