# There appears to be both 'k=v' shorthand syntax and YAML in this task.

**URL:** <https://forum.ansible.com/t/there-appears-to-be-both-k-v-shorthand-syntax-and-yaml-in-this-task/32937>\
**Category:** Ansible Project\
**Created:** [May 15, 2020, 10:44am UTC](https://forum.ansible.com/t/there-appears-to-be-both-k-v-shorthand-syntax-and-yaml-in-this-task/32937 "2020-05-15T10:44:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurudatta\_Nadig](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@Gurudatta\_Nadig](https://forum.ansible.com/u/Gurudatta_Nadig)\
**Post date:** [May 15, 2020, 10:44am UTC](https://forum.ansible.com/t/there-appears-to-be-both-k-v-shorthand-syntax-and-yaml-in-this-task/32937/1 "2020-05-15T10:44:28Z")

</div>

Good day all,

I am new to Ansible, I am getting the following error while running a playbook any pointer ?

ansible 2.8.4

**There appears to be both ‘k=v’ shorthand syntax and YAML in this task. Only one syntax may be used.**  
**This error can be suppressed as a warning using the "invalid\_task\_a** ttribute\_failed" configuration

- name: “Create multiple directories”  
file: path={{item}} state=directory  
with\_items:
- ‘/opt/services/tomcat/webapps/searchhub’
- ‘/tmp/searchhub’
- name: Copy the war  
**copy: src=/home/searchhub.war dest=/tmp/ owner=tomcat group=tomcat mode=0755**
- name: “Change the ownership of the folder and Extract the war file to searchhub”  
shell: “/usr/bin/unzip -q -o -d /opt/services/tomcat/webapps/searchhub /tmp/searchhub.war”

become: yes

Regards  
Gurudatta N.R

---

<div class="post-metadata">

**Author:** ![Michael\_M1](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Michael\_M1](https://forum.ansible.com/u/Michael_M1)\
**Post date:** [May 15, 2020, 3:22pm UTC](https://forum.ansible.com/t/there-appears-to-be-both-k-v-shorthand-syntax-and-yaml-in-this-task/32937/2 "2020-05-15T15:22:30Z")

</div>

Hi Gurudatta,

As the error suggests, you have to use _either_ ‘k=v’ syntax throughout the playbook or yaml throughout the playbook. More recent conventions suggest using yaml, so try this.

- name: “Create multiple directories”  
file:  
path: {{item}}  
state: directory  
with\_items:
- ‘/opt/services/tomcat/webapps/searchhub’
- ‘/tmp/searchhub’
- name: Copy the war  
**copy:**  
**src: /home/searchhub.war**  
**dest: /tmp/**  
**owner:**  **tomcat**  
**group: tomcat**  
**mode: 0755**
- name: “Change the ownership of the folder and Extract the war file to searchhub”  
shell: “/usr/bin/unzip -q -o -d /opt/services/tomcat/webapps/searchhub /tmp/searchhub.war”

become: yes

---

<div class="post-metadata">

**Author:** ![Gurudatta\_Nadig](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@Gurudatta\_Nadig](https://forum.ansible.com/u/Gurudatta_Nadig)\
**Post date:** [May 15, 2020, 5:30pm UTC](https://forum.ansible.com/t/there-appears-to-be-both-k-v-shorthand-syntax-and-yaml-in-this-task/32937/3 "2020-05-15T17:30:30Z")

</div>

### Thank you Michael, For your timely help.### RegardsGurudatta N.R

---

<div class="post-metadata">

**Author:** ![Adam\_Morris](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Adam\_Morris](https://forum.ansible.com/u/Adam_Morris)\
**Post date:** [May 16, 2020, 5:04pm UTC](https://forum.ansible.com/t/there-appears-to-be-both-k-v-shorthand-syntax-and-yaml-in-this-task/32937/4 "2020-05-16T17:04:35Z")

</div>

There also appears to be some issues with the indentation, although that could be an artifact of mail.

The tasks look like they are in k=v syntax, but if the following -name is indented it could be considered part of the same task.
