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 | |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 31 | - name: Copy over SSH keys |
| 32 | copy: |
| 33 | src=~/.ssh/{{ item }} |
| 34 | dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/ |
| 35 | owner={{ ansible_user_id }} mode=0600 |
| 36 | with_items: |
| 37 | - id_rsa |
| 38 | - id_rsa.pub |
| 39 | |
Zack Williams | e4fbacc | 2016-05-21 07:18:43 -0700 | [diff] [blame] | 40 | - name: copy over SSH key as node_key |
| 41 | copy: |
| 42 | src=~/.ssh/id_rsa |
| 43 | dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/node_key |
| 44 | |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 45 | - name: download software image |
| 46 | get_url: |
Zack Williams | 62587be | 2016-05-25 15:56:45 -0700 | [diff] [blame] | 47 | url={{ item.url }} |
| 48 | checksum={{ item.checksum }} |
| 49 | dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/images/{{ item.name }}.img |
| 50 | with_items: "{{ xos_images }}" |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 51 | |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 52 | - name: Pull docker images for XOS |
Zack Williams | 72a9ab4 | 2016-06-08 08:32:49 -0700 | [diff] [blame] | 53 | when: not xos_container_rebuild |
Zack Williams | 09df9d6 | 2016-05-27 22:39:38 -0700 | [diff] [blame] | 54 | become: yes |
| 55 | command: docker pull {{ item }} |
| 56 | with_items: |
| 57 | - xosproject/xos-base |
| 58 | - xosproject/xos-postgres |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 59 | |
Zack Williams | 72a9ab4 | 2016-06-08 08:32:49 -0700 | [diff] [blame] | 60 | - name: Rebuild XOS containers |
| 61 | when: xos_container_rebuild |
| 62 | command: make {{ item }} |
| 63 | chdir="{{ xos_repo_dest }}/containers/xos/" |
| 64 | with_items: |
| 65 | - base |
| 66 | |