e47c4671c7
This is separate from the previous patch - it's just the results of running the script so we can review the two a little independently. We should probably squash them. Change-Id: I838f15cf4a32455a5be20033c8ddc27db6ca15c0
63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
---
|
|
- name: Create keypair (non-existing)
|
|
openstack.cloud.keypair:
|
|
cloud: "{{ cloud }}"
|
|
name: "{{ keypair_name }}"
|
|
state: present
|
|
register:
|
|
keypair
|
|
|
|
# This assert verifies that Ansible is capable serializing data returned by SDK
|
|
- name: Ensure private key is returned
|
|
assert:
|
|
that:
|
|
- keypair.key.public_key is defined and keypair.key.public_key
|
|
|
|
- name: Delete keypair (non-existing)
|
|
openstack.cloud.keypair:
|
|
cloud: "{{ cloud }}"
|
|
name: "{{ keypair_name }}"
|
|
state: absent
|
|
|
|
- name: Generate test key file
|
|
user:
|
|
name: "{{ ansible_env.USER }}"
|
|
generate_ssh_key: yes
|
|
ssh_key_file: .ssh/shade_id_rsa
|
|
|
|
- name: Create keypair (file)
|
|
openstack.cloud.keypair:
|
|
cloud: "{{ cloud }}"
|
|
name: "{{ keypair_name }}"
|
|
state: present
|
|
public_key_file: "{{ ansible_env.HOME }}/.ssh/shade_id_rsa.pub"
|
|
|
|
- name: Delete keypair (file)
|
|
openstack.cloud.keypair:
|
|
cloud: "{{ cloud }}"
|
|
name: "{{ keypair_name }}"
|
|
state: absent
|
|
|
|
- name: Create keypair (key)
|
|
openstack.cloud.keypair:
|
|
cloud: "{{ cloud }}"
|
|
name: "{{ keypair_name }}"
|
|
state: present
|
|
public_key: "{{ lookup('file', '~/.ssh/shade_id_rsa.pub') }}"
|
|
|
|
- name: Delete keypair (key)
|
|
openstack.cloud.keypair:
|
|
cloud: "{{ cloud }}"
|
|
name: "{{ keypair_name }}"
|
|
state: absent
|
|
|
|
- name: Delete test key pub file
|
|
file:
|
|
name: "{{ ansible_env.HOME }}/.ssh/shade_id_rsa.pub"
|
|
state: absent
|
|
|
|
- name: Delete test key pvt file
|
|
file:
|
|
name: "{{ ansible_env.HOME }}/.ssh/shade_id_rsa"
|
|
state: absent
|