Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 1 | - name: Ansible repository is available |
| 2 | apt_repository: |
| 3 | repo: 'ppa:ansible/ansible' |
| 4 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 5 | |
Sergio Slobodrian | bcd30b1 | 2017-08-22 22:32:00 -0400 | [diff] [blame] | 6 | - name: Ansible is present |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 7 | apt: |
| 8 | name: ansible |
| 9 | state: latest |
| 10 | force: yes |
| 11 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 12 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 13 | - name: Installer files and directories are copied |
| 14 | synchronize: |
| 15 | src: "{{ cord_home }}/incubator/voltha/{{ item }}" |
| 16 | dest: /home/vinstall |
| 17 | archive: no |
| 18 | owner: no |
| 19 | perms: no |
| 20 | recursive: yes |
| 21 | links: yes |
| 22 | with_items: |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 23 | - install/installer.sh |
| 24 | - install/install.cfg |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 25 | - install/voltha-swarm-start.sh |
| 26 | - install/voltha-swarm-stop.sh |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 27 | - install/get-logs.sh |
Sergio Slobodrian | bcd30b1 | 2017-08-22 22:32:00 -0400 | [diff] [blame] | 28 | - install/get-host-logs.sh |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 29 | - install/ansible |
| 30 | - compose |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 31 | tags: [installer] |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 32 | |
| 33 | - name: Determine if test mode is active |
| 34 | become: false |
| 35 | local_action: stat path="{{ cord_home }}/incubator/voltha/install/.test" |
| 36 | register: file |
| 37 | ignore_errors: true |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 38 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 39 | - name: Test mode file is copied |
| 40 | copy: |
| 41 | src: "{{ cord_home }}/incubator/voltha/install/.test" |
| 42 | dest: /home/vinstall |
| 43 | when: file.stat.exists |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 44 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 45 | - name: The installer is made executable |
| 46 | file: |
| 47 | path: /home/vinstall/installer.sh |
| 48 | mode: 0744 |
| 49 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 50 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 51 | - name: Python docker-py {{ docker_py_version }} package source is available |
| 52 | command: pip download -d /home/vinstall/docker-py "docker-py=={{ docker_py_version }}" |
| 53 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 54 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 55 | - name: Python netifaces {{ netifaces_version }} package source is available |
| 56 | command: pip download -d /home/vinstall/netifaces "netifaces=={{ netifaces_version }}" |
| 57 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 58 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 59 | - name: Deb file directory doesn't exist |
| 60 | file: |
| 61 | path: /home/vinstall/deb_files |
| 62 | state: absent |
| 63 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 64 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 65 | - name: Deb files are saved. |
| 66 | command: cp -r /var/cache/apt/archives /home/vinstall |
| 67 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 68 | |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 69 | - name: Deb file directory is renamed |
| 70 | command: mv /home/vinstall/archives /home/vinstall/deb_files |
| 71 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 72 | |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 73 | - name: Installer directories are owned by vinstall |
| 74 | file: |
| 75 | path: /home/vinstall/{{ item }} |
| 76 | owner: vinstall |
| 77 | group: vinstall |
| 78 | recurse: yes |
| 79 | follow: no |
| 80 | with_items: |
| 81 | - ansible |
| 82 | - compose |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 83 | - .ansible |
| 84 | - deb_files |
| 85 | - docker-py |
| 86 | - netifaces |
| 87 | tags: [installer] |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 88 | |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 89 | - name: Installer files are owned by vinstall |
| 90 | file: |
| 91 | path: /home/vinstall/{{ item }} |
| 92 | owner: vinstall |
| 93 | group: vinstall |
| 94 | follow: no |
| 95 | with_items: |
| 96 | - installer.sh |
| 97 | - install.cfg |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 98 | - voltha-swarm-start.sh |
| 99 | - voltha-swarm-stop.sh |
Sergio Slobodrian | ee417fa | 2017-08-11 09:34:50 -0400 | [diff] [blame] | 100 | - get-logs.sh |
Sergio Slobodrian | bcd30b1 | 2017-08-22 22:32:00 -0400 | [diff] [blame] | 101 | - get-host-logs.sh |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 102 | - docker-compose-Linux-x86_64 |
| 103 | tags: [installer] |