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