salt-formula | salt-formula | ||||
============ | ============ | ||||
0.0.4 | |||||
----- | |||||
- Salt-virt | |||||
- Salt API | |||||
0.0.3 | 0.0.3 | ||||
----- | ----- | ||||
Salt master with API | Salt master with API | ||||
.. code-block:: yaml | |||||
salt: | |||||
api: | |||||
enabled: true | |||||
ssl: | |||||
engine: salt | |||||
bind: | |||||
address: 0.0.0.0 | |||||
port: 8000 | |||||
.. literalinclude:: tests/pillar/master_api.sls | |||||
:language: yaml | |||||
Salt master with defined user ACLs | Salt master with defined user ACLs | ||||
.. code-block:: yaml | |||||
salt: | |||||
master: | |||||
user: | |||||
peter: | |||||
permissions: | |||||
- 'fs.fs' | |||||
- 'fs.\*' | |||||
.. literalinclude:: tests/pillar/master_acl.sls | |||||
:language: yaml | |||||
Salt master with preset minions | Salt master with preset minions | ||||
salt: | salt: | ||||
master: | master: | ||||
enabled: true | enabled: true | ||||
... | |||||
minions: | minions: | ||||
- name: 'node1.system.location.domain.com' | - name: 'node1.system.location.domain.com' | ||||
salt: | salt: | ||||
master: | master: | ||||
enabled: true | enabled: true | ||||
... | |||||
syndic: | |||||
syndicate: | |||||
mode: master | mode: master | ||||
Salt master syndicate (client) master | Salt master syndicate (client) master | ||||
salt: | salt: | ||||
master: | master: | ||||
enabled: true | enabled: true | ||||
... | |||||
syndicate: | syndicate: | ||||
mode: client | mode: client | ||||
host: master-master | host: master-master | ||||
".*": | ".*": | ||||
- x509.sign_remote_certificate | - x509.sign_remote_certificate | ||||
Salt SSH | |||||
-------- | |||||
Salt SSH with sudoer using key | |||||
.. literalinclude:: tests/pillar/master_ssh_minion_key.sls | |||||
:language: yaml | |||||
Salt SSH with sudoer using password | |||||
.. literalinclude:: tests/pillar/master_ssh_minion_password.sls | |||||
:language: yaml | |||||
Salt SSH with root using password | |||||
.. literalinclude:: tests/pillar/master_ssh_minion_root.sls | |||||
:language: yaml | |||||
Salt minion | Salt minion | ||||
----------- | ----------- | ||||
.. literalinclude:: tests/pillar/minion_graph.sls | .. literalinclude:: tests/pillar/minion_graph.sls | ||||
:language: yaml | :language: yaml | ||||
PKI CA | |||||
~~~~~~ | |||||
Salt minion with PKI CA | Salt minion with PKI CA | ||||
.. literalinclude:: tests/pillar/minion_pki_ca.sls | .. literalinclude:: tests/pillar/minion_pki_ca.sls | ||||
.. literalinclude:: tests/pillar/minion_pki_cert.sls | .. literalinclude:: tests/pillar/minion_pki_cert.sls | ||||
:language: yaml | :language: yaml | ||||
Salt control (cloud/kvm/docker) | Salt control (cloud/kvm/docker) | ||||
------------------------------- | ------------------------------- | ||||
.. literalinclude:: tests/pillar/control_cloud_digitalocean.sls | .. literalinclude:: tests/pillar/control_cloud_digitalocean.sls | ||||
:language: yaml | :language: yaml | ||||
Salt virt KVM cluster | |||||
Salt virt with KVM cluster | |||||
.. literalinclude:: tests/pillar/control_virt.sls | .. literalinclude:: tests/pillar/control_virt.sls | ||||
:language: yaml | :language: yaml | ||||
* http://salt-cloud.readthedocs.org/en/latest/topics/map.html | * http://salt-cloud.readthedocs.org/en/latest/topics/map.html | ||||
* http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html | * http://docs.saltstack.com/en/latest/topics/tutorials/multimaster.html | ||||
salt-virt | |||||
--------- | |||||
Sample pillar | |||||
.. code-block:: yaml | |||||
salt: | |||||
control: | |||||
enabled: True | |||||
virt_enabled: True | |||||
size: | |||||
medium: | |||||
cpu: 2 | |||||
ram: 1024 | |||||
cluster: | |||||
localnode: | |||||
domain: domain.com | |||||
engine: virt | |||||
config: | |||||
engine: salt | |||||
host: 127.0.0.1 | |||||
node: | |||||
ubuntu01: | |||||
provider: node001.domain.com | |||||
image: ubuntu-14-04-x64-1456128611.qcow2 | |||||
size: medium | |||||
disk_profile: database | |||||
net_profile: testing |
0.2 | |||||
0.4 |
name: "salt" | name: "salt" | ||||
version: "0.2" | |||||
version: "0.4" | |||||
source: "https://github.com/tcpcloud/salt-formula-salt" | source: "https://github.com/tcpcloud/salt-formula-salt" | ||||
dependencies: | dependencies: | ||||
- name: git | - name: git |
{%- from "salt/map.jinja" import master with context %} | |||||
{%- for minion_name, minion in master.get('ssh_minion', {}).items() %} | |||||
{{ minion_name }}: | |||||
host: {{ minion.host }} | |||||
user: {{ minion.user }} | |||||
{%- if minion.password is defined %} | |||||
passwd: {{ minion.password }} | |||||
{%- endif %} | |||||
{%- if minion.key_file is defined %} | |||||
priv: {{ minion.key_file }} | |||||
{%- endif %} | |||||
{%- if minion.get('sudo', False) %} | |||||
sudo: True | |||||
tty: True | |||||
{%- endif %} | |||||
{%- endfor %} |
{%- if pillar.salt.master.windows_repo is defined %} | {%- if pillar.salt.master.windows_repo is defined %} | ||||
- salt.master.win_repo | - salt.master.win_repo | ||||
{%- endif %} | {%- endif %} | ||||
{%- if pillar.salt.master.ssh_minion is defined %} | |||||
- salt.master.ssh | |||||
{%- endif %} | |||||
{# | {# | ||||
- salt.master.orchestrate | - salt.master.orchestrate | ||||
#} | #} |
{%- if master.pillar.engine == 'salt' %} | {%- if master.pillar.engine == 'salt' %} | ||||
include: | include: | ||||
{%- if master.pillar.source.engine == "git" %} | |||||
- git.client | - git.client | ||||
{%- endif %} | |||||
- salt.master.service | - salt.master.service | ||||
{%- if master.pillar.source.engine == "git" %} | |||||
{{ master.pillar.source.address }}: | {{ master.pillar.source.address }}: | ||||
git.latest: | git.latest: | ||||
- target: /srv/salt/pillar | - target: /srv/salt/pillar | ||||
{%- endif %} | {%- endif %} | ||||
{%- endif %} | |||||
{%- elif master.pillar.engine == 'reclass' %} | {%- elif master.pillar.engine == 'reclass' %} | ||||
include: | include: |
{%- from "salt/map.jinja" import master with context %} | |||||
{%- if master.enabled %} | |||||
include: | |||||
- salt.master.service | |||||
/etc/salt/roster: | |||||
file.managed: | |||||
- source: salt://salt/files/roster | |||||
- user: root | |||||
- template: jinja | |||||
- require: | |||||
- {{ master.install_state }} | |||||
- watch_in: | |||||
- service: salt_master_service | |||||
{%- endif %} |
ubuntu2: | ubuntu2: | ||||
provider: node02.domain.com | provider: node02.domain.com | ||||
image: bubuntu.qcomw | image: bubuntu.qcomw | ||||
size: small | |||||
size: small |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} | |||||
user: | |||||
peter: | |||||
enabled: true | |||||
permissions: | |||||
- 'fs.fs' | |||||
- 'fs.\*' |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} | |||||
api: | |||||
enabled: true | |||||
ssl: | |||||
engine: salt | |||||
bind: | |||||
address: 0.0.0.0 | |||||
port: 8000 |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} | |||||
handler: | |||||
handler01: | |||||
engine: udp | |||||
bind: | |||||
host: 127.0.0.1 | |||||
port: 9999 |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} | |||||
ssh_minion: | |||||
node01: | |||||
host: 10.0.0.1 | |||||
user: saltssh | |||||
sudo: true | |||||
key_file: /path/to/the/key | |||||
port: 22 |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} | |||||
ssh_minion: | |||||
node01: | |||||
host: 10.0.0.1 | |||||
user: saltssh | |||||
sudo: true | |||||
password: password | |||||
port: 22 |
git: | |||||
client: | |||||
enabled: true | |||||
linux: | |||||
system: | |||||
enabled: true | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
source: | |||||
engine: pkg | |||||
pillar: | |||||
engine: salt | |||||
source: | |||||
engine: local | |||||
environment: | |||||
prd: | |||||
formula: {} | |||||
ssh_minion: | |||||
node01: | |||||
host: 10.0.0.1 | |||||
user: root | |||||
password: password | |||||
port: 22 |
salt: | |||||
minion: | |||||
enabled: true | |||||
handler: | |||||
handler01: | |||||
engine: udp | |||||
bind: | |||||
host: 127.0.0.1 | |||||
port: 9999 | |||||
handler02: | |||||
engine: zmq | |||||
bind: | |||||
host: 127.0.0.1 | |||||
port: 9999 |