Change-Id: Ifac3f5e03099e8190db0a3af62a7be1f762f87bepull/56/head
.. code-block:: bash | .. code-block:: bash | ||||
salt-call event.send 'salt/key/create' "{'node_name': 'id-of-minion', 'orch_post_create': 'kubernetes/orchestrate/compute_install.sls'}" | |||||
salt-call event.send 'salt/key/create' \ | |||||
> "{'node_id': 'id-of-minion', 'node_host': '172.16.10.100', 'orch_post_create': 'kubernetes.orchestrate.compute_install', 'post_create_pillar': {'node_name': 'id-of-minion'}}" | |||||
.. note:: | .. note:: | ||||
''' | ''' | ||||
Generates minion keypair, accepts it on master and injects it to minion via SSH. | Generates minion keypair, accepts it on master and injects it to minion via SSH. | ||||
:param id_: expected minion ID of target node | |||||
:param host: IP address or resolvable hostname/FQDN of target node | |||||
CLI Examples: | CLI Examples: | ||||
.. code-block:: bash | .. code-block:: bash |
{%- set node_name = salt['pillar.get']('node_name') %} | |||||
key_create_{{ node_name }}: | |||||
salt.wheel: | |||||
- name: key.gen_accept | |||||
- id_: {{ node_name }} |
{%- set node_name = salt['pillar.get']('node_name') %} | |||||
key_create_{{ node_name }}: | |||||
salt.wheel: | |||||
- name: key.delete | |||||
- match: {{ node_name }} |
{%- set node_id = salt['pillar.get']('node_id') %} | |||||
{%- set node_host = salt['pillar.get']('node_host') %} | |||||
linux_state_all_nodes: | |||||
salt.state: | |||||
- tgt: 'salt:master' | |||||
- tgt_type: pillar | |||||
- sls: salt.reactor_sls.key_create | |||||
- queue: True | |||||
- pillar: | |||||
node_id: {{ node_id }} | |||||
node_host: {{ node_host }} | |||||
{%- set node_id = salt['pillar.get']('node_id') %} | |||||
linux_state_all_nodes: | |||||
salt.state: | |||||
- tgt: 'salt:master' | |||||
- tgt_type: pillar | |||||
- sls: salt.reactor_sls.key_remove | |||||
- queue: True | |||||
- pillar: | |||||
node_id: {{ node_id }} | |||||
- queue: True | - queue: True | ||||
- require: | - require: | ||||
- salt: salt_state_config_node | - salt: salt_state_config_node | ||||
- queue: True | - queue: True | ||||
- require: | - require: | ||||
- salt: salt_state | - salt: salt_state | ||||
orchestrate_infra_install: | orchestrate_infra_install: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://salt/orchestrate/infra_install.sls | |||||
- mods: salt.orchestrate.reactor.infra_install | |||||
- queue: True | - queue: True | ||||
orchestrate_node_key_pre_create: | orchestrate_node_key_pre_create: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://{{ data.data.orch_pre_create }} | |||||
- mods: {{ data.data.orch_pre_create }} | |||||
- queue: True | - queue: True | ||||
- pillar: | |||||
node_name: {{ data.data['node_name'] }} | |||||
- pillar: {{ data.data.get('orch_pre_create_pillar', {}) }} | |||||
{% endif %} | {% endif %} | ||||
node_key_create: | node_key_create: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://salt/orchestrate/key_create.sls | |||||
- mods: salt.orchestrate.reactor.key_create | |||||
- queue: True | - queue: True | ||||
- pillar: | - pillar: | ||||
node_name: {{ data.data['node_name'] }} | |||||
node_id: {{ data.data['node_id'] }} | |||||
node_host: {{ data.data['node_host'] }} | |||||
{% if data.data.orch_post_create is defined %} | {% if data.data.orch_post_create is defined %} | ||||
orchestrate_node_key_post_create: | orchestrate_node_key_post_create: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://{{ data.data.orch_post_create }} | |||||
- mods: {{ data.data.orch_post_create }} | |||||
- queue: True | - queue: True | ||||
- pillar: | |||||
node_name: {{ data.data['node_name'] }} | |||||
- pillar: {{ data.data.get('orch_post_create_pillar', {}) }} | |||||
{% endif %} | {% endif %} |
orchestrate_node_key_pre_remove: | orchestrate_node_key_pre_remove: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://{{ data.data.orch_pre_remove }} | |||||
- mods: {{ data.data.orch_pre_remove }} | |||||
- queue: True | - queue: True | ||||
- pillar: | |||||
node_name: {{ data.data['node_name'] }} | |||||
- pillar: {{ data.data.get('orch_pre_remove_pillar', {}) }} | |||||
{% endif %} | {% endif %} | ||||
node_key_remove: | node_key_remove: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://salt/orchestrate/key_remove.sls | |||||
- mods: salt.orchestrate.reactor.key_remove.sls | |||||
- queue: True | - queue: True | ||||
- pillar: | - pillar: | ||||
node_name: {{ data.data['node_name'] }} | |||||
node_id: {{ data.data['node_id'] }} | |||||
{% if data.data.orch_post_remove is defined %} | {% if data.data.orch_post_remove is defined %} | ||||
orchestrate_node_key_post_remove: | orchestrate_node_key_post_remove: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://{{ data.data.orch_post_remove }} | |||||
- mods: {{ data.data.orch_post_remove }} | |||||
- queue: True | - queue: True | ||||
- pillar: | |||||
node_name: {{ data.data['node_name'] }} | |||||
- pillar: {{ data.data.get('orch_post_remove_pillar', {}) }} | |||||
{% endif %} | {% endif %} |
local.saltutil.refresh_pillar: | local.saltutil.refresh_pillar: | ||||
- tgt: {{ data.id }} | - tgt: {{ data.id }} | ||||
- queue: True | - queue: True | ||||
orchestrate_node_install: | orchestrate_node_install: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://salt/orchestrate/node_install.sls | |||||
- mods: salt.reactor.orchestrate.node_install | |||||
- queue: True | - queue: True | ||||
- pillar: | - pillar: | ||||
event_originator: {{ data.id }} | event_originator: {{ data.id }} | ||||
orchestrate_orchestrate_run: | orchestrate_orchestrate_run: | ||||
runner.state.orchestrate: | runner.state.orchestrate: | ||||
- mods: salt://{{ data.data.orchestrate }} | |||||
- mods: {{ data.data.orchestrate }} | |||||
- queue: {{ data.data.get('queue', True) }} | - queue: {{ data.data.get('queue', True) }} | ||||
{%- set node_id = salt['pillar.get']('node_id') %} | |||||
{%- set node_host = salt['pillar.get']('node_host') %} | |||||
key_create_{{ node_id }}: | |||||
module.run: | |||||
saltkey.key_create: | |||||
- id_: {{ node_id }} | |||||
- host: {{ node_host }} | |||||
{%- set node_id = salt['pillar.get']('node_id') %} | |||||
key_create_{{ node_id }}: | |||||
salt.wheel: | |||||
- name: key.delete | |||||
- match: {{ node_id }} |