~charmers/charms/precise/swift-storage/trunk

« back to all changes in this revision

Viewing changes to hooks/swift-storage-node-relations

  • Committer: Adam Gandelman
  • Date: 2011-07-22 00:59:07 UTC
  • Revision ID: adamg@canonical.com-20110722005907-ro2gxxteuz120e4c
Format storage as xfs and mount it. Also, fetch ring when built.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
 
set -ue
 
2
# test
 
3
set -u
3
4
FORMULA_DIR=$(dirname $0)
4
5
ARG0=${0##*/}
5
6
 
19
20
    DEBIAN_FRONTEND=noninteractive apt-get -y install $i
20
21
  done
21
22
  [[ ! -d /etc/swift ]] && mkdir /etc/swift
 
23
  chown swift:swift /etc/swift
22
24
  configure_rsyncd
 
25
  setup_storage
23
26
  for i in account container object ; do create_server_conf $i ; done
24
27
  set_swift_hash "TESTINGHASH"
25
28
}
26
29
 
27
30
function proxy_joined {
28
 
  relation-set zone=1
29
 
  relation-set ip=$IP
30
 
  relation-set device=xvde2 
 
31
  relation-set zone=1 hostname=$(hostname -f) device=$DEVICE
31
32
}
32
33
 
33
34
function proxy_changed {
34
35
  URL=`relation-get update_url`
35
36
  [[ -z $URL ]] && exit 0
 
37
  echo "$URL" >>/tmp/url
 
38
  rm -rf /etc/swift/*.gz
 
39
  for i in account object container ; do
 
40
    cd /etc/swift
 
41
    echo "Fetching $URL/$i.ring.gz"
 
42
    wget $URL/$i.ring.gz
 
43
  done
 
44
  chown swift -R /etc/swift
 
45
  swift-init all start
36
46
}
37
47
 
38
48
case $ARG0 in