saltstack-formulas / powerdns-formula Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
License: Apache License 2.0
Home Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
License: Apache License 2.0
Including powerdns in the top.sls and running highstate results in it failing to render the configuration:
----------
ID: powerdns_config
Function: file.managed
Name: /etc/powerdns/pdns.conf
Result: False
Comment: Unable to manage file: Jinja error: argument of type 'StrictUndefined' is not iterable
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 261, in render_jinja_tmpl
output = jinja_env.from_string(tmplstr).render(**unicode_context)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "<template>", line 11, in top-level template code
TypeError: argument of type 'StrictUndefined' is not iterable
; line 11
---
[...]
#################################
# allow-axfr-ips If enabled, restrict zonetransfers to originate from these
# IP addresses
#
# allow-axfr-ips=
{% if 'dns-supermaster' in grains['role'] %} <======================
allow-axfr-ips={{ pillar['networks']['dns-master']['ip'] }}
{% endif %}
#################################
# allow-recursion List of netmasks that are allowed to recurse
[...]
---
Changes:
v0.3.4
None. take defaults
defaults use powerdns v4.0 which is no long available
Defaults should be valid
Set the default to master
_module/powerdns.py mentions passing pdns.url, pdns.server_id, pdns.api_key to a pillar, but I have been unable to determine how. It appears this is required for the sls.example state to work.
records.sls state:
pdnsapi python module:
pip.installed:
- name: pdnsapi >= 0.3.0b3
- reload_modules: True
- require:
- cmd: /usr/bin/python /usr/local/sbin/get-pip.py
subdomain.domain.net.present:
powerdns.zone_present:
- name: subdomain.domain.net
- require:
- pip: pdnsapi >= 0.3.0b3
subdomain.domain.net.SOA:
powerdns.record_present:
- zone: subdomain.domain.net
- name: subdomain.domain.net
- record_type: 'SOA'
- records:
- netsvc.subdomain.domain.net. hostmaster.subdomain.domain.net. 1 10800 3600 604800 300
- require:
- powerdns: subdomain.domain.net.present
salt state.apply output:
Function: powerdns.zone_present
Name: subdomain.domain.net
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1746, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1704, in wrapper
return f(*args, **kwargs)
File "/var/cache/salt/minion/extmods/states/powerdns.py", line 29, in zone_present
if __salt__['powerdns.zone_exists'](name):
File "/var/cache/salt/minion/extmods/modules/powerdns.py", line 96, in zone_exists
zone = conn.get_zone(name)
File "/usr/local/lib/python2.7/dist-packages/pdnsapi/api.py", line 251, in get_zone
zone_name))
File "/usr/local/lib/python2.7/dist-packages/pdnsapi/api.py", line 103, in perform_request
response = method(url, headers={'X-API-Key': api_key}, data=data)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 69, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 451, in request
prep = self.prepare_request(req)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 382, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 304, in prepare
self.prepare_url(url, params)
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 362, in prepare_url
to_native_string(url, 'utf8')))
MissingSchema: Invalid URL '/api/v1/servers//zones/subdomain.domain.net': No schema supplied. Perhaps you meant http:///api/v1/servers//zones/subdomain.domain.net?
Started: 13:13:14.353211
Duration: 6.897 ms
Changes:
----------
ID: subdomain.domain.net.SOA
Function: powerdns.record_present
Name: subdomain.domain.net
Result: False
Comment: One or more requisite failed: powerdns.records.subdomain.domain.net.present
Changes:
PDNS architecture is ideally two tiers with a recursor reading from an authoritative server. There is no support for the recursor here.
It is mostly doable as it stands by changing the variables but it would be nice to have it supported out of the box.
Having a powerdns.recursor sls file that creates a recursor with very little interference would be great.
It would be nice to have this formula be able to deploy and configure a pdns-recursor.
Maybe some of the functionality developed in https://github.com/bechtoldt/saltstack-powerdns-formula could be backported or reused in this context.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.