mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
682 B
YAML
30 lines
682 B
YAML
4 years ago
|
# Test creating ssh key with passphrase
|
||
|
- name: Remove ansibulluser
|
||
|
user:
|
||
|
name: ansibulluser
|
||
|
state: absent
|
||
|
|
||
|
- name: Create user with ssh key
|
||
|
user:
|
||
|
name: ansibulluser
|
||
|
state: present
|
||
|
generate_ssh_key: yes
|
||
|
force: yes
|
||
|
ssh_key_file: "{{ output_dir }}/test_id_rsa"
|
||
|
ssh_key_passphrase: secret_passphrase
|
||
|
|
||
|
- name: Unlock ssh key
|
||
|
command: "ssh-keygen -y -f {{ output_dir }}/test_id_rsa -P secret_passphrase"
|
||
|
register: result
|
||
|
|
||
|
- name: Check that ssh key was unlocked successfully
|
||
|
assert:
|
||
|
that:
|
||
|
- result.rc == 0
|
||
|
|
||
|
- name: Clean ssh key
|
||
|
file:
|
||
|
path: "{{ output_dir }}/test_id_rsa"
|
||
|
state: absent
|
||
|
when: ansible_os_family == 'FreeBSD'
|