# String concatenation whith stdout under with\_items

**URL:** <https://forum.ansible.com/t/string-concatenation-whith-stdout-under-with-items/29981>\
**Category:** Ansible Project\
**Created:** [March 25, 2019, 6:06pm UTC](https://forum.ansible.com/t/string-concatenation-whith-stdout-under-with-items/29981 "2019-03-25T18:06:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vino\_B](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vino\_B](https://forum.ansible.com/u/Vino_B)\
**Post date:** [March 25, 2019, 6:06pm UTC](https://forum.ansible.com/t/string-concatenation-whith-stdout-under-with-items/29981/1 "2019-03-25T18:06:19Z")

</div>

Hi All,

Request your help with string concatenation whith stdout under with\_items.

- name: \_List Name  
shell: (sysls -l)  
register: sys\_list  
ignore\_errors: true

- name: check System Type  
shell: (systype -t {{item.s}}|awk ‘{if ($3 == “not”) {print “FAILED :{{item.s}} is not set”} else {print “OK :{{item.s}} is set”}}’)

with\_items:

- { s: “{{ sys\_list.stdout\_lines + ["t1.dev.com"] }}” }
- { s: “{{ sys\_list.stdout\_lines + ["t1.dev.s1.com"] }}” }

Note:  
sys\_list.stdout\_lines : contains the string “axe”

systype -t [axe.t1.dev.com](http://axe.t1.dev.com) |awk ‘{if ($3 == “not”) {print “FAILED :{{item.s}} is not set”} else {print “OK :{{item.s}} is set”}}’  
systype -t [axe.t1.dev.s1.com](http://axe.t1.dev.s1.com) |awk ‘{if ($3 == “not”) {print “FAILED :{{item.s}} is not set”} else {print “OK :{{item.s}} is set”}}’

Issue:

The above code is interpreting as below with square bracket and considering as 2 separate variables as below

V1: [axe] V2: [t1.dev.com](http://t1.dev.com)  
V1:[axe] V2: [1.dev.s1.com](http://1.dev.s1.com)

systype -t [axe],‘[t1.dev.com](http://t1.dev.com)’ |awk ‘{if ($3 == “not”) {print “FAILED :{{item.s}} is not set”} else {print “OK :{{item.s}} is set”}}’  
systype -t [axe],‘[t1.dev.s1.com](http://t1.dev.s1.com)’ |awk ‘{if ($3 == “not”) {print “FAILED :{{item.s}} is not set”} else {print “OK :{{item.s}} is set”}}’

From,  
Vino.B
