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 |
| 18 | - python-novaclient |
| 19 | - python-neutronclient |
| 20 | - python-keystoneclient |
| 21 | - python-glanceclient |
| 22 | |
| 23 | # force=yes because we're putting other files in the repo, which will cause |
| 24 | # this to fail in the future. Wipes out local changes. |
| 25 | - name: Clone XOS repo |
| 26 | git: |
| 27 | repo={{ xos_repo_url }} |
| 28 | dest={{ xos_repo_dest }} |
| 29 | version={{ xos_repo_branch }} |
| 30 | force=yes |
| 31 | |
| 32 | - name: Make XOS prerequisites |
| 33 | command: make -f {{ xos_repo_dest }}/xos/configurations/common/Makefile.prereqs |
| 34 | |
| 35 | - name: Copy over SSH keys |
| 36 | copy: |
| 37 | src=~/.ssh/{{ item }} |
| 38 | dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/ |
| 39 | owner={{ ansible_user_id }} mode=0600 |
| 40 | with_items: |
| 41 | - id_rsa |
| 42 | - id_rsa.pub |
| 43 | |
| 44 | - name: copy over admin-openrc.sh |
| 45 | copy: |
| 46 | src=~/admin-openrc.sh |
| 47 | dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }} |
| 48 | |
| 49 | - name: copy over SSH key as node_key |
| 50 | copy: |
| 51 | src=~/.ssh/id_rsa |
| 52 | dest={{ xos_repo_dest }}//xos/configurations/{{ xos_configuration }}/node_key |
| 53 | |
| 54 | - name: create images directory |
| 55 | file: |
| 56 | path={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/images |
| 57 | state=directory |
| 58 | |
| 59 | - name: download software image |
| 60 | get_url: |
| 61 | url=http://www.vicci.org/opencloud/trusty-server-cloudimg-amd64-disk1.img |
| 62 | checksum=sha256:5fb160ea09649f9cebe5cfd7aaf3d1a341e8e0f9eca6e52e46eb6271155c48b0 |
| 63 | dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/images/trusty-server-multi-nic.img |
| 64 | |
| 65 | |