Ansible Remote Setup with AWS


#1

Hi guys!

I have been trying to setup my remote environment, but when I run the ansible command to setup I was getting a lot of warnings like the following:

  Callback Exception:
  File "/Users/diegodomingues/.pyenv/versions/3.5.5/lib/python3.5/site-packages/ansible/executor/task_queue_manager.py", line 375, in send_callback
    method(*new_args, **kwargs)
   File "/Users/diegodomingues/Development/equalize/equalize.io/trellis/lib/trellis/plugins/callback/output.py", line 77, in v2_runner_item_on_skipped
    output.display_item(self, result)
   File "/Users/diegodomingues/Development/equalize/equalize.io/trellis/lib/trellis/utils/output.py", line 122, in display_item
    display(obj, result)
   File "/Users/diegodomingues/Development/equalize/equalize.io/trellis/lib/trellis/utils/output.py", line 92, in display
    elif not isinstance(msg, unicode):


TASK [common : Verify dict format for apt package component variables] ***************************************************************************************
task path: /Users/diegodomingues/Development/equalize/equalize.io/trellis/roles/common/tasks/main.yml:37
 [WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible.plugins.callback.output.CallbackModule object at 0x10d29d4a8>): name
'unicode' is not defined

Callback Exception:
  File "/Users/diegodomingues/.pyenv/versions/3.5.5/lib/python3.5/site-packages/ansible/executor/task_queue_manager.py", line 375, in send_callback
    method(*new_args, **kwargs)
   File "/Users/diegodomingues/Development/equalize/equalize.io/trellis/lib/trellis/plugins/callback/output.py", line 33, in v2_runner_on_failed
    output.display_host(self, result)
   File "/Users/diegodomingues/Development/equalize/equalize.io/trellis/lib/trellis/utils/output.py", line 118, in display_host
    display(obj, result)
   File "/Users/diegodomingues/Development/equalize/equalize.io/trellis/lib/trellis/utils/output.py", line 92, in display
    elif not isinstance(msg, unicode):

I’m using:
python 3.5.5
ansible 2.4.3.0
mac

Can some one help me to understand what is going on?


#2

Ansible and Trellis are currently compatible with Python 2 only (Python 3 compat likely mid 2018).

Try python 2.7.x. Your pyenv will hopefully make that an easy switch.

# if necessary
$ pyenv install 2.7.13

# switch versions
$ pyenv global 2.7.13

# may have to install ansible again for this new python version
$ pip install ansible==2.4.3.0

# may have  to install your galaxy roles again?
$ ansible-galaxy install -r requirements.yml --force

#3

Thank you Phil!

It works :heart_eyes: