kayobe/ansible/test-keypair.yml

22 lines
775 B
YAML

---
- name: Ensure user SSH keypair is registered with Nova
hosts: controllers[0]
vars:
public_key_path: "{{ ssh_public_key_path }}"
os_shade_venv: "{{ ansible_env['PWD'] }}/shade-venv"
roles:
- role: stackhpc.os-shade
tasks:
# Note that setting this via a play or task variable seems to not
# evaluate the Jinja variable reference, so we use set_fact.
- name: Update the Ansible python interpreter fact to point to the shade virtualenv
set_fact:
ansible_python_interpreter: "{{ os_shade_venv }}/bin/python"
- name: Ensure a test SSH key pair is registered with Nova
os_keypair:
auth: "{{ openstack_auth }}"
name: test
public_key: "{{ lookup('file', public_key_path) }}"
state: present