pushd /
for i in \
/etc/ipsec* \
/home \
/root \
do
[[ -r $i ]] || continue
[[ -L $i ]] && continue
dst_dir=$(readlink -m /protected$(dirname $i))
dst_name="${dst_dir}/$(basename $i)"
mkdir -p $dst_dir
rsync -a $i $dst_dir && rm -rf $i && ln -s $dst_name $i
ls -ld $i
done
popd
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a29d1d41-ffd3-40e9-8cc4-a4a891e443c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- name: Getting files stats
stat: path={{ item }}
register: st
with_items:
- /etc/asterisk
- /etc/bind
- /etc/GeoIP.conf
- /etc/iptables
- /etc/jabber
- /etc/monit
- /etc/mysql
- /etc/nginx
- /etc/postfix
- /etc/ppp
- /etc/snmp
- /etc/sphinx
- /etc/xl2tpd
- name: Moving on
debug: msg="doing something with {{ item.item }}"
when:
- item.stat.exists == true
- item.stat.islnk != true
with_items: st.results
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2c6b7061-c9c5-4712-8088-13e6943ae4a9%40googlegroups.com.