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