Change-Id: Ifac3f5e03099e8190db0a3af62a7be1f762f87bepull/56/head
@@ -231,7 +231,8 @@ Event to trigger the key creation | |||
.. 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:: | |||
@@ -32,6 +32,9 @@ def key_create(id_, host, force=False): | |||
''' | |||
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: | |||
.. code-block:: bash |
@@ -1,6 +0,0 @@ | |||
{%- set node_name = salt['pillar.get']('node_name') %} | |||
key_create_{{ node_name }}: | |||
salt.wheel: | |||
- name: key.gen_accept | |||
- id_: {{ node_name }} |
@@ -1,6 +0,0 @@ | |||
{%- set node_name = salt['pillar.get']('node_name') %} | |||
key_create_{{ node_name }}: | |||
salt.wheel: | |||
- name: key.delete | |||
- match: {{ node_name }} |
@@ -0,0 +1,13 @@ | |||
{%- 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 }} | |||
@@ -0,0 +1,11 @@ | |||
{%- 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 }} | |||
@@ -14,3 +14,4 @@ reclass_state_config_nodes | |||
- queue: True | |||
- require: | |||
- salt: salt_state_config_node | |||
@@ -21,3 +21,4 @@ misc_states: | |||
- queue: True | |||
- require: | |||
- salt: salt_state | |||
@@ -1,5 +1,6 @@ | |||
orchestrate_infra_install: | |||
runner.state.orchestrate: | |||
- mods: salt://salt/orchestrate/infra_install.sls | |||
- mods: salt.orchestrate.reactor.infra_install | |||
- queue: True | |||
@@ -3,27 +3,26 @@ | |||
orchestrate_node_key_pre_create: | |||
runner.state.orchestrate: | |||
- mods: salt://{{ data.data.orch_pre_create }} | |||
- mods: {{ data.data.orch_pre_create }} | |||
- queue: True | |||
- pillar: | |||
node_name: {{ data.data['node_name'] }} | |||
- pillar: {{ data.data.get('orch_pre_create_pillar', {}) }} | |||
{% endif %} | |||
node_key_create: | |||
runner.state.orchestrate: | |||
- mods: salt://salt/orchestrate/key_create.sls | |||
- mods: salt.orchestrate.reactor.key_create | |||
- queue: True | |||
- 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 %} | |||
orchestrate_node_key_post_create: | |||
runner.state.orchestrate: | |||
- mods: salt://{{ data.data.orch_post_create }} | |||
- mods: {{ data.data.orch_post_create }} | |||
- queue: True | |||
- pillar: | |||
node_name: {{ data.data['node_name'] }} | |||
- pillar: {{ data.data.get('orch_post_create_pillar', {}) }} | |||
{% endif %} |
@@ -3,27 +3,25 @@ | |||
orchestrate_node_key_pre_remove: | |||
runner.state.orchestrate: | |||
- mods: salt://{{ data.data.orch_pre_remove }} | |||
- mods: {{ data.data.orch_pre_remove }} | |||
- queue: True | |||
- pillar: | |||
node_name: {{ data.data['node_name'] }} | |||
- pillar: {{ data.data.get('orch_pre_remove_pillar', {}) }} | |||
{% endif %} | |||
node_key_remove: | |||
runner.state.orchestrate: | |||
- mods: salt://salt/orchestrate/key_remove.sls | |||
- mods: salt.orchestrate.reactor.key_remove.sls | |||
- queue: True | |||
- pillar: | |||
node_name: {{ data.data['node_name'] }} | |||
node_id: {{ data.data['node_id'] }} | |||
{% if data.data.orch_post_remove is defined %} | |||
orchestrate_node_key_post_remove: | |||
runner.state.orchestrate: | |||
- mods: salt://{{ data.data.orch_post_remove }} | |||
- mods: {{ data.data.orch_post_remove }} | |||
- queue: True | |||
- pillar: | |||
node_name: {{ data.data['node_name'] }} | |||
- pillar: {{ data.data.get('orch_post_remove_pillar', {}) }} | |||
{% endif %} |
@@ -8,3 +8,4 @@ minion_refresh_pillar: | |||
local.saltutil.refresh_pillar: | |||
- tgt: {{ data.id }} | |||
- queue: True | |||
@@ -1,7 +1,8 @@ | |||
orchestrate_node_install: | |||
runner.state.orchestrate: | |||
- mods: salt://salt/orchestrate/node_install.sls | |||
- mods: salt.reactor.orchestrate.node_install | |||
- queue: True | |||
- pillar: | |||
event_originator: {{ data.id }} | |||
@@ -1,5 +1,6 @@ | |||
orchestrate_orchestrate_run: | |||
runner.state.orchestrate: | |||
- mods: salt://{{ data.data.orchestrate }} | |||
- mods: {{ data.data.orchestrate }} | |||
- queue: {{ data.data.get('queue', True) }} | |||
@@ -0,0 +1,9 @@ | |||
{%- 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 }} | |||
@@ -0,0 +1,6 @@ | |||
{%- set node_id = salt['pillar.get']('node_id') %} | |||
key_create_{{ node_id }}: | |||
salt.wheel: | |||
- name: key.delete | |||
- match: {{ node_id }} |