Hi All,

I am trying to achieve mentioning multiple directories in var.yml so that 
in loop i can give them folder permission however it is not working. Can 
anyone help me here.

---
- name: "File List"
hosts: localhost
gather_facts: no
become: yes
become_user: root

tasks:
- include_vars: var.yml
- name: "Folder Permission"
file: 
path: '{{ item }}'
mode: '{{ folder_perm }}'
loop: "{{ folder_path }}"

ignore_errors: true

- name: "File Permission"
file: 
path: '{{ file_path }}'
mode: '{{ file_perm }}'
ignore_errors: true

vars.yml

---

folder_path: 
- /home/sysops/bishwajit/ansible/folder_perm/
- /home/sysops/bishwajit/ansible/demo_perm
- /home/sysops/bishwajit/ansible/sample_perm
file_path: /home/sysops/bishwajit/ansible/folder_perm/file_perm
folder_perm: 0755
file_perm: 0644


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8b8c1fc0-436f-447f-9d78-a847ad77aa90%40googlegroups.com.

Reply via email to