0

I run this in a ansible playbook for copy files from the directory "templates" of the ansible role and I get error...

- name:  "Copy templates"
templates: src={{item.src}} dest={{item.dest}}
with_items:
    - { src: 'tpl1', dest: '/etc/tpl1' }
    - { src: 'tpl2', dest: '/etc/tpl2' }
    - { src: 'tpl3', dest: '/etc/tpl3' }

Error Output:

ERROR! couldn't resolve module/action 'templates'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/myuser/Desktop/mydir/roles/rolename/tasks/main.yml': line 73, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name:  "Copy templates"
^ here

Can you help me?

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
bluesky
  • 1
  • 2

1 Answers1

1

The module is named template, not templates.

- name: "Copy templates"
  template:
    src="{{item.src}}"
    dest="{{item.dest}}"
Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89