blob: b9b2146b2b873f8b55992356e2f018f45b9c8985 [file] [log] [blame]
Sergio Slobodrianc5477712017-06-07 11:56:56 -04001# Note: When the target == "cluster" the installer
2# is running to install voltha in the cluster hosts.
3# Whe the target == "installer" the installer is being
4# created.
Sergio Slobodriand24189e2017-06-10 23:27:15 -04005- name: A .ssh directory for the voltha user exists
6 file:
7 #path: "{{ ansible_env['HOME'] }}/.ssh"
8 path: "/home/voltha/.ssh"
9 state: directory
10 owner: voltha
11 group: voltha
12 tags: [cluster_host]
13
14- name: known_hosts file is absent for the voltha user
15 file:
16 path: "/home/voltha/.ssh/known_hosts"
17 state: absent
18 tags: [cluster_host]
19
20- name: Known host checking is disabled
21 copy:
22 src: files/ssh_config
23 dest: "/home/voltha/.ssh/config"
24 owner: voltha
25 group: voltha
26 mode: 0600
27 tags: [cluster_host]
28
29- name: Cluster host keys are propagated to all hosts in the cluster
30 copy:
31 src: files/.keys
32 dest: "/home/voltha"
33 owner: voltha
34 group: voltha
35 mode: 0600
36 tags: [cluster_host]
37
Sergio Slobodrianc5477712017-06-07 11:56:56 -040038- name: Required configuration directories are copied
39 copy:
40 src: "/home/vinstall/{{ item }}"
41 dest: "{{ target_voltha_home }}"
42 owner: voltha
43 group: voltha
44 with_items:
45 - docker-py
46 - netifaces
47 - deb_files
48 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040049 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040050
Sergio Slobodrian7c483622017-06-13 15:51:34 -040051- name: apt lists are up-to-date
52 copy:
53 src: "/var/lib/apt/lists"
54 dest: "/var/lib/apt"
55 tags: [cluster_host]
56
Sergio Slobodrianc5477712017-06-07 11:56:56 -040057- name: Dependent software is installed
58 command: dpkg -i "{{ target_voltha_home }}/deb_files/{{ item }}"
59 with_items: "{{ deb_files }}"
60 when: target == "cluster"
61 ignore_errors: true
62 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040063 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040064
65- name: Dependent software is initialized
66 command: apt-get -f install
67 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040068 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040069
Sergio Slobodriand24189e2017-06-10 23:27:15 -040070- name: Python packages are installed
Sergio Slobodrianc5477712017-06-07 11:56:56 -040071 command: pip install {{ item }} --no-index --find-links "file://{{ target_voltha_home }}/{{ item }}"
72 with_items:
73 - docker-py
74 - netifaces
75 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040076 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040077
78- name: Configuration directories are deleted
79 file:
80 path: "{{ target_voltha_home }}/{{ item }}"
81 state: absent
82 with_items:
83 - docker-py
84 - netifaces
85 - deb_files
86 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040087 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040088