blob: db35acfaac34972af9f91ea861b6e85abee0ced7 [file] [log] [blame]
Stephane Barbariebcea2f42018-03-02 18:46:32 -05001# 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.
5- name: VOLT-HA Config | The environment is properly set on login
6 template:
7 src: bashrc.j2
8 dest: "{{ target_voltha_home }}/.bashrc"
9 owner: voltha
10 group: voltha
11 mode: "u=rw,g=r,o=r"
12 when: target == "cluster"
13 tags: [voltha]
14
15- name: VOLT-HA Config | The .bashrc file is executed on ssh login
16 template:
17 src: bash_profile.j2
18 dest: "{{ target_voltha_home }}/.bash_profile"
19 owner: voltha
20 group: voltha
21 mode: "u=rw,g=r,o=r"
22 when: target == "cluster"
23 tags: [voltha]
24
25- name: VOLT-HA Config | Required directory exists
26 file:
Stephane Barbarie2cbffca2018-03-26 16:20:03 -040027 path: "{{ target_voltha_home }}"
Stephane Barbariebcea2f42018-03-02 18:46:32 -050028 state: directory
29 owner: voltha
30 group: voltha
31 when: target == "cluster"
32 tags: [voltha]
33
34- name: VOLT-HA Config | Configuration files and directories are copied
35 synchronize:
36 src: "{{ install_source }}/{{ item }}"
Stephane Barbarie2cbffca2018-03-26 16:20:03 -040037 dest: "{{ target_voltha_home }}"
Stephane Barbariebcea2f42018-03-02 18:46:32 -050038 archive: no
39 owner: no
40 perms: no
41 recursive: yes
42 links: yes
43 with_items:
44 - k8s
45 when: target == "cluster"
46 tags: [voltha]
47
48- name: VOLT-HA Config | Configuration directories are owned by voltha
49 file:
Stephane Barbarie2cbffca2018-03-26 16:20:03 -040050 path: "{{ target_voltha_home }}/{{ item }}"
Stephane Barbariebcea2f42018-03-02 18:46:32 -050051 owner: voltha
52 group: voltha
53 recurse: yes
54 follow: no
55 with_items:
56 - k8s
57 when: target == "cluster"
58 tags: [voltha]
59
60- name: VOLT-HA Config | Docker containers for Voltha are pulled
61 command: docker pull {{ docker_registry }}/{{ item }}
62 with_items: "{{ voltha_containers }}"
63 when: target == "cluster"
64 tags: [voltha]
65
66- name: VOLT-HA Config | Docker images are re-tagged to expected names
67 command: docker tag {{ docker_registry }}/{{ item }} {{ item }}
68 with_items: "{{ voltha_containers }}"
69 when: target == "cluster"
70 tags: [voltha]
71
72- name: VOLT-HA Config | Docker images are re-tagged to cluster registry names
73 command: docker tag {{ docker_registry }}/{{ item }} {{ inventory_hostname }}:5001/{{ item }}
74 with_items: "{{ voltha_containers }}"
75 when: target == "cluster"
76 tags: [voltha]
Stephane Barbarie30f64b82018-03-28 16:26:12 -040077
78- name: VOLT-HA Config | Disable all swaps
79 command: swapoff -a
80 when: target == "cluster"
81 tags: [voltha]
Stephane Barbarie3b67e332018-04-03 11:45:36 -040082
83- name: VOLT-HA Config | Comment out swap partitions from /etc/fstab
84 command: sed -i -e 's/^\/.* swap .*/#&/' /etc/fstab
85 when: target == "cluster"
86 tag: [voltha]