Removed fuel from Genesis master since fuel has moved to repo fuel.
[genesis.git] / compass / deploy / ansible / roles / glance / tasks / nfs.yml
1 ---
2 - name: get nfs server
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:"
4   register: ip_info
5   run_once: True
6
7 - name: install nfs
8   local_action: yum  name=nfs-utils state=present
9   run_once: True
10
11 - name: create image directory
12   local_action: file path=/opt/images state=directory mode=0777
13   run_once: True
14
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)"
19   run_once: True
20
21 - name: restart nfs service
22   local_action: service name=nfs state=restarted enabled=yes
23   run_once: True
24
25 - name: install nfs comm
26   apt: name=nfs-common state=present
27
28 - name: get mount info
29   command: mount
30   register: mount_info
31
32 - name: mount image directory
33   shell: |
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
38   with_items:
39       ip_info.stdout_lines
40   retries: 5
41   delay: 3