Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. with open('file.txt', 'r') as file:
  2.     data_file = file.readlines()
  3. with open('file.txt', 'w') as file:
  4.     for line in data_file:
  5.         file.writelines([line, 'ansible ALL=(ALL) NOPASSWD:ALL\n']) if line.startswith('root') else file.write(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement