Skip to content

Commit

Permalink
add askbecomepass option
Browse files Browse the repository at this point in the history
  • Loading branch information
hardshah authored Aug 13, 2023
1 parent 9b509a0 commit 4a13958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inventoryFetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def parseUserToInventoryAndRunPlaybook(host):
strings = hostStrings(host)
with open("inventory.ini", "w") as vars:
vars.write(hostGroup+strings.ip+strings.host_vars)
subprocess.run(['ansible-playbook', '-i', "inventory.ini", 'playbook.yml'])
subprocess.run(['ansible-playbook', '-i', "inventory.ini", 'playbook.yml', '--ask-become-pass'])


#using connection string to access db
Expand All @@ -35,4 +35,4 @@ def parseUserToInventoryAndRunPlaybook(host):
user = list(collection.find({"_id" : ObjectId(user_id)}))

#create string of hosts and write to inventory file and run playbook
parseUserToInventoryAndRunPlaybook(user[0])
parseUserToInventoryAndRunPlaybook(user[0])

0 comments on commit 4a13958

Please sign in to comment.