ERROR: Invalid ini entry

1,640 views
Skip to first unread message

Юра Фролов

unread,
Jul 17, 2015, 8:34:01 AM7/17/15
to ansible...@googlegroups.com

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?

Юра Фролов

unread,
Jul 17, 2015, 8:34:01 AM7/17/15
to ansible...@googlegroups.com

I first time configurating ansible. I use ansible-playbook 1.7.2, ubuntu 14.10 (last version in my ubuntu). 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

my inventary file

[testserver]

10.95.46.117 ansible_ssh_port=5555 ansible_ssh_host=10.95.46.117 ansible_ssh_us

and receipt error:

Guillaume Querso

unread,
Jul 17, 2015, 8:58:04 AM7/17/15
to ansible...@googlegroups.com
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

Юра Фролов

unread,
Jul 21, 2015, 3:20:26 AM7/21/15
to ansible...@googlegroups.com
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?


пятница, 17 июля 2015 г., 15:34:01 UTC+3 пользователь Юра Фролов написал:

Юра Фролов

unread,
Jul 21, 2015, 4:04:09 AM7/21/15
to ansible...@googlegroups.com
And one more question. Of what value is said in the error message?

Guillaume Querso

unread,
Jul 21, 2015, 5:12:29 AM7/21/15
to ansible...@googlegroups.com
can you post a version of your playbook? can you ping the port you are targeting? 

Guillaume Querso

unread,
Jul 21, 2015, 5:16:32 AM7/21/15
to ansible...@googlegroups.com
by the way, you should have [testserver:vars] and not [tesserver:vars]

Юра Фролов

unread,
Jul 21, 2015, 6:16:38 AM7/21/15
to ansible...@googlegroups.com
>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 

Guillaume Querso

unread,
Jul 21, 2015, 8:35:52 AM7/21/15
to ansible...@googlegroups.com
i would like to see the content of test_new.yml

Юра Фролов

unread,
Jul 21, 2015, 8:48:07 AM7/21/15
to ansible...@googlegroups.com

---
- host:10.95.46.117
  sudo:True
  sudo_user:user  
   task:
       - name: install freeradius
                apt:pkg=freeradius
       - name: copy config
                copy:src="/etc/ansible/roles/preconf/templates/freeradius" dest="/etc/"
                      owner=root group=freeradius mode=0755
                 notify:
                     - restart freeradius


sudo_user:user  it is user remote PC or user local PC?

Guillaume Querso

unread,
Jul 21, 2015, 9:12:48 AM7/21/15
to ansible...@googlegroups.com
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.. 

Toshio Kuratomi

unread,
Jul 21, 2015, 9:53:12 AM7/21/15
to ansible...@googlegroups.com

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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/36dc39ef-e619-47ad-988e-db63a9a2abb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Юра Фролов

unread,
Jul 22, 2015, 3:49:35 AM7/22/15
to Ansible Project

вторник, 21 июля 2015 г., 16:12:48 UTC+3 пользователь Guillaume Querso написал:
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

Guillaume Querso

unread,
Jul 22, 2015, 4:24:32 AM7/22/15
to Ansible Project
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

Юра Фролов

unread,
Jul 22, 2015, 4:40:21 AM7/22/15
to Ansible Project
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?

Юра Фролов

unread,
Jul 30, 2015, 1:45:34 AM7/30/15
to Ansible Project, pros...@gmail.com
Are there any fresh ideas? I'm confused, if everything is correct, why does not work?
Which repository can use for upgrade ansible?

Martin

unread,
Jul 30, 2015, 4:26:16 AM7/30/15
to Ansible Project, pros...@gmail.com
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


On Thu, Jul 30, 2015 at 7:45 AM Юра Фролов <pros...@gmail.com> wrote:
Are there any fresh ideas? I'm confused, if everything is correct, why does not work?
Which repository can use for upgrade ansible?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

Toshio Kuratomi

unread,
Jul 30, 2015, 4:55:52 PM7/30/15
to ansible...@googlegroups.com
On Wed, Jul 22, 2015 at 12:49 AM, Юра Фролов <pros...@gmail.com> wrote:

>> 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
>
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
Message has been deleted

Юра Фролов

unread,
Jul 31, 2015, 4:04:38 AM7/31/15
to Ansible Project, pros...@gmail.com
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

---
- host:10.95.46.117
  sudo:True
  sudo_user:user
   task:
       - name: install freeradius
                apt:pkg=freeradius
       - name: copy config
                copy:src="/etc/ansible/roles/preconf/templates/freeradius" dest="/etc/"
                      owner=root group=freeradius mode=0755
                 notify:
                     - restart freeradius


# ansible 10.95.46.117 -m ping
ERROR: Invalid ini entry: This - need more than 1 value to unpack

# 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.454 ms

Reply all
Reply to author
Forward
0 new messages