3 local_action: shell /sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6| grep "10" -m 1 |awk '{print $2}'|tr -d "addr:"
8 local_action: yum name=nfs-utils state=present
11 - name: create image directory
12 local_action: file path=/opt/images state=directory mode=0777
15 - name: update nfs config
16 local_action: lineinfile dest=/etc/exports state=present
17 regexp="/opt/images *(rw,insecure,sync,all_squash)"
18 line="/opt/images *(rw,insecure,sync,all_squash)"
21 - name: restart nfs service
22 local_action: service name=nfs state=restarted enabled=yes
25 - name: install nfs comm
26 apt: name=nfs-common state=present
28 - name: get mount info
32 - name: mount image directory
34 mount -t nfs -onfsvers=3 {{ item }}:/opt/images /var/lib/glance/images
35 sed -i '/\/var\/lib\/glance\/images/d' /etc/fstab
36 echo {{ item }}:/opt/images /var/lib/glance/images/ nfs nfsvers=3 >> /etc/fstab
37 when: mount_info.stdout.find('images') == -1