blob: 7866e80844ee95ca522ae779a7cf1cb5bccf6c61 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# #############################################################################
# Copyright (c) 2018 Intel Corp.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# #############################################################################
---
- name: install prerequisites package
apt:
name: "{{ item }}"
state: present
with_items:
- make
- gcc
- name: copy install_ansible script
remote_user: root
copy:
src: install_ansible.sh
dest: /opt/install_ansible.sh
mode: 0777
- name: install ansible
command: su -s /bin/sh -c "/opt/install_ansible.sh"
- name: install ceph-ansible code
remote_user: root
shell: |
cd /opt;
git clone https://github.com/ceph/ceph-ansible.git
- name: fetch stor4nfv source code
remote_user: root
shell: |
mkdir -p $HOME/gopath/src/github.com/stor4nfv && cd $HOME/gopath/src/github.com/stor4nfv;
git clone https://gerrit.opnfv.org/gerrit/stor4nfv.git
- name: copy configure_vars script
remote_user: root
copy:
src: configure_vars.sh
dest: /opt/configure_vars.sh
mode: 0777
- name: configure variables for ceph, opensds
remote_user: root
shell: |
cd /opt;
./configure_vars.sh {{ mgmt_cidr }} {{ external_cidr }}
- name: render ceph inventory
remote_user: root
template:
src: ceph.hosts.j2
dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/group_vars/ceph/ceph.hosts
- name: render opensds, nbp inventory
remote_user: root
template:
src: opensds-nbp.hosts.j2
dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/local.hosts
- name: force to run the second etcd cluster
remote_user: root
lineinfile:
dest: $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible/roles/osdsdb/scenarios/etcd.yml
state: absent
regexp: 'when: service_etcd_status.rc != 0'
- name: run playbook
remote_user: root
shell: |
cd $HOME/gopath/src/github.com/stor4nfv/stor4nfv/ci/ansible;
ansible-playbook site.yml -i local.hosts | tee /var/log/stor4nfv.log
register: stor4nfv_result
- name: export opensds endpoint
remote_user: root
shell: |
export OPENSDS_ENDPOINT=http://127.0.0.1:50040
when: stor4nfv_result|succeeded
|