Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2019-04-14 16:06:35 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2019-04-14 16:06:35 +0200
commit968fad8f948a9f644098f51e8a04fb5ad985c9ec (patch)
treecaa0217b067ff3b0d9b566f952a6a37ac0e80e90
parent311aa08958ca77f2888a00fab8d9fd7d610fd14f (diff)
Testing application specific configratuin (might auto-trigger in the future
-rw-r--r--archinstall.py21
-rw-r--r--deployments/applications/postgresql.json5
2 files changed, 26 insertions, 0 deletions
diff --git a/archinstall.py b/archinstall.py
index 0d909d0f..6b4a5ce5 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -312,6 +312,24 @@ def grab_url_data(path):
response = urllib.request.urlopen(safe_path, context=ssl_context)
return response.read()
+def get_application_instructions(target):
+ instructions = {}
+ try:
+ instructions = grab_url_data('{}/applications/{}.json'.format(args['profiles-path'], target))
+ except urllib.error.HTTPError:
+ print('[N] No instructions found for: {}'.format(target))
+ return instructions
+
+ print('[N] Found application instructions for: {}'.format(target))
+ try:
+ instructions = json.loads(instructions.decode('UTF-8'), object_pairs_hook=oDict)
+ except:
+ print('[E] JSON syntax error in {}'.format('{}/applications/{}.json'.format(args['profiles-path'], target)))
+ traceback.print_exc()
+ exit(1)
+
+ return instructions
+
def get_instructions(target):
instructions = {}
try:
@@ -602,6 +620,9 @@ if __name__ == '__main__':
for title in conf:
print('[N] Network Deploy: {}'.format(title))
+ if type(conf[title]) == str:
+ print('[N] Loading {} configuration'.format(conf[title]))
+ conf[title] = get_application_instructions(conf[title])
for command in conf[title]:
raw_command = command
opts = conf[title][command] if type(conf[title][command]) in (dict, oDict) else {}
diff --git a/deployments/applications/postgresql.json b/deployments/applications/postgresql.json
new file mode 100644
index 00000000..c420551b
--- /dev/null
+++ b/deployments/applications/postgresql.json
@@ -0,0 +1,5 @@
+{
+ "pacman -Syy --noconfirm postgresql" : null,
+ "systemctl enable postgresql" : null,
+ "su - postgres -c \"initdb -D /var/lib/postgres/data\"" : null
+} \ No newline at end of file