0

I have used the following variable in ansible playbook as shown below.

---
  - hosts: hosts
    vars:
      vers: 18.7

I am trying to access the value of vers using $ under tasks as shown below

    tasks:
  - name: COpy war file
    copy:
      src: /etc/puppet/warrepo/japp-$ver.war
      dest: /data/dist/app/

But looks like it is not working . Please suggest how to access the value of the variable.

1 Answer 1

1

See Using variables. Correct syntax is

src: "/etc/puppet/warrepo/japp-{{ ver }}.war"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .