name: Update apt cahce
apt: update_cache=yes cache_valid_time=3600name: Install NFS Common on FileServer
apt: name={{ item }} state=present
with_items:nfs-common
name: Create webservers directory
file:
path: “{{ item }}”
with_items:/nfs/webserver1
/nfs/webserver2
state: directory
Hello guys while running this ansible playbook to create multiple folders i get error:
“msg”: “The task includes an option with an undefined variable. The error was: ‘item’ is undefined\n\nThe error appears to have been in ‘/home/user/.ansible/roles/mount/tasks/main.yml’: line 10, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create webservers directory\n ^ here\n”
What i am doing wrong?