Running playbook in interactive mode breaks upon run

167 views
Skip to first unread message

Samnang Sen

unread,
Mar 4, 2015, 1:53:34 PM3/4/15
to ansible...@googlegroups.com
ansible-playbook -i hosts test.yml --step

Output:

PLAY [webservers] *************************************************************
Traceback (most recent call last):
  File "/home/deployment/ansible/bin/ansible-playbook", line 316, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/deployment/ansible/bin/ansible-playbook", line 256, in main
    pb.run()
  File "/home/deployment/ansible/lib/ansible/playbook/__init__.py", line 352, in run
    if not self._run_play(play):
  File "/home/deployment/ansible/lib/ansible/playbook/__init__.py", line 796, in _run_play
    if not self._run_task(play, task, False):
  File "/home/deployment/ansible/lib/ansible/playbook/__init__.py", line 487, in _run_task
    self.callbacks.on_task_start(name, is_handler)
  File "/home/deployment/ansible/lib/ansible/callbacks.py", line 637, in on_task_start
    msg = msg.encode(sys.stdout.encoding, errors='replace')
TypeError: encode() takes no keyword arguments


# test.yml

- hosts: webservers
  gather_facts: no

  vars_files:
  - "group_vars/deploy_list_sam"

  pre_tasks:
    - name: disable service in the lb
      netscaler: nsc_host={{nsc_host}} user={{nsc_user}} password={{nsc_pass}} name={{name}} type={{type}} action=disable validate_certs=no
      delegate_to: 127.0.0.1
      tags: ns_remove_web

  roles:
    - web

  post_tasks:
    - name: enable in the lb
      netscaler: nsc_host={{nsc_host}} user={{nsc_user}} password={{nsc_pass}} name={{name}} type={{type}} action=enable validate_certs=no
      delegate_to: 127.0.0.1
      tags: ns_add_web

Samnang Sen

unread,
Mar 4, 2015, 1:57:03 PM3/4/15
to ansible...@googlegroups.com
FYI. Ansible version is 1.8.2 and I tried it from the devel branch.

tkuratomi

unread,
Mar 4, 2015, 2:12:05 PM3/4/15
to ansible...@googlegroups.com
Could you update your devel branch checkout and try it again?  I found the issue and think I committed a fix for it.  Just would like confirmation :-)

-Toshio

Samnang Sen

unread,
Mar 4, 2015, 2:14:21 PM3/4/15
to ansible...@googlegroups.com
Awesome! Works!

Thank you

Rick Kasten

unread,
Mar 12, 2015, 11:19:05 AM3/12/15
to ansible...@googlegroups.com
I am getting a similar error when running my playbook with '--step' with Ansible 1.8.4:

$ ansible-playbook -i inventory/dse/dse text.yml

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
ok: [dse02]
ok: [twp01]

TASK: [common | Build inventory group] ****************************************
ok: [dse02] => (item=dse02)
ok: [dse02] => (item=twp01)

TASK: [common | Reload facts after updating site group] ***********************
ok: [dse02]
ok: [twp01]

TASK: [common | Set JBoss facts] **********************************************
skipping: [dse02]
skipping: [twp01]

PLAY RECAP ********************************************************************
dse02                      : ok=3    changed=0    unreachable=0    failed=0
twp01                      : ok=3    changed=0    unreachable=0    failed=0

$ ansible-playbook -i inventory/dse/dse test.yml --step

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
ok: [twp01]
ok: [dse02]

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 326, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-playbook", line 266, in main
    pb.run()
  File "/usr/lib/python2.6/site-packages/ansible/playbook/__init__.py", line 347, in run
    if not self._run_play(play):
  File "/usr/lib/python2.6/site-packages/ansible/playbook/__init__.py", line 740, in _run_play

    if not self._run_task(play, task, False):
  File "/usr/lib/python2.6/site-packages/ansible/playbook/__init__.py", line 474, in _run_task
    self.callbacks.on_task_start(template(play.basedir, name, task.module_vars, lookup_fatal=False, filter_fatal=False), is_handler)
  File "/usr/lib/python2.6/site-packages/ansible/callbacks.py", line 636, in on_task_start

    msg = msg.encode(sys.stdout.encoding, errors='replace')
TypeError: encode() takes no keyword arguments



# test.yml
- hosts: all
  roles:
  - common
Reply all
Reply to author
Forward
0 new messages