From 52f0f1070e8090a28cc10979cb278da9ad49ce5a Mon Sep 17 00:00:00 2001 From: Keiran Snowden Date: Sat, 28 Jan 2023 17:21:52 -0500 Subject: [PATCH] up2date --- salt/minion.sls | 34 +++++++++++++++++----------------- top.sls | 4 ++-- users/files/ssh_hosts.jinja | 6 ++++++ users/init.sls | 3 ++- 4 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 users/files/ssh_hosts.jinja diff --git a/salt/minion.sls b/salt/minion.sls index 723f583..95cb4de 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -1,25 +1,25 @@ include: - salt.update -#/lib/systemd/system/salt-minion.service: -# file.managed: -# - source: salt://salt/files/salt-minion.service -# - user: root -# - group: root -# - mode: 644 +/lib/systemd/system/salt-minion.service: + file.managed: + - source: salt://salt/files/salt-minion.service + - user: root + - group: root + - mode: 644 -#systemd reload for salt-minion: -# module.run: -# - name: service.systemctl_reload -# - onchanges: -# - file: /lib/systemd/system/salt-minion.service +systemd reload for salt-minion: + module.run: + - name: service.systemctl_reload + - onchanges: + - file: /lib/systemd/system/salt-minion.service -#salt-minion: -# service.running: -# - enable: true -# - require: -# - file: /lib/systemd/system/salt-minion.service -# - module: systemd reload for salt-minion +salt-minion: + service.running: + - enable: true + - require: + - file: /lib/systemd/system/salt-minion.service + - module: systemd reload for salt-minion /etc/salt/minion: file.managed: diff --git a/top.sls b/top.sls index 0a39835..446f756 100644 --- a/top.sls +++ b/top.sls @@ -4,7 +4,7 @@ - users - salt.minion {% if salt.pillar.get('restic', None) is not none %} - - restic.client +# - restic.client {% endif %} 'fen.keiran.us': - workstation @@ -19,5 +19,5 @@ - salt.master - icinga2 - nginx - - restic.server +# - restic.server - samba diff --git a/users/files/ssh_hosts.jinja b/users/files/ssh_hosts.jinja new file mode 100644 index 0000000..291b59e --- /dev/null +++ b/users/files/ssh_hosts.jinja @@ -0,0 +1,6 @@ +{% for host, config in salt.pillar.get('ssh_hosts')[user].items() -%} +Host {{ host }} +{%- for key, val in config %} + {{ key }} {{ val }} +{%- endfor %} +{%- endfor %} diff --git a/users/init.sls b/users/init.sls index e336870..5efc480 100644 --- a/users/init.sls +++ b/users/init.sls @@ -80,7 +80,8 @@ {% if 'ssh_config' in data %} /home/{{ user }}/.ssh/config: file.managed: - - contents_pillar: users:{{ user }}:ssh_config + - source: 'salt://users/files/ssh_hosts.jinja' + #- contents_pillar: users:{{ user }}:ssh_config - user: {{ user }} - group: {{ user }} - mode: 0400