Repository: openshift/openshift-ansible

Issue:
TASK openshift_node : Configure Proxy Settings - Fails
We got this when deploying 2 Master nodes cluster from Ansible into Atomic Hosts.
Even if we define or not proxy cluster vars, it fails. We don't use proxy in our env.

OUTPUT:

```
TASK [openshift_node : Configure Proxy Settings] *******************************
task path: /drake/openshift-ansible/roles/openshift_node/tasks/systemd_units.yml:51
fatal: [master2.demo.<mydomain>.com]: FAILED! => {
    "failed": true, 
    "msg": "'dict object' has no attribute 'http_proxy'"
}

RUNNING HANDLER [openshift_node : restart openvswitch] *************************

RUNNING HANDLER [openshift_node : restart node] ********************************
    to retry, use: --limit @/drake/openshift-ansible/playbooks/byo/config.retry

PLAY RECAP *********************************************************************
localhost                  : ok=12   changed=7    unreachable=0    failed=0   
master1.demo.<mydomain>.com : ok=169  changed=20   unreachable=0    failed=1   
master2.demo.<mydomain>.com : ok=220  changed=41   unreachable=0    failed=1
```



Discussion:
@Pyrokinesis can you please provide some additional information for us:
- Which operating system are you running this on
- Are you running from RPM or git checkout
  - (if applicable) What `openshift-ansible-*` and `atomic-openshift-utils` package versions are installed (`rpm -qa | grep -E '(openshift-ansible|atomic-openshift)`)
  - (if applicable) What is the hash of your git checkout (`git log -1 | grep commit`)
- Were you using the quick installer (`/usr/bin/atomic-openshift-installer`) or running `ansible-playbook`?
- What command did you run exactly to start the install?
- Can you provide your inventory file for us?

Thanks a lot!


Resolving patch:
diff --git a/callback_plugins/default.py b/callback_plugins/default.py
--- a/callback_plugins/default.py
+++ b/callback_plugins/default.py
@@ -45,6 +45,9 @@ class CallbackModule(DEFAULT_MODULE.CallbackModule):  # pylint: disable=too-few-
     CALLBACK_TYPE = 'stdout'
     CALLBACK_NAME = 'default'
 
+    def __init__(self, *args, **kwargs):
+        BASECLASS.__init__(self, *args, **kwargs)
+
     def _dump_results(self, result):
         '''Return the text to output for a result.'''
         result['_ansible_verbose_always'] = True
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -17,6 +17,16 @@
 import json
 import yaml
 from ansible.utils.unicode import to_unicode
+from urlparse import urlparse
+
+try:
+    # ansible-2.2
+    # ansible.utils.unicode.to_unicode is deprecated in ansible-2.2,
+    # ansible.module_utils._text.to_text should be used instead.
+    from ansible.module_utils._text import to_text
+except ImportError:
+    # ansible-2.1
+    from ansible.utils.unicode import to_unicode as to_text
 
 # Disabling too-many-public-methods, since filter methods are necessarily
 # public
@@ -621,7 +631,7 @@ def to_padded_yaml(data, level=0, indent=2, **kw):
         try:
             transformed = yaml.safe_dump(data, indent=indent, allow_unicode=True, default_flow_style=False, **kw)
             padded = "\n".join([" " * level * indent + line for line in transformed.splitlines()])
-            return to_unicode("\n{0}".format(padded))
+            return to_text("\n{0}".format(padded))
         except Exception as my_e:
             raise errors.AnsibleFilterError('Failed to convert: %s', my_e)
 


Test patch: