kayobe/ansible/test-keypair.yml
2017-08-07 12:08:08 +00:00

22 lines
767 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: "{{ virtualenv_path }}/shade"
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