2 # If we can't get golang installed before any module is used we will fail
\r
3 # so just try what we can to get it installed
\r
4 - name: check for golang
\r
8 register: systemgolang
\r
10 - name: install golang for debian based systems
\r
16 wget {{ golang_download_url }} -P /opt/
\r
17 tar xvf /opt/{{ golang_tarball }} -C /usr/local/
\r
18 cat >> /etc/profile <<GOLANG__CONFIG_DOC
\r
19 export GOROOT=/usr/local/go
\r
20 export GOPATH=\$HOME/gopath
\r
21 export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin
\r
24 executable: /bin/bash
\r
27 - systemgolang.stat.exists is undefined or systemgolang.stat.exists == false
\r
29 - name: Run the equivalent of "apt-get update" as a separate step
\r
33 - name: install librados-dev external package
\r
37 - name: install librbd-dev external package
\r
41 - name: check for opensds source code existed
\r
43 path: "{{ opensds_root_dir }}"
\r
45 register: opensdsexisted
\r
47 - name: download opensds source code
\r
49 repo: "{{ remote_url }}"
\r
50 dest: "{{ opensds_root_dir }}"
\r
52 - opensdsexisted.stat.exists is undefined or opensdsexisted.stat.exists == false
\r
54 - name: check for opensds binary file existed
\r
56 path: "{{ opensds_build_dir }}"
\r
58 register: opensdsbuilt
\r
60 - name: build opensds binary file
\r
61 shell: . /etc/profile; make
\r
63 chdir: "{{ opensds_root_dir }}"
\r
65 - opensdsbuilt.stat.exists is undefined or opensdsbuilt.stat.exists == false
\r
67 - name: create opensds global config directory if it doesn't exist
\r
69 path: "{{ opensds_config_dir }}/driver"
\r
73 - name: create opensds log directory if it doesn't exist
\r
75 path: "{{ opensds_log_dir }}"
\r
79 - name: configure opensds global info
\r
81 cat > opensds.conf <<OPENSDS_GLOABL_CONFIG_DOC
\r
83 api_endpoint = {{ controller_endpoint }}
\r
85 log_file = {{ controller_log_file }}
\r
89 api_endpoint = {{ dock_endpoint }}
\r
90 log_file = {{ dock_log_file }}
\r
91 # Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
\r
92 enabled_backends = {{ enabled_backend }}
\r
95 name = {{ lvm_name }}
\r
96 description = {{ lvm_description }}
\r
97 driver_name = {{ lvm_driver_name }}
\r
98 config_path = {{ lvm_config_path }}
\r
101 name = {{ ceph_name }}
\r
102 description = {{ ceph_description }}
\r
103 driver_name = {{ ceph_driver_name }}
\r
104 config_path = {{ ceph_config_path }}
\r
107 name = {{ cinder_name }}
\r
108 description = {{ cinder_description }}
\r
109 driver_name = {{ cinder_driver_name }}
\r
110 config_path = {{ cinder_config_path }}
\r
113 endpoint = {{ db_endpoint }}
\r
114 driver = {{ db_driver }}
\r
116 chdir: "{{ opensds_config_dir }}"
\r
119 - name: copy opensds lvm backend file if specify lvm backend
\r
121 src: ../../../group_vars/lvm/lvm.yaml
\r
122 dest: "{{ lvm_config_path }}"
\r
123 when: enabled_backend == "lvm"
\r
125 - name: copy opensds ceph backend file if specify ceph backend
\r
127 src: ../../../group_vars/ceph/ceph.yaml
\r
128 dest: "{{ ceph_config_path }}"
\r
129 when: enabled_backend == "ceph"
\r
131 - name: copy opensds cinder backend file if specify cinder backend
\r
133 src: ../../../group_vars/cinder/cinder.yaml
\r
134 dest: "{{ cinder_config_path }}"
\r
135 when: enabled_backend == "cinder"
\r