Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -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. |
Sergio Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 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 | |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 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" |
Sergio Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 49 | tags: [cluster_host] |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 50 | |
Sergio Slobodrian | 7c48362 | 2017-06-13 15:51:34 -0400 | [diff] [blame] | 51 | - 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 Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 57 | - 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 Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 63 | tags: [cluster_host] |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 64 | |
| 65 | - name: Dependent software is initialized |
| 66 | command: apt-get -f install |
| 67 | when: target == "cluster" |
Sergio Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 68 | tags: [cluster_host] |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 69 | |
Sergio Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 70 | - name: Python packages are installed |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 71 | 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 Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 76 | tags: [cluster_host] |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 77 | |
| 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 Slobodrian | d24189e | 2017-06-10 23:27:15 -0400 | [diff] [blame] | 87 | tags: [cluster_host] |
Sergio Slobodrian | c547771 | 2017-06-07 11:56:56 -0400 | [diff] [blame] | 88 | |