I have a situation where I often want to run the same set of shell commands on different servers. Such a series of commands can look like:
#+begin_src bash :dir /ssh:purple:~/repo/
git pull --quiet origin master
git show | head -n 1
#+end_src
#+begin_src bash :dir /ssh:purple|su:root@purple:/
diff /sbin/thing /home/rovanion/repo/thing
#+end_src
I then want to repeat the same set of commands for a different machine, in a different org-file. Instead of running, and sometimes forgetting to run, search and replace for the hostname (purple) I would like to do something along these lines:
#+property: host purple
#+begin_src bash :dir /ssh:$host:~/repo/
git pull --quiet origin master
git show | head -n 1
#+end_src
#+begin_src bash :dir /ssh:$host|su:root@$host:/
diff /sbin/thing /home/rovanion/repo/thing
#+end_src
Where the property host can be defined per buffer. Is this possible?
Since I want to use different :dir
's for different parts of the command sequences just setting the header-argument :dir
is not practical.