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
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
~# 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
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
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.
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
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?
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