1
0
Fork 0
mirror of synced 2024-11-18 06:55:34 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Imran Iqbal
57c88a8140
fix: make necessary modifications to get working on salt-ssh
* https://freenode.logbot.info/saltstack-formulas/20200506#c3811885-c3812572
* Avoid `defaults.merge`
* Send template values by `context`, to avoid:

```python
      ID: logrotate-config
Function: file.managed
    Name: /etc/logrotate.conf
  Result: False
 Comment: An exception occurred in this state: Traceback (most recent call last):
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/utils/templates.py", line 394, in render_jinja_tmpl
              output = template.render(**decoded_context)
            File "/var/tmp/.root_08c4d3_salt/pyall/jinja2/environment.py", line 1008, in render
              return self.environment.handle_exception(exc_info, True)
            File "/var/tmp/.root_08c4d3_salt/pyall/jinja2/environment.py", line 780, in handle_exception
              reraise(exc_type, exc_value, tb)
            File "/var/tmp/.root_08c4d3_salt/pyall/jinja2/_compat.py", line 37, in reraise
              raise value.with_traceback(tb)
            File "<template>", line 1, in top-level template code
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/utils/jinja.py", line 193, in get_source
              raise TemplateNotFound(template)
          jinja2.exceptions.TemplateNotFound: logrotate/map.jinja

          During handling of the above exception, another exception occurred:

          Traceback (most recent call last):
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/state.py", line 1981, in call
              **cdata['kwargs'])
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/loader.py", line 1977, in wrapper
              return f(*args, **kwargs)
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/states/file.py", line 3037, in managed
              **kwargs
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/modules/file.py", line 4846, in check_managed_changes
              **kwargs)
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/modules/file.py", line 4287, in get_managed
              **kwargs)
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/utils/templates.py", line 169, in render_tmpl
              output = render_str(tmplstr, context, tmplpath)
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/utils/templates.py", line 443, in render_jinja_tmpl
              trace=tracestr)
          salt.exceptions.SaltRenderError: Jinja error: logrotate/map.jinja
          Traceback (most recent call last):
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/utils/templates.py", line 394, in render_jinja_tmpl
              output = template.render(**decoded_context)
            File "/var/tmp/.root_08c4d3_salt/pyall/jinja2/environment.py", line 1008, in render
              return self.environment.handle_exception(exc_info, True)
            File "/var/tmp/.root_08c4d3_salt/pyall/jinja2/environment.py", line 780, in handle_exception
              reraise(exc_type, exc_value, tb)
            File "/var/tmp/.root_08c4d3_salt/pyall/jinja2/_compat.py", line 37, in reraise
              raise value.with_traceback(tb)
            File "<template>", line 1, in top-level template code
            File "/var/tmp/.root_08c4d3_salt/pyall/salt/utils/jinja.py", line 193, in get_source
              raise TemplateNotFound(template)
          jinja2.exceptions.TemplateNotFound: logrotate/map.jinja

          ; line 1

          ---
          {%- from "logrotate/map.jinja" import logrotate with context -%}    <======================
          {%- set config = salt['pillar.get']('logrotate:default_config', logrotate.default_config) -%}

          {%- set processed_parameters = [] -%}

          {%- macro set_parameter(parameter, default=None) -%}
          [...]
```
2020-05-06 15:42:57 +01:00
Javier Bértoli
788d08811f Re-add map.jinja changes from #36 lost on #36 2018-11-14 17:27:15 -03:00
Javier Bértoli
ea46350673 Make sure dependencies are installed if required, fix tests 2018-10-26 08:54:02 -03:00
Mark Gomersbach
db3629904c
Move os_family and os mapping to yaml files
- Add Gentoo support
- Add FreeBSD support
2018-10-15 16:45:15 +02:00
Andre Sencioles
fabbb440bc Compress rotated files by default on Debian 2017-03-29 18:06:25 +13:00
Gilles Dartiguelongue
0ac29dd03f Fix deep merge of settings 2017-02-14 17:13:57 +01:00
Gilles Dartiguelongue
98e6f6a909 Add support for default logrotate options 2017-02-14 17:13:57 +01:00
Gilles Dartiguelongue
1c6661a485 Move common settings to defaults.yaml 2017-02-14 17:09:22 +01:00
kramer
89c5fbaa92 add Scientific Linux support 2017-02-08 16:57:08 -06:00
Michal Galet
73c86743e2 Change the default service name to 'crond' for RHEL based systems. 2015-04-02 15:28:51 +02:00
Niels Abspoel
f142bc6a48 Added opensuse support 2015-03-07 11:27:15 +01:00
Niels Abspoel
9c8e2bdc63 added Fedora to map.jinja
it's crond service on fedora that initiates logrotate
2015-02-07 10:08:08 +01:00
Niels Abspoel
6f1b01d59f fix logrotate service name to cron instead of crond 2015-01-06 20:06:50 +01:00
Niels Abspoel
38808d6221 Initial commit to add all files 2015-01-01 19:52:08 +01:00