Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 1 | # 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 Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 14 | - name: Ansible repository is available |
| 15 | apt_repository: |
| 16 | repo: 'ppa:ansible/ansible' |
| 17 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 18 | |
Sergio Slobodrian | bcd30b1 | 2017-08-22 22:32:00 -0400 | [diff] [blame] | 19 | - name: Ansible is present |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 20 | apt: |
| 21 | name: ansible |
| 22 | state: latest |
| 23 | force: yes |
| 24 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 25 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 26 | - 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 Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 36 | - install/installer.sh |
| 37 | - install/install.cfg |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 38 | - install/voltha-swarm-start.sh |
| 39 | - install/voltha-swarm-stop.sh |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 40 | - install/get-logs.sh |
Sergio Slobodrian | bcd30b1 | 2017-08-22 22:32:00 -0400 | [diff] [blame] | 41 | - install/get-host-logs.sh |
Sergio Slobodrian | 8684370 | 2017-09-05 23:22:39 -0400 | [diff] [blame] | 42 | - install/sort_packages.sh |
| 43 | - install/sort_packages.py |
| 44 | - install/install_packages.sh |
Sergio Slobodrian | b09ba70 | 2017-11-02 15:43:35 -0400 | [diff] [blame] | 45 | - install/BashLoginTarget.sh |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 46 | - install/ansible |
| 47 | - compose |
Stephane Barbarie | 2cbffca | 2018-03-26 16:20:03 -0400 | [diff] [blame] | 48 | - k8s |
Sergio Slobodrian | d49da36 | 2017-08-24 16:54:53 -0400 | [diff] [blame] | 49 | - consul_config/basic.json |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 50 | tags: [installer] |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 51 | |
| 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 Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 57 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 58 | - 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 Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 63 | |
Sergio Slobodrian | 8684370 | 2017-09-05 23:22:39 -0400 | [diff] [blame] | 64 | - name: The installer scripts are made executable |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 65 | file: |
Sergio Slobodrian | 8684370 | 2017-09-05 23:22:39 -0400 | [diff] [blame] | 66 | path: "/home/vinstall/{{ item }}" |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 67 | mode: 0744 |
Sergio Slobodrian | 8684370 | 2017-09-05 23:22:39 -0400 | [diff] [blame] | 68 | with_items: |
| 69 | - installer.sh |
| 70 | - sort_packages.sh |
| 71 | - sort_packages.py |
| 72 | - install_packages.sh |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 73 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 74 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 75 | - 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 Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 78 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 79 | - name: Python netifaces {{ netifaces_version }} package source is available |
| 80 | command: pip download -d /home/vinstall/netifaces "netifaces=={{ netifaces_version }}" |
| 81 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 82 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 83 | - name: Deb file directory doesn't exist |
| 84 | file: |
| 85 | path: /home/vinstall/deb_files |
| 86 | state: absent |
| 87 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 88 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 89 | - name: Deb files are saved. |
| 90 | command: cp -r /var/cache/apt/archives /home/vinstall |
| 91 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 92 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 93 | - name: Deb file directory is renamed |
| 94 | command: mv /home/vinstall/archives /home/vinstall/deb_files |
| 95 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 96 | |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 97 | - 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 Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 107 | - .ansible |
| 108 | - deb_files |
| 109 | - docker-py |
| 110 | - netifaces |
| 111 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 112 | |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 113 | - 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 Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 122 | - voltha-swarm-start.sh |
| 123 | - voltha-swarm-stop.sh |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 124 | - get-logs.sh |
Sergio Slobodrian | bcd30b1 | 2017-08-22 22:32:00 -0400 | [diff] [blame] | 125 | - get-host-logs.sh |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 126 | - docker-compose-Linux-x86_64 |
| 127 | tags: [installer] |