Could you please help me to convert this part of chef cookbook into ansible?
node['my']['domains'].each do |domain|
execute 'install cert' do
command "/root/bin/my_install.sh --domains #{domain}"
not_if { File.exists?("/home/my/#{domain}/fulltext.txt") }
end
end
I tried to play with that:
- name: Check that the fulltext.txt exists
stat:
path: "/home/my/{{ item }}/fulltext.txt"
loop: "{{ my_domains }}"
register: stat_result
- name: install cript
command: "/root/bin/my_install.sh --domains {{ item }}"
loop: "{{ my_domains }}"
when: not stat_result.stat.exists
but without success.
Thanks in advance!