blob: b5b7afa582ff33757e105990ba1a007cda0173cc [file] [log] [blame]
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -04001- 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:
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040034 - install/installer.sh
35 - install/install.cfg
Sergio Slobodriancab0a392017-07-13 08:42:10 -040036 - install/voltha-swarm-start.sh
37 - install/voltha-swarm-stop.sh
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040038 - install/ansible
39 - compose
40 - nginx_config
Sergio Slobodriancab0a392017-07-13 08:42:10 -040041 - envoy
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040042 tags: [installer]
Sergio Slobodrianba9cbd82017-06-22 11:45:49 -040043
44- name: Determine if test mode is active
45 become: false
46 local_action: stat path="{{ cord_home }}/incubator/voltha/install/.test"
47 register: file
48 ignore_errors: true
49- name: Test mode file is copied
50 copy:
51 src: "{{ cord_home }}/incubator/voltha/install/.test"
52 dest: /home/vinstall
53 when: file.stat.exists
54- name: The installer is made executable
55 file:
56 path: /home/vinstall/installer.sh
57 mode: 0744
58 tags: [installer]
59- name: Python docker-py {{ docker_py_version }} package source is available
60 command: pip download -d /home/vinstall/docker-py "docker-py=={{ docker_py_version }}"
61 tags: [installer]
62- name: Python netifaces {{ netifaces_version }} package source is available
63 command: pip download -d /home/vinstall/netifaces "netifaces=={{ netifaces_version }}"
64 tags: [installer]
65- name: Deb file directory doesn't exist
66 file:
67 path: /home/vinstall/deb_files
68 state: absent
69 tags: [installer]
70- name: Deb files are saved.
71 command: cp -r /var/cache/apt/archives /home/vinstall
72 tags: [installer]
73- name: Deb file directory is renamed
74 command: mv /home/vinstall/archives /home/vinstall/deb_files
75 tags: [installer]
Sergio Slobodrian5727e982017-06-28 21:02:27 -040076- name: Installer directories are owned by vinstall
77 file:
78 path: /home/vinstall/{{ item }}
79 owner: vinstall
80 group: vinstall
81 recurse: yes
82 follow: no
83 with_items:
84 - ansible
85 - compose
86 - nginx_config
87 - .ansible
88 - deb_files
89 - docker-py
90 - netifaces
Sergio Slobodriancab0a392017-07-13 08:42:10 -040091 - envoy
Sergio Slobodrian5727e982017-06-28 21:02:27 -040092 tags: [installer]
93- name: Installer files are owned by vinstall
94 file:
95 path: /home/vinstall/{{ item }}
96 owner: vinstall
97 group: vinstall
98 follow: no
99 with_items:
100 - installer.sh
101 - install.cfg
Sergio Slobodriancab0a392017-07-13 08:42:10 -0400102 - voltha-swarm-start.sh
103 - voltha-swarm-stop.sh
Sergio Slobodrian5727e982017-06-28 21:02:27 -0400104 - docker-compose-Linux-x86_64
105 tags: [installer]