Browse code

Enable error_on_undefined_vars by default

James Cammarata authored on 2013/08/15 23:25:29
Showing 3 changed files
... ...
@@ -12,6 +12,7 @@ Highlighted new features:
12 12
 * --extra-vars can now take a file as input "-e @filename"
13 13
 * external inventory scripts may now return host variables in one pass, which allows them to be much more efficient for large numbers of hosts
14 14
 * if --forks exceeds the numbers of hosts, it will be automatically reduced, set forks to 0 and you get "as many forks as I have hosts" out of the box.
15
+* enabling error_on_undefined_vars by default, which will make errors in playbooks more obvious
15 16
 
16 17
 New modules:
17 18
 
... ...
@@ -72,9 +72,10 @@ timeout = 10
72 72
 # replacing {file}, {host} and {uid} and strftime codes with proper values.
73 73
 ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
74 74
 
75
-# if set, Ansible will raise errors when attempting to redeference Jinja2
76
-# variables that are not set in templates or action lines. 
77
-#error_on_undefined_vars = True
75
+# by default (as of 1.3), Ansible will raise errors when attempting to dereference 
76
+# Jinja2 variables that are not set in templates or action lines. Uncomment this line
77
+# to revert the behavior to pre-1.3.
78
+#error_on_undefined_vars = False
78 79
 
79 80
 # set plugin path directories here, seperate with colons
80 81
 action_plugins     = /usr/share/ansible_plugins/action_plugins
... ...
@@ -133,7 +133,7 @@ ANSIBLE_SSH_ARGS               = get_config(p, 'ssh_connection', 'ssh_args', 'AN
133 133
 PARAMIKO_RECORD_HOST_KEYS      = get_config(p, 'paramiko_connection', 'record_host_keys', 'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS', True, boolean=True)
134 134
 ZEROMQ_PORT                    = int(get_config(p, 'fireball_connection', 'zeromq_port', 'ANSIBLE_ZEROMQ_PORT', 5099))
135 135
 
136
-DEFAULT_UNDEFINED_VAR_BEHAVIOR = get_config(p, DEFAULTS, 'error_on_undefined_vars', 'ANSIBLE_ERROR_ON_UNDEFINED_VARS', False, boolean=True)
136
+DEFAULT_UNDEFINED_VAR_BEHAVIOR = get_config(p, DEFAULTS, 'error_on_undefined_vars', 'ANSIBLE_ERROR_ON_UNDEFINED_VARS', True, boolean=True)
137 137
 HOST_KEY_CHECKING              = get_config(p, DEFAULTS, 'host_key_checking',  'ANSIBLE_HOST_KEY_CHECKING',    True, boolean=True)
138 138
 
139 139
 # non-configurable things