This repository has been archived on 2020-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-deploy/dependencies

45 lines
910 B
Plaintext
Raw Normal View History

2020-04-02 22:57:29 +00:00
#!/usr/bin/env python3
2020-04-07 13:43:53 +00:00
import os
import sys
import subprocess
from .funtions import error, info
def main(args):
packages = " ".join([
"ansible",
"python3",
"python3-dev",
"python3-pip",
])
command = [
'apt',
'install',
'-y',
'--no-remove',
'-o Dpkg::Options::=--force-confdef',
'-o Dpkg::Options::=--force-confold',
'install',
packages
]
environment = os.environ.copy()
environment.update({'DEBIAN_FRONTEND': 'noninteractive'})
try:
subprocess.check_output(
command,
env=environment,
stderr=subprocess.STDOUT
)
info("dependencies installed successfully")
except subprocess.CalledProcessError as exception:
error("dependencies: {}".format(str(exception)))
if __name__ == '__main__':
main(sys.argv[:1])