blob: 784512ea6bf992d2a0255a2dfba16450cb31a8d6 [file] [log] [blame]
---
- hosts: xos-1
remote_user: ubuntu
tasks:
- name: Include configuration vars
include_vars: xos-setup-vars.yml
- name: Install prerequisites
apt:
name={{ item }}
update_cache=yes
cache_valid_time=3600
become: yes
with_items:
- git
- make
- python-novaclient
- python-neutronclient
- python-keystoneclient
- python-glanceclient
- name: Clone XOS repo
git:
repo={{ xos_repo_url }}
dest={{ xos_repo_dest }}
version={{ xos_repo_branch }}
force=yes
- name: Make XOS prerequisites
command: make -f {{ xos_repo_dest }}/xos/configurations/common/Makefile.prereqs
- name: Copy over SSH keys
copy:
src=~/.ssh/{{ item }}
dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/
owner={{ ansible_user_id }} mode=0600
with_items:
- id_rsa
- id_rsa.pub
- name: download software image
get_url:
url=http://www.vicci.org/opencloud/trusty-server-cloudimg-amd64-disk1.img
checksum=sha256:5fb160ea09649f9cebe5cfd7aaf3d1a341e8e0f9eca6e52e46eb6271155c48b0
dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/images/trusty-server-multi-nic.img
- name: copy over SSH key as node_key
copy:
src=~/.ssh/id_rsa
dest={{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}/node_key
# The become here is to work around `ubuntu` not being in the docker group
# until the next login, so become it again to reload group membership
- name: Pull docker images for XOS
become: yes
become_user: ubuntu
command: docker-compose pull chdir="{{ xos_repo_dest }}/xos/configurations/{{ xos_configuration }}"