ERROR: Invalid ini entry

I first time configurating ansible. I use ansible-playbook 1.7.2, ubuntu 14.10 (this last version ansible in my ububntu). I am configured playbook and task, created inventory file.
I started ansible follow command
ansible-playbook -i /etc/ansible/inventory /etc/ansible/roles/preconf/tasks/test_new.yml -v --list-hosts --list-tasks

contents my inventory file

[testserver]

10.95.46.117 ansible_ssh_port=5555 ansible_ssh_host=10.95.46.117 ansible_ssh_use

and receipt error:
ERROR: Invalid ini entry: This - need more than 1 value to unpack

In what my error? What i do wrong?

i can’t see any value to ansible_ssh_user, if you haven’t set one, you should do it. i don’t think ansible_ssh_host is needed because it is already specified. then, you should set your password and the connection type:

inventory file:

[testserver]

10.95.46.117

[testserver:vars]

ansible_ssh_port=5555

ansible_connection=YourConnectionType (can be ssh or winrm)

ansible_ssh_user=YourUserName

ansible_ssh_pass=SuperSecretPassword123

then try running: ansible-playbook -i /etc/ansible/inventory /etc/ansible/roles/preconf/tasks/test_new.yml -vvvv

hope that helps

I did the settings that you specify. My config file

[testserver]
10.95.46.117

[tesserver:vars]
ansible_ssh_port=5555
ansible_connection=ssh
ansible_ssh_user=user
ansible_ssh_pass=user

and I get the same error

~# ansible-playbook -i /etc/ansible/inventory /etc/ansible/roles/preconf/tasks/test_new.yml -vvvv
ERROR: Invalid ini entry: This - need more than 1 value to unpack

In what may be another mistake?

And one more question. Of what value is said in the error message?

can you post a version of your playbook? can you ping the port you are targeting?

by the way, you should have [testserver:vars] and not [tesserver:vars]

can you post a version of your playbook? can you ping the port you are targeting?

~# ansible-playbook --version
ansible-playbook 1.7.2

ping 10.95.46.117

PING 10.95.46.117 (10.95.46.117) 56(84) bytes of data.
64 bytes from 10.95.46.117: icmp_seq=1 ttl=64 time=0.949 ms
64 bytes from 10.95.46.117: icmp_seq=2 ttl=64 time=0.453 ms
^C

Or you’re interested in the content test_new.yml?

by the way, you should have [testserver:vars] and not [tesserver:vars]

Oh, of course, I made a typo. I’ve corrected the typo. Still getting the error message

i would like to see the content of test_new.yml

As suggested by the documentation ( http://docs.ansible.com/ansible/intro_configuration.html#sudo-user ), i would say the remote. just to be clear, your remote is a Linux/Unix machine? double check your indentation in your playbook to be sure nothing is wrong here.
can you try: ansible 10.95.46.117 -m ping

Maybe consider to upgrade your ansible version (and your ubuntu)
What i don’t understand is that you have an error related to syntax while i can’t find anything unusual…

Can you upload your actual inventory file somewhere for us to download and take a look? I’ve just tested and one way that error can happen is if there’s trailing, non-ascii whitespace.

-Toshio

As suggested by the documentation ( http://docs.ansible.com/ansible/intro_configuration.html#sudo-user ), i would say the remote. just to be clear, your remote is a Linux/Unix machine? double check your indentation in your playbook to be sure nothing is wrong here.
can you try: ansible 10.95.46.117 -m ping

Maybe consider to upgrade your ansible version (and your ubuntu)
What i don’t understand is that you have an error related to syntax while i can’t find anything unusual…

My machine Linux on both side (Ubuntu 14.10).
`
c# ping 10.95.46.117
PING 10.95.46.117 (10.95.46.117) 56(84) bytes of data.
64 bytes from 10.95.46.117: icmp_seq=1 ttl=64 time=0.682 ms
64 bytes from 10.95.46.117: icmp_seq=2 ttl=64 time=0.404 ms
^C
— 10.95.46.117 ping statistics —

ansible 10.95.46.117 -m ping

ERROR: Invalid ini entry: This - need more than 1 value to unpack

`

I have standard repository for Ubuntu. I have latest version ansible.
`

ansible --version

ansible 1.7.2

apt-cache showpkg ansible

Package: ansible
Versions:
1.7.2+dfsg-1
`

Can you upload your actual inventory file somewhere for us to download and take a look? I’ve just tested and one way that error can happen is if there’s trailing, non-ascii whitespace

inventory file

your inventory seems ok to me, what is your opinion tkuratomi?
have you tried to name your inventory “hosts” and to store it at /etc/ansible ? so you will not have to make the -i thing when you want to run your playbook

have you tried to name your inventory “hosts” and to store it at /etc/ansible ?
so you will not have to make the -i thing when you want to run your playbook

I did not do it.

Which version is now ansible current version for Ubuntu 14.10? Which repositories ansible is now available with latest version?

Are there any fresh ideas? I’m confused, if everything is correct, why does not work?
Which repository can use for upgrade ansible?

Hi,

  • Are your control and target host Linux machines?
  • What happens if you remove the ansible.cfg file?
  • Try to enable settings line by line to find out what the offending line is

Can you post a complete and repeatable version of your:

  • ansible config
  • ansible playbook
  • info on the ansible version
  • exact command line how you call it

That would make things a lot easier. Maybe use a gist or some public place so that people can try and reproduce?

If you can’t publish the exact code try to get it reproduced with some code that can be published

/Martin

Very first line of this inventory file has:

   w This is the default ansible 'hosts' file.

Looks like the "#" was replaced with a "w" at some point. I get the
same error you do until I replace the "w" with a "#".

-Toshio

Very first line of this inventory file has:
w This is the default ansible ‘hosts’ file.
Looks like the “#” was replaced with a “w” at some point. I get the
same error you do until I replace the “w” with a “#”.

I fixed this error. But now a new error:

~# ansible-playbook -i /etc/ansible/inventory /etc/ansible/roles/preconf/tasks/test_new.yml -vvvv
ERROR: Syntax Error while loading YAML script, /etc/ansible/roles/preconf/tasks/test_new.yml
Note: The error may actually appear before this position: line 5, column 8

sudo_user:user
task:
^

my config /etc/ansible/roles/preconf/tasks/test_new.yml