Compare commits

..

1 Commits

Author SHA1 Message Date
689aba411c Manage salt-minion package, service and config
Restart the service after upgrading the package or modifying the minion
configuration file.

Signed-off-by: Joe Groocock <me@frebib.net>
2020-07-12 16:54:10 +01:00
4 changed files with 8 additions and 19 deletions

View File

@ -10,11 +10,11 @@ salt-minion:
- file: /etc/salt/minion - file: /etc/salt/minion
restart-salt-minion: restart-salt-minion:
cmd.run: service.restart:
- name: sleep 10 && systemctl restart salt-minion - name: salt-minion
- bg: true
- order: last - order: last
- onchanges: - no_block: true
- watch:
- pkg: salt-minion - pkg: salt-minion
- file: /etc/salt/minion - file: /etc/salt/minion
- require: - require:
@ -22,8 +22,7 @@ restart-salt-minion:
/etc/salt/minion: /etc/salt/minion:
file.managed: file.managed:
- source: salt://{{ slspath }}/templates/minion.jinja - source: salt://{{ slspath }}/minion.jinja
- template: jinja
- user: root - user: root
- group: root - group: root
- mode: 644 - mode: 644
@ -34,7 +33,6 @@ restart-salt-minion:
check-minion-config: check-minion-config:
cmd.run: cmd.run:
- name: sudo salt-call --local --skip-grains test.true - name: sudo salt-call --local --skip-grains test.ping
- onchanges: - watch:
- pkg: salt-minion
- file: /etc/salt/minion - file: /etc/salt/minion

View File

@ -1,4 +1,4 @@
id: {{ grains.id|lower }} id: {{ minion_id }}
log_level: info log_level: info
ipv6: true ipv6: true
ssl: true ssl: true

View File

@ -16,9 +16,4 @@
{%- if user.shell is defined %} {%- if user.shell is defined %}
- shell: {{ user.shell }} - shell: {{ user.shell }}
{%- endif %} {%- endif %}
ssh_auth.manage:
- user: {{ name }}
{%- if user['ssh-keys'] is defined %}
- ssh_keys: {{ user['ssh-keys']|json }}
{%- endif %}
{%- endfor %} {%- endfor %}

View File

@ -4,9 +4,6 @@
{%- do admin_groups.append('systemd-journal') %} {%- do admin_groups.append('systemd-journal') %}
{%- endif %} {%- endif %}
{# FIXME(frebib): manage Docker group instead of blindly adding it #}
{%- do admin_groups.append('docker') %}
frebib: frebib:
groups: groups:
{%- for group in admin_groups %} {%- for group in admin_groups %}
@ -15,7 +12,6 @@ frebib:
ssh-keys: ssh-keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINk+sOUEXKsGqITyMhna9v77ADGagkr3YMpgZFkrvqcd frebib@frebib-PC - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINk+sOUEXKsGqITyMhna9v77ADGagkr3YMpgZFkrvqcd frebib@frebib-PC
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBIGxhZPQM/3Ck+DNNM0CoIZTsvKqQLKq8fqQoO6fXzX frebib@frebib-OnePlus3 - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBIGxhZPQM/3Ck+DNNM0CoIZTsvKqQLKq8fqQoO6fXzX frebib@frebib-OnePlus3
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+T8ChEU9YmpE2BY77oEtKzedB8HWDSM5bErDN9gcvj frebib@frebib-Cf
adam: adam:
groups: groups: