Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -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 |
| 18 | - curl |
| 19 | - python-novaclient |
| 20 | - python-neutronclient |
| 21 | - python-keystoneclient |
| 22 | - python-glanceclient |
| 23 | |
| 24 | - name: Clone XOS repo |
| 25 | git: |
| 26 | repo={{ xos_repo_url }} |
| 27 | dest={{ xos_repo_dest }} |
| 28 | version={{ xos_repo_branch }} |
| 29 | force=yes |
| 30 | |
| 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 | |
| 38 | - name: Copy over SSH keys |
| 39 | copy: |
| 40 | src=~/.ssh/{{ item }} |
| 41 | dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/ |
| 42 | owner={{ ansible_user_id }} mode=0600 |
| 43 | with_items: |
| 44 | - id_rsa |
| 45 | - id_rsa.pub |
| 46 | |
| 47 | - name: copy over node_key |
| 48 | copy: |
| 49 | src={{ node_private_key }} |
| 50 | dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/node_key |
| 51 | owner={{ ansible_user_id }} mode=0600 |
| 52 | |
| 53 | - name: Download Glance VM images |
| 54 | get_url: |
| 55 | url={{ item.url }} |
| 56 | checksum={{ item.checksum }} |
| 57 | dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/images/{{ item.name }}.img |
| 58 | with_items: "{{ xos_images }}" |
| 59 | |
| 60 | - name: Pull database image |
| 61 | become: yes |
| 62 | command: docker pull {{ item }} |
| 63 | with_items: |
| 64 | - xosproject/xos-postgres |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 65 | tags: |
| 66 | - skip_ansible_lint # Should replace with http://docs.ansible.com/ansible/docker_module.html, when replacements are stable |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 67 | |
| 68 | - name: Pull docker images for XOS |
| 69 | when: not xos_container_rebuild |
| 70 | become: yes |
| 71 | command: docker pull {{ item }} |
| 72 | with_items: |
| 73 | - xosproject/xos-base |
| 74 | |
| 75 | - name: Rebuild XOS containers |
| 76 | when: xos_container_rebuild |
| 77 | command: make {{ item }} |
| 78 | chdir="{{ xos_repo_dest }}/containers/xos/" |
| 79 | with_items: |
| 80 | - base |