Change-Id: I3f8ada34bf7e6e356bf6805d98eb0fa4bd66d8d3pull/54/head
master: | master: | ||||
state_output: changes | state_output: changes | ||||
Salt Reactor system configuration | |||||
Salt Reactor system sample | |||||
.. code-block:: yaml | .. code-block:: yaml | ||||
salt/minion/*/start: | salt/minion/*/start: | ||||
- salt://reactor/minion-started.sls | - salt://reactor/minion-started.sls | ||||
Run any orchestration pipeline from custom event | |||||
.. code-block:: yaml | |||||
salt: | |||||
master: | |||||
reactor: | |||||
salt/orchestrate/start: | |||||
- salt://salt/reactor/orchestrate_start.sls | |||||
Sample event to trigger the basic orchestration pipeline | |||||
.. code-block:: bash | |||||
salt-call event.send 'salt/orchestrate/start' "{'orchestrate': 'salt/orchestrate/infra_install.sls'} | |||||
Classify node from custom event | |||||
.. code-block:: yaml | |||||
salt: | |||||
master: | |||||
reactor: | |||||
reclass/minion/classify: | |||||
- salt://reclass/reactor/node_register.sls | |||||
Sample event to trigger the classification | |||||
.. code-block:: bash | |||||
salt-call event.send 'reclass/minion/classify' "{'node_master_ip': '$config_host', 'node_ip': '${node_ip}', 'node_domain': '$node_domain', 'node_cluster': '$node_cluster', 'node_hostname': '$node_hostname', 'node_os': '$node_os'}" | |||||
Salt syndic | Salt syndic | ||||
----------- | ----------- |
{% from "salt/map.jinja" import minion with context %} | |||||
beacons: {{ minion.beacon }} |
{{ provider_name }}: | |||||
provider: {{ provider.engine }} | |||||
{%- if provider.insecure is defined %} | |||||
insecure: true | |||||
{%- endif %} | |||||
{#- location: {{ provider.region }} #} | |||||
personal_access_token: {{ provider.api_key }} | |||||
{%- endif %} |
{{ provider_name }}: | |||||
provider: {{ provider.engine }} | |||||
{%- if provider.insecure is defined %} | |||||
insecure: true | |||||
{%- endif %} |
{{ provider_name }}: | |||||
provider: {{ provider.engine }} | |||||
{%- if provider.insecure is defined %} | |||||
insecure: true | |||||
{%- endif %} | |||||
identity_url: '{{ provider.identity_url }}' | |||||
{%- if provider.compute_name is defined %} | |||||
compute_name: {{ provider.get('compute_name', 'nova') }} | |||||
{%- endif %} | |||||
protocol: ipv4 | |||||
compute_region: {{ provider.region }} | |||||
tenant: {{ provider.tenant }} | |||||
user: {{ provider.user }} | |||||
{%- if provider.api_key is defined %} | |||||
apikey: {{ provider.api_key }} | |||||
{%- elif provider.password is defined %} | |||||
password: {{ provider.password }} | |||||
{%- endif %} | |||||
ssh_key_name: salt-cloud | |||||
ssh_key_file: /root/.ssh/id_rsa | |||||
ssh_interface: {{ provider.get('interface', 'private') }}_ips | |||||
networks: | |||||
- fixed: | |||||
{%- for net in provider.fixed_networks %} | |||||
- {{ net }} | |||||
{%- endfor %} | |||||
- floating: | |||||
{%- for net in provider.floating_networks %} | |||||
- {{ net }} | |||||
{%- endfor %} | |||||
{%- if provider.ignore_cidr is defined %} | |||||
ignore_cidr: {{ provider.ignore_cidr }} | |||||
{%- endif %} |
salt_state_config_node: | |||||
salt.state: | |||||
- tgt: 'salt:master' | |||||
- tgt_type: pillar | |||||
- sls: salt.master | |||||
- queue: True | |||||
reclass_state_config_nodes | |||||
salt.state: | |||||
- tgt: 'reclass:storage' | |||||
- tgt_type: pillar | |||||
- sls: reclass | |||||
- queue: True | |||||
- requires: | |||||
- salt: salt_state_config_node | |||||
linux_state_all_nodes: | |||||
salt.state: | |||||
- tgt: 'linux:system' | |||||
- tgt_type: pillar | |||||
- sls: linux | |||||
- queue: True | |||||
- requires: | |||||
- salt: reclass_state_config_nodes | |||||
salt_state_all_nodes: | |||||
salt.state: | |||||
- tgt: 'salt:minion' | |||||
- tgt_type: pillar | |||||
- sls: salt.minion | |||||
- queue: True | |||||
- requires: | |||||
- salt: linux_state_all_nodes | |||||
ntp_ssh_state_all_nodes: | |||||
salt.state: | |||||
- tgt: 'salt:minion' | |||||
- tgt_type: pillar | |||||
- sls: ntp,openssh | |||||
- queue: True | |||||
- requires: | |||||
- salt: salt_state_all_nodes |
orchestrate_orchestrate_start: | |||||
runner.state.orchestrate: | |||||
- mods: salt://{{ data.data.orchestrate }} | |||||
- queue: {{ data.data.get('queue', True) }} |