Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [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: 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 | |
| 38 | #- 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 | |
| 51 | - name: Required configuration directories are copied |
| 52 | synchronize: |
| 53 | src: "/home/vinstall/{{ item }}" |
| 54 | dest: "{{ target_voltha_home }}" |
| 55 | archive: no |
| 56 | owner: no |
| 57 | perms: no |
| 58 | recursive: yes |
| 59 | links: yes |
| 60 | with_items: |
| 61 | - docker-py |
| 62 | - netifaces |
| 63 | - deb_files |
| 64 | tags: [cluster-host] |
| 65 | |
| 66 | - name: apt lists are up-to-date |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 67 | synchronize: |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 68 | src: "/var/lib/apt/lists" |
Sergio Slobodrian | 5727e98 | 2017-06-28 21:02:27 -0400 | [diff] [blame] | 69 | dest: "/var/lib/apt/lists" |
| 70 | archive: no |
| 71 | owner: no |
| 72 | perms: no |
| 73 | rsync_opts: |
| 74 | - "--exclude=lock" |
| 75 | - "--exclude=partial" |
| 76 | recursive: yes |
| 77 | links: yes |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 78 | tags: [cluster_host] |
| 79 | |
Sergio Slobodrian | 7c5e885 | 2017-07-31 20:17:14 -0400 | [diff] [blame] | 80 | #- name: pre-emptive strike to avoid errors during package installation |
| 81 | # apt: |
| 82 | # name: "{{ item }}" |
| 83 | # state: absent |
| 84 | # with_items: |
| 85 | # - ubuntu-core-launcher |
| 86 | # - snapd |
| 87 | # tags: [cluster_host] |
sathishg | b5d1c18 | 2017-07-13 14:20:19 +0530 | [diff] [blame] | 88 | - name: A fluentd directory under tmp for voltha logs exists |
| 89 | file: |
| 90 | path: "/tmp/fluentd" |
| 91 | state: directory |
| 92 | tags: [cluster_host] |
| 93 | |
Sergio Slobodrian | f74fa07 | 2017-06-28 09:33:24 -0400 | [diff] [blame] | 94 | - name: Dependent software is installed (this can take about 10 Min, DONT'T PANIC, go for coffee instead) |
Sergio Slobodrian | ba9cbd8 | 2017-06-22 11:45:49 -0400 | [diff] [blame] | 95 | command: dpkg -R -i "{{ target_voltha_home }}/deb_files" |
| 96 | # ignore_errors: true |
| 97 | when: target == "cluster" |
| 98 | tags: [cluster_host] |
| 99 | |
| 100 | #- name: Dependent software is initialized |
| 101 | # command: apt-get -y -f install |
| 102 | # when: target == "cluster" |
| 103 | # tags: [cluster_host] |
| 104 | |
| 105 | - name: Python packages are installed |
| 106 | command: pip install {{ item }} --no-index --find-links "file://{{ target_voltha_home }}/{{ item }}" |
| 107 | with_items: |
| 108 | - docker-py |
| 109 | - netifaces |
| 110 | when: target == "cluster" |
| 111 | tags: [cluster_host] |
| 112 | |
| 113 | - name: Configuration directories are deleted |
| 114 | file: |
| 115 | path: "{{ target_voltha_home }}/{{ item }}" |
| 116 | state: absent |
| 117 | with_items: |
| 118 | - docker-py |
| 119 | - netifaces |
| 120 | - deb_files |
| 121 | when: target == "cluster" |
| 122 | tags: [cluster_host] |
| 123 | |