blob: d1648f5de62e2862d8cf7f486e6a0c9539bb9b45 [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 Slobodrian36e16552017-06-19 11:00:45 -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"
49# tags: [cluster_host]
50
Sergio Slobodrianc5477712017-06-07 11:56:56 -040051- name: Required configuration directories are copied
Sergio Slobodrian36e16552017-06-19 11:00:45 -040052 synchronize:
Sergio Slobodrianc5477712017-06-07 11:56:56 -040053 src: "/home/vinstall/{{ item }}"
54 dest: "{{ target_voltha_home }}"
Sergio Slobodrian36e16552017-06-19 11:00:45 -040055 archive: no
56 owner: no
57 perms: no
58 recursive: yes
59 links: yes
Sergio Slobodrianc5477712017-06-07 11:56:56 -040060 with_items:
61 - docker-py
62 - netifaces
63 - deb_files
Sergio Slobodrian36e16552017-06-19 11:00:45 -040064 tags: [cluster-host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040065
Sergio Slobodrian7c483622017-06-13 15:51:34 -040066- name: apt lists are up-to-date
67 copy:
68 src: "/var/lib/apt/lists"
69 dest: "/var/lib/apt"
70 tags: [cluster_host]
71
Sergio Slobodrianc5477712017-06-07 11:56:56 -040072- name: Dependent software is installed
73 command: dpkg -i "{{ target_voltha_home }}/deb_files/{{ item }}"
74 with_items: "{{ deb_files }}"
75 when: target == "cluster"
76 ignore_errors: true
77 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040078 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040079
80- name: Dependent software is initialized
81 command: apt-get -f install
82 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040083 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040084
Sergio Slobodriand24189e2017-06-10 23:27:15 -040085- name: Python packages are installed
Sergio Slobodrianc5477712017-06-07 11:56:56 -040086 command: pip install {{ item }} --no-index --find-links "file://{{ target_voltha_home }}/{{ item }}"
87 with_items:
88 - docker-py
89 - netifaces
90 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -040091 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -040092
93- name: Configuration directories are deleted
94 file:
95 path: "{{ target_voltha_home }}/{{ item }}"
96 state: absent
97 with_items:
98 - docker-py
99 - netifaces
100 - deb_files
101 when: target == "cluster"
Sergio Slobodriand24189e2017-06-10 23:27:15 -0400102 tags: [cluster_host]
Sergio Slobodrianc5477712017-06-07 11:56:56 -0400103