# ERROR: Invalid ini entry

**URL:** <https://forum.ansible.com/t/error-invalid-ini-entry/18794>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [July 17, 2015, 7:02am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794 "2015-07-17T07:02:25Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 17, 2015, 7:02am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/1 "2015-07-17T07:02:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 17, 2015, 12:58pm UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/2 "2015-07-17T12:58:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 21, 2015, 7:20am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/3 "2015-07-21T07:20:26Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 21, 2015, 8:04am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/4 "2015-07-21T08:04:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 21, 2015, 9:12am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/5 "2015-07-21T09:12:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 21, 2015, 9:16am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/6 "2015-07-21T09:16:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 21, 2015, 10:16am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/7 "2015-07-21T10:16:38Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 21, 2015, 12:35pm UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/8 "2015-07-21T12:35:51Z")

</div>

i would like to see the content of test\_new.yml

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 21, 2015, 12:48pm UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/9 "2015-07-21T12:48:07Z")

</div>



---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 21, 2015, 1:12pm UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/10 "2015-07-21T13:12:48Z")

</div>

As suggested by the documentation ( [http://docs.ansible.com/ansible/intro\_configuration.html#sudo-user](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…

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [July 21, 2015, 1:53pm UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/11 "2015-07-21T13:53:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 22, 2015, 7:49am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/12 "2015-07-22T07:49:35Z")

</div>

> As suggested by the documentation ( [http://docs.ansible.com/ansible/intro\_configuration.html#sudo-user](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](https://sites.google.com/site/vrnunit/inventory)

---

<div class="post-metadata">

**Author:** ![Guillaume\_Querso](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@Guillaume\_Querso](https://forum.ansible.com/u/Guillaume_Querso)\
**Post date:** [July 22, 2015, 8:24am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/13 "2015-07-22T08:24:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 22, 2015, 8:40am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/14 "2015-07-22T08:40:21Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 30, 2015, 5:45am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/15 "2015-07-30T05:45:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Martin2](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@Martin2](https://forum.ansible.com/u/Martin2)\
**Post date:** [July 30, 2015, 8:25am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/16 "2015-07-30T08:25:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [July 30, 2015, 8:55pm UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/17 "2015-07-30T20:55:39Z")

</div>

Very first line of this inventory file has:

&nbsp;&nbsp;&nbsp;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

---

<div class="post-metadata">

**Author:** ![user93](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user93](https://forum.ansible.com/u/user93)\
**Post date:** [July 31, 2015, 8:04am UTC](https://forum.ansible.com/t/error-invalid-ini-entry/18794/18 "2015-07-31T08:04:38Z")

</div>

> 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
