blob: c56de6bfc50daf145bf78d13e75ad70045ee6aca [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040014- name: Ansible repository is available
15 apt_repository:
16 repo: 'ppa:ansible/ansible'
17 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040018
Sergio Slobodrianbcd30b12017-08-22 22:32:00 -040019- name: Ansible is present
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040020 apt:
21 name: ansible
22 state: latest
23 force: yes
24 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040025
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040026- name: Installer files and directories are copied
27 synchronize:
28 src: "{{ cord_home }}/incubator/voltha/{{ item }}"
29 dest: /home/vinstall
30 archive: no
31 owner: no
32 perms: no
33 recursive: yes
34 links: yes
35 with_items:
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040036 - install/installer.sh
37 - install/install.cfg
Sergio Slobodriancab0a392017-07-13 08:42:10 -040038 - install/voltha-swarm-start.sh
39 - install/voltha-swarm-stop.sh
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040040 - install/get-logs.sh
Sergio Slobodrianbcd30b12017-08-22 22:32:00 -040041 - install/get-host-logs.sh
Sergio Slobodrian86843702017-09-05 23:22:39 -040042 - install/sort_packages.sh
43 - install/sort_packages.py
44 - install/install_packages.sh
Sergio Slobodrianb09ba702017-11-02 15:43:35 -040045 - install/BashLoginTarget.sh
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040046 - install/ansible
47 - compose
Stephane Barbarie2cbffca2018-03-26 16:20:03 -040048 - k8s
Sergio Slobodriand49da362017-08-24 16:54:53 -040049 - consul_config/basic.json
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040050 tags: [installer]
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040051
52- name: Determine if test mode is active
53 become: false
54 local_action: stat path="{{ cord_home }}/incubator/voltha/install/.test"
55 register: file
56 ignore_errors: true
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040057
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040058- name: Test mode file is copied
59 copy:
60 src: "{{ cord_home }}/incubator/voltha/install/.test"
61 dest: /home/vinstall
62 when: file.stat.exists
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040063
Sergio Slobodrian86843702017-09-05 23:22:39 -040064- name: The installer scripts are made executable
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040065 file:
Sergio Slobodrian86843702017-09-05 23:22:39 -040066 path: "/home/vinstall/{{ item }}"
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040067 mode: 0744
Sergio Slobodrian86843702017-09-05 23:22:39 -040068 with_items:
69 - installer.sh
70 - sort_packages.sh
71 - sort_packages.py
72 - install_packages.sh
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040073 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040074
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040075- name: Python docker-py {{ docker_py_version }} package source is available
76 command: pip download -d /home/vinstall/docker-py "docker-py=={{ docker_py_version }}"
77 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040078
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040079- name: Python netifaces {{ netifaces_version }} package source is available
80 command: pip download -d /home/vinstall/netifaces "netifaces=={{ netifaces_version }}"
81 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040082
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040083- name: Deb file directory doesn't exist
84 file:
85 path: /home/vinstall/deb_files
86 state: absent
87 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040088
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040089- name: Deb files are saved.
90 command: cp -r /var/cache/apt/archives /home/vinstall
91 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040092
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040093- name: Deb file directory is renamed
94 command: mv /home/vinstall/archives /home/vinstall/deb_files
95 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -040096
Sergio Slobodrian5727e982017-06-28 21:02:27 -040097- name: Installer directories are owned by vinstall
98 file:
99 path: /home/vinstall/{{ item }}
100 owner: vinstall
101 group: vinstall
102 recurse: yes
103 follow: no
104 with_items:
105 - ansible
106 - compose
Sergio Slobodrian5727e982017-06-28 21:02:27 -0400107 - .ansible
108 - deb_files
109 - docker-py
110 - netifaces
111 tags: [installer]
Sergio Slobodrianee417fa2017-08-11 09:34:50 -0400112
Sergio Slobodrian5727e982017-06-28 21:02:27 -0400113- name: Installer files are owned by vinstall
114 file:
115 path: /home/vinstall/{{ item }}
116 owner: vinstall
117 group: vinstall
118 follow: no
119 with_items:
120 - installer.sh
121 - install.cfg
Sergio Slobodriancab0a392017-07-13 08:42:10 -0400122 - voltha-swarm-start.sh
123 - voltha-swarm-stop.sh
Sergio Slobodrianee417fa2017-08-11 09:34:50 -0400124 - get-logs.sh
Sergio Slobodrianbcd30b12017-08-22 22:32:00 -0400125 - get-host-logs.sh
Sergio Slobodrian5727e982017-06-28 21:02:27 -0400126 - docker-compose-Linux-x86_64
127 tags: [installer]