Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 1 | --- |
| 2 | - hosts: xos-1 |
| 3 | remote_user: ubuntu |
| 4 | |
| 5 | tasks: |
| 6 | - name: Include configuration vars |
| 7 | include_vars: xos-setup-vars.yml |
| 8 | |
| 9 | - name: Install prerequisites |
| 10 | apt: |
| 11 | name={{ item }} |
| 12 | update_cache=yes |
| 13 | cache_valid_time=3600 |
| 14 | become: yes |
| 15 | with_items: |
| 16 | - git |
| 17 | - make |
Zack Williams | e4fbacc | 2016-05-21 07:18:43 -0700 | [diff] [blame] | 18 | - curl |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 19 | - python-novaclient |
| 20 | - python-neutronclient |
| 21 | - python-keystoneclient |
| 22 | - python-glanceclient |
| 23 | |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 24 | - name: Clone XOS repo |
| 25 | git: |
| 26 | repo={{ xos_repo_url }} |
| 27 | dest={{ xos_repo_dest }} |
| 28 | version={{ xos_repo_branch }} |
Zack Williams | 9b3c361 | 2016-04-14 07:05:30 -0700 | [diff] [blame] | 29 | force=yes |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 30 | |
Scott Baker | 333a315 | 2016-06-29 08:58:42 -0700 | [diff] [blame] | 31 | - name: Clone service-profile repo |
| 32 | git: |
| 33 | repo={{ service_profile_repo_url }} |
| 34 | dest={{ service_profile_repo_dest }} |
| 35 | version={{ service_profile_repo_branch }} |
| 36 | force=yes |
| 37 | |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 38 | - name: Copy over SSH keys |
| 39 | copy: |
| 40 | src=~/.ssh/{{ item }} |
Scott Baker | 333a315 | 2016-06-29 08:58:42 -0700 | [diff] [blame] | 41 | dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/ |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 42 | owner={{ ansible_user_id }} mode=0600 |
| 43 | with_items: |
| 44 | - id_rsa |
| 45 | - id_rsa.pub |
| 46 | |
Zack Williams | e4fbacc | 2016-05-21 07:18:43 -0700 | [diff] [blame] | 47 | - name: copy over SSH key as node_key |
| 48 | copy: |
| 49 | src=~/.ssh/id_rsa |
Scott Baker | 333a315 | 2016-06-29 08:58:42 -0700 | [diff] [blame] | 50 | dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/node_key |
Zack Williams | e4fbacc | 2016-05-21 07:18:43 -0700 | [diff] [blame] | 51 | |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame^] | 52 | - name: Download Glance VM images |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 53 | get_url: |
Zack Williams | 62587be | 2016-05-25 15:56:45 -0700 | [diff] [blame] | 54 | url={{ item.url }} |
| 55 | checksum={{ item.checksum }} |
Scott Baker | 333a315 | 2016-06-29 08:58:42 -0700 | [diff] [blame] | 56 | dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/images/{{ item.name }}.img |
Zack Williams | 62587be | 2016-05-25 15:56:45 -0700 | [diff] [blame] | 57 | with_items: "{{ xos_images }}" |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 58 | |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame^] | 59 | - name: Pull database and cord-app-build image |
| 60 | become: yes |
| 61 | command: docker pull {{ item }} |
| 62 | with_items: |
| 63 | - xosproject/xos-postgres |
| 64 | - xosproject/cord-app-build |
| 65 | |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 66 | - name: Pull docker images for XOS |
Zack Williams | 72a9ab4 | 2016-06-08 08:32:49 -0700 | [diff] [blame] | 67 | when: not xos_container_rebuild |
Zack Williams | 09df9d6 | 2016-05-27 22:39:38 -0700 | [diff] [blame] | 68 | become: yes |
| 69 | command: docker pull {{ item }} |
| 70 | with_items: |
| 71 | - xosproject/xos-base |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 72 | |
Zack Williams | 72a9ab4 | 2016-06-08 08:32:49 -0700 | [diff] [blame] | 73 | - name: Rebuild XOS containers |
| 74 | when: xos_container_rebuild |
| 75 | command: make {{ item }} |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame^] | 76 | chdir="{{ xos_repo_dest }}/containers/xos/" |
Zack Williams | 72a9ab4 | 2016-06-08 08:32:49 -0700 | [diff] [blame] | 77 | with_items: |
| 78 | - base |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame^] | 79 | |