Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Must be run with role foo, since foo has sudo access or other permissions
- @hosts(*env.roledefs['foo'])
- def do_foo_actions():
- sudo("mkdir /usr/local/program")
- sudo("chown -R bar:bar /usr/local/program")
- #Most of the work here is done in role bar. But the folder /usr/local/program must exist before we can deploy
- @hosts(*env.roledefs['bar'])
- def deploy_program():
- for h in env.roledefs['foo']:
- with settings(host_string=h):
- do_foo_actions()
- #From here on out, commands will be run as hadoop rather than hadoopadmin
- put(..., "/usr/local/program")
Add Comment
Please, Sign In to add comment