a guest Aug 19th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand