blob: d258d54e71a34d854e3e08e82223b65522d1ffb4 [file] [log] [blame]
Zack Williams363bc852016-04-12 13:58:29 -07001---
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 Williamse4fbacc2016-05-21 07:18:43 -070018 - curl
Zack Williams363bc852016-04-12 13:58:29 -070019 - python-novaclient
20 - python-neutronclient
21 - python-keystoneclient
22 - python-glanceclient
23
Zack Williams363bc852016-04-12 13:58:29 -070024 - name: Clone XOS repo
25 git:
26 repo={{ xos_repo_url }}
27 dest={{ xos_repo_dest }}
28 version={{ xos_repo_branch }}
Zack Williams9b3c3612016-04-14 07:05:30 -070029 force=yes
Zack Williams363bc852016-04-12 13:58:29 -070030
Scott Baker333a3152016-06-29 08:58:42 -070031 - 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 Williams363bc852016-04-12 13:58:29 -070038 - name: Copy over SSH keys
39 copy:
40 src=~/.ssh/{{ item }}
Scott Baker333a3152016-06-29 08:58:42 -070041 dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/
Zack Williams363bc852016-04-12 13:58:29 -070042 owner={{ ansible_user_id }} mode=0600
43 with_items:
44 - id_rsa
45 - id_rsa.pub
46
Andy Bavier6274d6a2016-08-12 18:12:01 -040047 - name: copy over node_key
Zack Williamse4fbacc2016-05-21 07:18:43 -070048 copy:
Andy Bavierd39936c2016-08-02 17:31:07 -040049 src={{ node_private_key }}
Scott Baker333a3152016-06-29 08:58:42 -070050 dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/node_key
Andy Bavier6274d6a2016-08-12 18:12:01 -040051 owner={{ ansible_user_id }} mode=0600
Zack Williamse4fbacc2016-05-21 07:18:43 -070052
Zack Williamsa3e40562016-07-05 12:05:39 -070053 - name: Download Glance VM images
Zack Williams363bc852016-04-12 13:58:29 -070054 get_url:
Zack Williams62587be2016-05-25 15:56:45 -070055 url={{ item.url }}
56 checksum={{ item.checksum }}
Scott Baker333a3152016-06-29 08:58:42 -070057 dest={{ service_profile_repo_dest }}/{{ xos_configuration }}/images/{{ item.name }}.img
Zack Williams62587be2016-05-25 15:56:45 -070058 with_items: "{{ xos_images }}"
Zack Williams363bc852016-04-12 13:58:29 -070059
Zack Williamsa3e40562016-07-05 12:05:39 -070060 - name: Pull database and cord-app-build image
61 become: yes
62 command: docker pull {{ item }}
63 with_items:
64 - xosproject/xos-postgres
65 - xosproject/cord-app-build
66
Zack Williamsd31bbc92016-05-20 11:43:18 -070067 - name: Pull docker images for XOS
Zack Williams72a9ab42016-06-08 08:32:49 -070068 when: not xos_container_rebuild
Zack Williams09df9d62016-05-27 22:39:38 -070069 become: yes
70 command: docker pull {{ item }}
71 with_items:
72 - xosproject/xos-base
Zack Williams363bc852016-04-12 13:58:29 -070073
Zack Williams72a9ab42016-06-08 08:32:49 -070074 - name: Rebuild XOS containers
75 when: xos_container_rebuild
76 command: make {{ item }}
Zack Williamsa3e40562016-07-05 12:05:39 -070077 chdir="{{ xos_repo_dest }}/containers/xos/"
Zack Williams72a9ab42016-06-08 08:32:49 -070078 with_items:
79 - base