blob: 2ce0269accf1c3d5a7d8916a78d3806d7bb7abba [file] [log] [blame]
---
# cord-profile/tasks/main.yml
# Constructs a CORD service profile directory and configuration files
- name: Create cord_profile directory
become: yes
file:
path: "{{ cord_profile_dir }}"
state: directory
mode: 0755
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_gid }}"
- name: Create cord_profile/profile_name with the name of the profile
copy:
dest: "{{ cord_profile_dir }}/profile_name"
content: "{{ cord_profile }}"
mode: 0644
- name: Create subdirectories inside cord_profile directory
file:
path: "{{ cord_profile_dir }}/{{ item }}"
state: directory
mode: 0755
with_items:
- key_import
- onboarding-docker-compose
- images
- name: Copy ssh keys to key_import directory
copy:
remote_src: True # file is local to the remote machine
src: "{{ item.source_path | expanduser }}"
dest: "{{ cord_profile_dir }}/key_import/{{ item.name }}"
mode: 0600
with_items: "{{ xos_service_sshkeys }}"
- name: Make Image directory ( outside of profile directory to avoid repeat downloads on sequential runs)
become: yes
file:
path: "{{ cord_dir }}/images"
state: directory
mode: 0755
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_gid }}"
- name: Download Glance VM images
get_url:
url: "{{ item.url }}"
checksum: "{{ item.checksum }}"
dest: "{{ cord_dir }}/images/{{ item.name }}.qcow2"
with_items: "{{ xos_images }}"
- name: Copy Glance VM images to profile directory
copy:
remote_src: True
src: "{{ cord_dir }}/images/{{ item.name }}.qcow2"
dest: "{{ cord_profile_dir }}/images/{{ item.name }}.qcow2"
with_items: "{{ xos_images }}"
- name: Copy over commonly used and utility TOSCA files
copy:
src: "{{ item }}"
dest: "{{ cord_profile_dir }}/{{ item }}"
with_items:
- fixtures.yaml
- enable-onboarding.yaml
- disable-onboarding.yaml
- name: Create templated XOS configuration files
template:
src: "{{ item }}.j2"
dest: "{{ cord_profile_dir }}/{{ item }}"
mode: 0644
with_items:
- xos_common_config
- deployment.yaml
- xos.yaml
- xos-bootstrap-docker-compose.yaml
- onboard-chameleon.yaml
- onboard-gui-extensions-store.yaml
- onboard-xos-gui.yaml
- onboard-xos-rest-gw.yaml
- gateway-config.yml
- style.config.js
- app.config.js
- name: Create profile specific templated TOSCA config files
template:
src: "{{ item }}.j2"
dest: "{{ cord_profile_dir }}/{{ item }}"
with_items: "{{ xos_tosca_config_templates }}"
- name: Create profile specific templated non-TOSCA files
template:
src: "{{ item }}.j2"
dest: "{{ cord_profile_dir }}/{{ item }}"
with_items: "{{ xos_other_templates }}"
- name: Copy admin_openrc.sh
when: use_openstack
copy:
remote_src: True
src: "{{ ansible_user_dir }}/admin-openrc.sh"
dest: "{{ cord_profile_dir }}/admin-openrc.sh"
- name: Copy node_key to cord_profile directory
when: use_openstack
copy:
remote_src: True # file is local to the remote machine
src: "{{ ansible_user_dir }}/node_key"
dest: "{{ cord_profile_dir }}/node_key"
mode: 0600