Stephane Barbarie | bcea2f4 | 2018-03-02 18:46:32 -0500 | [diff] [blame] | 1 | # 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: |
| 27 | path: "{{ target_voltha_dir }}" |
| 28 | 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 }}" |
| 37 | dest: "{{ target_voltha_dir }}" |
| 38 | 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: |
| 50 | path: "{{ target_voltha_dir }}/{{ item }}" |
| 51 | 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] |
| 77 | |
| 78 | - name: VOLT-HA Config | Add CNI bridge for PONSIM layer 2 support |
| 79 | template: |
| 80 | src: ponsim_bridge.j2 |
| 81 | dest: "/etc/cni/net.d/10-pon0.conf" |
| 82 | when: target == "cluster" |
| 83 | tags: [voltha] |