30 lines
1.1 KiB
YAML
30 lines
1.1 KiB
YAML
---
|
|
|
|
- name: check if amphora image file exists
|
|
stat:
|
|
path: "{{ amp_image_filename }}"
|
|
register: amp_image_file_result
|
|
- name: upload image to glance
|
|
shell: |
|
|
if [[ $(openstack image show {{ amp_image_name }} > /dev/null; echo $?) -eq 1 ]]; then
|
|
glance image-create --name {{ amp_image_name }} --disk-format qcow2 \
|
|
--container-format bare --tags {{ amp_image_tag }} --file {{ amp_image_filename }}
|
|
fi
|
|
register: image_result
|
|
changed_when: "image_result.stdout != ''"
|
|
when: amp_image_file_result.stat.exists == True
|
|
|
|
- name: check if pub key file exists
|
|
stat: path="{{ amp_ssh_key_path }}"
|
|
register: ssh_pub_key_file_result
|
|
|
|
- name: upload pub key to overcloud
|
|
shell: |
|
|
openstack keypair show {{ amp_ssh_key_name }} || \
|
|
openstack keypair create --public-key {{ amp_ssh_key_path }} {{ amp_ssh_key_name }}
|
|
environment:
|
|
OS_USERNAME: {{ auth_username }}
|
|
OS_PASSWORD: {{ auth_password }}
|
|
OS_PROJECT_NAME: {{ auth_project_name }}
|
|
when: ssh_pub_key_file_result.stat.exists == True
|