The error "does not match any unaccepted keys" is because the minion
generates a key when the daemon starts and then pushes that to the
master when it first connects. Meaning you need to wait for it to
connect, then accept the key, then wait for the start event.
If you run `state.event` with no args you can see which events come in and when.
Since the `salt/auth` event tag does not have the minion ID in the tag
I don't think you can watch for it from the `state.event` runner. You
might need to use Orchestrate instead. Here's an (untested) example:
{% set mid = salt.pillar.get('mid') %}
reboot:
salt.function:
- name: system.reboot
- tgt: {{ mid }}
del_old_key:
salt.wheel:
- name: key.delete
- match: {{ mid }}
- require:
- salt: reboot
wait_for_connect:
salt.wait_for_event:
- name: salt/auth
- id_list:
- {{ mid }}
- onchanges:
- salt: del_old_key
acc_new_key:
salt.wheel:
- name: key.accept
- match: {{ mid }}
- require:
- salt: wait_for_connect
wait_for_start:
salt.wait_for_event:
- name: salt/minion/*/start
- id_list:
- {{ mid }}
- require:
- salt: acc_new_key
set_init_grains:
salt.function:
- name: grains.setval
- tgt: {{ mid }}
- arg:
- roles
- big
> --
> You received this message because you are subscribed to the Google Groups
> "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
salt-users+...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.