summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-06-27 15:08:33 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-06-27 15:08:33 +0200
commit444b66cd7ecd24e448137561e3c440c6a55e7f81 (patch)
tree5dfef2ad02cbf1749c43dd2912dd30895c02a2b2
parentc1830f48c92fc7017d47646565c6bd811771614e (diff)
downloadsmtpd-conf-444b66cd7ecd24e448137561e3c440c6a55e7f81.tar.xz
Use sudo when running put
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rw-r--r--fabfile.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fabfile.py b/fabfile.py
index c366dd2..b87f352 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -15,7 +15,8 @@ def upload_conf():
if not checksum_match(local_file, '/etc/smtpd/smtpd.conf'):
print("Config changed, uploading new file...")
- put(local_path=local_file, remote_path='/etc/smtpd/smtpd.conf')
+ put(local_path=local_file, remote_path='/etc/smtpd/smtpd.conf',
+ use_sudo=True)
sudo('systemctl restart smtpd.service')
@task
@@ -24,5 +25,6 @@ def upload_users():
if not checksum_match(local_file, '/etc/smtpd/users'):
print("Users changed, uploading new file...")
- put(local_path=local_file, remote_path='/etc/smtpd/users')
+ put(local_path=local_file, remote_path='/etc/smtpd/users',
+ use_sudo=True)
sudo('smtpctl update table users')