ansible playbook error

161 views
Skip to first unread message

Sandy Hung

unread,
Jan 22, 2020, 4:01:26 AM1/22/20
to Ansible Project
ERROR! unexpected parameter type in action: <class 'ansible.parsing.yaml.objects.AnsibleSequence'>

The error appears to be in '/home/sandy/phpldapadmin.yml': line 8, column 6, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


   - name: install phpopenldap
     ^ here

sandy@test-VirtualBox:~$ sudo vi phpldapadmin.yml
- hosts: all
  remote_user: sandy
  become: true

  tasks:

   - name: install phpopenldap
     apt:
       name: '{{item.name}}'
       state: '{{item.state | default("present")}}'
       purge: yes
     with_items:

      - name: phpldapadmin
      - name: php
      - name: libapache2-mod-php
      - name: mcrypt
      - name: php-mysql

 #   - name: Force certbot to use Python 3
 #    lineinfile:
 #      path: '{{ item }}'
 #      regexp: '^#!/usr/bin/python$'
 #      line: '#!/usr/bin/python3'
 #    with_items:
 #     - /usr/bin/certbot
 #    ignore_errors: yes
 #    failed_when: no

     # - name: stat phpldapadmin
     # stat: path=/var/www/html/
     # register: phpldapadmin_stat

Vivek Kothawale

unread,
Jan 22, 2020, 4:15:27 AM1/22/20
to ansible...@googlegroups.com
Hi Sandy,

The issue is with indentation 
Under tasks you have to give two white space to make it indent 

Try following 


tasks:
  -  name: something

Let me know if you have any issue.

Thanks,
Vivek




--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e1627701-aaa8-42ba-92ce-1703693173d7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages