blob: 2ce0269accf1c3d5a7d8916a78d3806d7bb7abba [file] [log] [blame]
Zack Williamsa2763112017-01-03 11:38:38 -07001---
2# cord-profile/tasks/main.yml
3# Constructs a CORD service profile directory and configuration files
4
5- name: Create cord_profile directory
6 become: yes
7 file:
8 path: "{{ cord_profile_dir }}"
9 state: directory
10 mode: 0755
11 owner: "{{ ansible_user_id }}"
12 group: "{{ ansible_user_gid }}"
13
Zack Williams2478b302017-02-14 10:42:55 -070014- name: Create cord_profile/profile_name with the name of the profile
15 copy:
16 dest: "{{ cord_profile_dir }}/profile_name"
17 content: "{{ cord_profile }}"
18 mode: 0644
19
Zack Williamsa2763112017-01-03 11:38:38 -070020- name: Create subdirectories inside cord_profile directory
21 file:
22 path: "{{ cord_profile_dir }}/{{ item }}"
23 state: directory
24 mode: 0755
25 with_items:
26 - key_import
27 - onboarding-docker-compose
28 - images
29
30- name: Copy ssh keys to key_import directory
31 copy:
32 remote_src: True # file is local to the remote machine
33 src: "{{ item.source_path | expanduser }}"
34 dest: "{{ cord_profile_dir }}/key_import/{{ item.name }}"
35 mode: 0600
36 with_items: "{{ xos_service_sshkeys }}"
37
Zack Williamsc6ff6b32017-02-10 16:35:29 -070038- name: Make Image directory ( outside of profile directory to avoid repeat downloads on sequential runs)
39 become: yes
40 file:
41 path: "{{ cord_dir }}/images"
42 state: directory
43 mode: 0755
44 owner: "{{ ansible_user_id }}"
45 group: "{{ ansible_user_gid }}"
46
Zack Williamsa2763112017-01-03 11:38:38 -070047- name: Download Glance VM images
48 get_url:
49 url: "{{ item.url }}"
50 checksum: "{{ item.checksum }}"
Zack Williamsc6ff6b32017-02-10 16:35:29 -070051 dest: "{{ cord_dir }}/images/{{ item.name }}.qcow2"
52 with_items: "{{ xos_images }}"
53
54- name: Copy Glance VM images to profile directory
55 copy:
56 remote_src: True
57 src: "{{ cord_dir }}/images/{{ item.name }}.qcow2"
Zack Williamsa2763112017-01-03 11:38:38 -070058 dest: "{{ cord_profile_dir }}/images/{{ item.name }}.qcow2"
59 with_items: "{{ xos_images }}"
60
61- name: Copy over commonly used and utility TOSCA files
62 copy:
63 src: "{{ item }}"
64 dest: "{{ cord_profile_dir }}/{{ item }}"
65 with_items:
66 - fixtures.yaml
67 - enable-onboarding.yaml
68 - disable-onboarding.yaml
69
70- name: Create templated XOS configuration files
71 template:
72 src: "{{ item }}.j2"
73 dest: "{{ cord_profile_dir }}/{{ item }}"
74 mode: 0644
75 with_items:
76 - xos_common_config
77 - deployment.yaml
78 - xos.yaml
79 - xos-bootstrap-docker-compose.yaml
Scott Baker5ca4bd12017-02-10 15:17:06 -080080 - onboard-chameleon.yaml
Matteo Scandolo6050fda2017-02-16 13:01:52 -080081 - onboard-gui-extensions-store.yaml
Scott Baker970f24b2017-02-13 14:16:40 -080082 - onboard-xos-gui.yaml
83 - onboard-xos-rest-gw.yaml
84 - gateway-config.yml
Matteo Scandolo667334f2017-02-26 10:58:08 -080085 - style.config.js
86 - app.config.js
Zack Williamsa2763112017-01-03 11:38:38 -070087
88- name: Create profile specific templated TOSCA config files
89 template:
90 src: "{{ item }}.j2"
91 dest: "{{ cord_profile_dir }}/{{ item }}"
92 with_items: "{{ xos_tosca_config_templates }}"
93
94- name: Create profile specific templated non-TOSCA files
95 template:
96 src: "{{ item }}.j2"
97 dest: "{{ cord_profile_dir }}/{{ item }}"
98 with_items: "{{ xos_other_templates }}"
99
100- name: Copy admin_openrc.sh
101 when: use_openstack
102 copy:
103 remote_src: True
104 src: "{{ ansible_user_dir }}/admin-openrc.sh"
105 dest: "{{ cord_profile_dir }}/admin-openrc.sh"
106
Zack Williams2a5f6862017-02-09 16:39:52 -0700107- name: Copy node_key to cord_profile directory
108 when: use_openstack
109 copy:
110 remote_src: True # file is local to the remote machine
111 src: "{{ ansible_user_dir }}/node_key"
112 dest: "{{ cord_profile_dir }}/node_key"
113 mode: 0600