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