From a21f795f24a73c8f27fddc300a5ca5ad448ca072 Mon Sep 17 00:00:00 2001 From: LinuxSquare <7436714-OfficialLinuxSquare@users.noreply.gitlab.com> Date: Sun, 30 Jul 2023 13:01:00 +0200 Subject: [PATCH] Add networking --- applications/mysql.sls | 10 ++++++---- applications/podman.sls | 1 + applications/ssh.sls | 2 +- system/files/network_interfaces | 2 ++ system/network.sls | 20 ++++++++++++++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 system/files/network_interfaces create mode 100644 system/network.sls diff --git a/applications/mysql.sls b/applications/mysql.sls index ad8f422..f4fc988 100644 --- a/applications/mysql.sls +++ b/applications/mysql.sls @@ -2,12 +2,10 @@ applications_mysql_pkgs: pkg.installed: - pkgs: - mariadb + - mariadb-client + - mariadb-openrc applications_mysql_enable: - service.enabled: - - name: mariadb - - require: - - applications_mysql_pkgs file.directory: - name: /var/lib/mysql - create: False @@ -19,3 +17,7 @@ applications_mysql_enable: - group - require: - applications_mysql_pkgs + service.enabled: + - name: mariadb + - require: + - applications_mysql_pkgs diff --git a/applications/podman.sls b/applications/podman.sls index aff0b51..12e705e 100644 --- a/applications/podman.sls +++ b/applications/podman.sls @@ -2,6 +2,7 @@ applications_podman_pkgs: pkg.installed: - pkgs: - podman + - podman-openrc applications_podman_enable: service.enabled: diff --git a/applications/ssh.sls b/applications/ssh.sls index f074d9b..72e5fda 100644 --- a/applications/ssh.sls +++ b/applications/ssh.sls @@ -1,7 +1,7 @@ applications_ssh_pkgs: pkg.installed: - pkgs: - - openssh + - openssh-server applications_ssh_add_keys: file.managed: diff --git a/system/files/network_interfaces b/system/files/network_interfaces new file mode 100644 index 0000000..81922ce --- /dev/null +++ b/system/files/network_interfaces @@ -0,0 +1,2 @@ +auto eth0 +iface eth0 inet dhcp diff --git a/system/network.sls b/system/network.sls new file mode 100644 index 0000000..0bda3fd --- /dev/null +++ b/system/network.sls @@ -0,0 +1,20 @@ +include: + - .base + +system_network_interfaces: + file.managed: + - name: /etc/network/interfaces + - source: salt://{{ tpldir }}/files/network_interfaces + - user: root + - group: root + - mode: '0644' + - require: + - system_base_pkgs + +system_network_service_reload: + service.running: + - name: networking + - enable: true + - reload: true + - watch: + - system_network_interfaces