From 8a2650de59094667960bc4230bcf9851a09c76b5 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Thu, 14 Oct 2021 18:00:49 +0200 Subject: [PATCH] . --- salt/pillars/top.sls | 1 + salt/states/atftp/files/grub.cfg | 8 +++++++- salt/states/atftp/init.sls | 1 + salt/states/rmt/init.sls | 28 +++++++++++++++++++++++++++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/salt/pillars/top.sls b/salt/pillars/top.sls index de48519..86646ad 100644 --- a/salt/pillars/top.sls +++ b/salt/pillars/top.sls @@ -9,6 +9,7 @@ base: - ssh - wireguard - hostapd + - pxe {% if salt['pillar.file_exists']('local.sls') %} - local {% endif %} diff --git a/salt/states/atftp/files/grub.cfg b/salt/states/atftp/files/grub.cfg index 98134bd..e9effbe 100644 --- a/salt/states/atftp/files/grub.cfg +++ b/salt/states/atftp/files/grub.cfg @@ -4,13 +4,19 @@ set timeout=60 # Default boot entry set default=boot-bios -# Menu Colours +# Visual +GRUB_GFXMODE=1024x768x32 +GRUB_GFXPAYLOAD_LINUX=keep +## Menu Colours set menu_color_normal=white/black set menu_color_highlight=white/green menuentry 'Continue to normal BIOS boot' --id boot-bios --class exit { exit } +submenu "Harvester ->" { + configfile harvester.cfg +} submenu "openSUSE ->" { diff --git a/salt/states/atftp/init.sls b/salt/states/atftp/init.sls index 9001c83..13835bc 100644 --- a/salt/states/atftp/init.sls +++ b/salt/states/atftp/init.sls @@ -30,6 +30,7 @@ Add files to tftpboot: - name: /srv/tftpboot - source: salt://atftp/files - include_empty: True + - replace: False Start the atftpd.socket: service.running: diff --git a/salt/states/rmt/init.sls b/salt/states/rmt/init.sls index 6315147..c50d720 100644 --- a/salt/states/rmt/init.sls +++ b/salt/states/rmt/init.sls @@ -39,4 +39,30 @@ Stopp {{ service }}: - name: {{ service }} - enable: False {% endfor %} - + +Remove rmt http as default site: + file.replace: + - name: /etc/nginx/vhosts.d/rmt-server-http.conf + - pattern: " listen 80 default;" + - repl: " listen 80;" + +Set fqdn for rmt https: + file.replace: + - name: /etc/nginx/vhosts.d/rmt-server-https.conf + - pattern: " server_name rmt;" + - repl: " server_name rmt.{{ pillar['network']['domain'] }};" + +Set fqdn for rmt http: + file.replace: + - name: /etc/nginx/vhosts.d/rmt-server-http.conf + - pattern: " server_name rmt;" + - repl: " server_name rmt.{{ pillar['network']['domain'] }};" + +Restart nginx: + service.running: + - name: nginx + - enable: Trie + - watch: + - file: Remove rmt http as default site + - file: Set fqdn for rmt https + - file: Set fqdn for rmt http