Difference between revisions of "SaltStack Notes"
Jump to navigation
Jump to search
(Created page with "``` {% for file in '/etc/ssl/private/' + fqdn + '.key', '/etc/ssl/private/' + fqdn + '.crt' %} {{ file }}: file.managed: - source: "salt://application1/{{ file }}"...") |
|||
| Line 1: | Line 1: | ||
| + | |||
| + | set timeout | ||
| + | ``` | ||
| + | sudo salt -t 120 '*.haproxy' state.apply haproxy | ||
| + | ``` | ||
| + | |||
``` | ``` | ||
{% for file in | {% for file in | ||
Revision as of 20:11, 2 April 2020
set timeout
sudo salt -t 120 '*.haproxy' state.apply haproxy
{% for file in
'/etc/ssl/private/' + fqdn + '.key',
'/etc/ssl/private/' + fqdn + '.crt'
%}
{{ file }}:
file.managed:
- source: "salt://application1/{{ file }}"
- user: root
- group: ssl-cert
- mode: 0740
{% endfor %}
Complex:
{% for file in [
{ 'src': '/etc/ssl/private/' + fqdn + '.key', 'dst': '/etc/ssl/private/' + fqdn + '.key', 'group': 'ssl-cert'},
{ 'src': '/etc/ssl/private/' + fqdn + '.crt', 'dst': '/etc/ssl/private/' + fqdn + '.crt', 'group': 'ssl-cert'},
{ 'src': '/etc/nginx/sites-available/application2.conf.j2', 'dst': '/etc/nginx/sites-available/' + fqdn + '.conf', 'group': 'www-data' }
]
%}
{{ file.dst }}:
file.managed:
- source: "salt://application2/{{ file.src }}"
- user: root
- group: "{{ file.group }}"
- mode: 0740
{% endfor %}