Concatenate strings and variables.

27 views
Skip to first unread message

Sharwari Phadnis

unread,
Oct 15, 2015, 5:26:34 AM10/15/15
to Ansible Project
I want to concat strings and variables imported from a yml file. For example:

---
- hosts: localhost
  vars_files:
      - config.yml
  tasks:
     - uri:
          url: "https://url/to/dest/server"
          method: POST
          body: '{"key1":"value1","key2":"value2" }'
          user: "abc"
          password: "xyz"
          return_content: yes
          HEADER_Content-Type: "application/json"


In the value1 field I want to substitute a variable {{var1}}="12234" which is imported from config.yml. So how can I substitute it?
Reply all
Reply to author
Forward
0 new messages