# ansible error message

**URL:** <https://forum.ansible.com/t/ansible-error-message/32018>\
**Category:** Ansible Project\
**Created:** [January 21, 2020, 9:09am UTC](https://forum.ansible.com/t/ansible-error-message/32018 "2020-01-21T09:09:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandy.hung](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sandy.hung](https://forum.ansible.com/u/sandy.hung)\
**Post date:** [January 21, 2020, 9:09am UTC](https://forum.ansible.com/t/ansible-error-message/32018/1 "2020-01-21T09:09:16Z")

</div>

Dear All:

I don’t know this error is?  
can hlep me thanks.

ERROR! conflicting action statements: lineinfile, roles

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

The offending line appears to be:

- name: Force certbot to use Python3  
^ here

- name: Force certbot to use Python3  
lineinfile:  
path: ‘{{ item }}’  
regexp: ‘^#!/usr/bin/python$’  
line: ‘#!/usr/bin/python3’  
with\_items:

- /usr/local/bin/certbot

- /user/bin/certbot  
ignore\_errors: yes  
failed\_when: no

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [January 21, 2020, 9:23am UTC](https://forum.ansible.com/t/ansible-error-message/32018/2 "2020-01-21T09:23:54Z")

</div>

> Dear All:
> 
> I don't know this error is?  
> can hlep me thanks.
> 
> ERROR! conflicting action statements: lineinfile, roles
> 
> The error appears to be in '/home/sandy/phpldapadmin.yml': line 54, column 6, but may  
> be elsewhere in the file depending on the exact syntax problem.
> 
> The offending line appears to be:
> 
> - name: Force certbot to use Python3  
> ^ here
> 
> - name: Force certbot to use Python3  
> lineinfile:  
> path: '{{ item }}'  
> regexp: '^#!/usr/bin/python$'  
> line: '#!/usr/bin/python3'  
> with\_items:  
> - /usr/local/bin/certbot  
> - /user/bin/certbot  
> ignore\_errors: yes  
> failed\_when: no

Please show your complete playbook, especially the part where "roles" appears.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![sandy.hung](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sandy.hung](https://forum.ansible.com/u/sandy.hung)\
**Post date:** [January 21, 2020, 9:34am UTC](https://forum.ansible.com/t/ansible-error-message/32018/3 "2020-01-21T09:34:34Z")

</div>



---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [January 21, 2020, 9:52am UTC](https://forum.ansible.com/t/ansible-error-message/32018/4 "2020-01-21T09:52:02Z")

</div>

> ---  
> - hosts: all  
> remote\_user: sandy  
> become: true
> 
> tasks:
> 
> - name: install phpldapadmin  
> apt: name=phpldapadmin update\_cache=yes
> 
> - name: install phpopenldap  
> apt:  
> name: '{{item.name}}'  
> state: '{{item.state | default("present")}}'  
> purge: yes  
> with\_items:
> 
> ```
> \- 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/local/bin/certbot  
> - /usr/bin/certbot  
> ignore\_errors: yes  
> failed\_when: no
> 
> - name: stat phpldapadmin  
> stat: path=/var/www/html/  
> register: phpldapadmin\_stat
> 
> - name: Move phpldapadmin  
> shell: mv /var/www/html/ /var/www/html/  
> when: phpldapadmin\_stat.stat.exists
> 
> ```
> vars:
> certbot\_generate\_certificates: true
> certbot\_register\_email: xxxx@xxxx\.com
> certbot\_certificate\_domains:
> \- xxxxx\.com
> 
> roles:
> \- \{role: certbot\-apache, become: yes \}
> \- role: letsencrypt
> letsencrypt\_webroot\_pah: /var/www/html
> letsencrypt\_email: xxxx@xxxx\.com
> letsencrypt\_cert\_domains:
> \- ldaptest\.xxx\.com
> \- xxx\.com
> letsencrypt\_renewal\_command\_args: &#39;\-\-renew\-hook &quot;systemctl restart apache&quot;&#39;
> 
> ```

Use include\_role or import\_role.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [January 21, 2020, 10:09am UTC](https://forum.ansible.com/t/ansible-error-message/32018/5 "2020-01-21T10:09:01Z")

</div>

Syntax is wrong. Indentation and placement of 'vars' and 'roles' is wrong.  
See "Working With Playbooks"  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks.html#working-with-playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html#working-with-playbooks)

&nbsp;&nbsp;-vlado
