python fabric perform actions from prompt on all servers
Question: I have several servers on my my fab file, and I want to have a function that
will prompt me of what to do and than perform it on all servers.

    
    
    def simple():
       actions = prompt('Type the actions: ')
       run(actions)
    

now when I do that I get:

    
    
    [web1] Type the actions:
            bla bla bla
    
    [web2] Type the actions:
            bla bla bla
    
    [web3] Type the actions:
            bla bla bla
    

I want to type the "bla bla bla" only once and it will be performed on all
servers, is that possible?


Answer: Well, if `simple()` here is a Fabric task, then this behaviour is expected, as
you will have the `prompt()` call for every host on which the task is
executed. I suppose, you use the `fab` command-line tool, and in the simplest
case:

    
    
    # fabfile.py
    
    from fabric.api import run, env
    
    env.hosts = ['host1', 'host2']
    
    def simple(command=''):
        run(command)
    

And launch it as follows:

    
    
    $ fab simple:'ls -la'
    

