-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from AlexBacho/feature-65
Add modules metal_project_ssh_key{_info}, docs and tests
- Loading branch information
Showing
8 changed files
with
663 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# metal_project_ssh_key | ||
|
||
Manage project ssh key in Equinix Metal. Read more about personal and project SSH keys in [Equinix Metal documentation](https://deploy.equinix.com/developers/docs/metal/accounts/ssh-keys/#personal-keys-vs-project-keys). You can use *id* or *label* to lookup a project SSH key. If you want to create new resource, you must provide *name*, *public_key* and *project_id*. | ||
|
||
|
||
- [Examples](#examples) | ||
- [Parameters](#parameters) | ||
- [Return Values](#return-values) | ||
|
||
## Examples | ||
|
||
```yaml | ||
- name: Create new project project ssh_key | ||
hosts: localhost | ||
tasks: | ||
- equinix.cloud.metal_project_ssh_key: | ||
name: "test_key" | ||
public_key: "ssh-dss AAAAB3NzaC1kc3MAAACBAPLEVntPO3L7VUbEwWZ2ErkQJ3KJ8o9kFXJrPcpvVfdNag4jIhQDqbtAUgUy6BclhhbfH9l5nlGTprrpEFkxm/GL91qJUX6xrPkDMjMqx2wSKa4YraReOrCOfkqqEkC3o3G/gYSuvTzLgp2rmPiflypftZyzNM4JZT8jDwFGotJhAAAAFQDPk43bayONtUxjkAcOf+6zP1qb6QAAAIBZHHH0tIlth5ot+Xa/EYuB/M4qh77EkrWUbER0Kki7suskw/ffdKQ0y/v+ZhoAHtBU7BeE3HmP98Vrha1i4cOU+A7DCqV+lK/a+5LoEpua0M2M+VzNSGluYuV4qGpAOxNh3mxUi2R7yXxheN1oks1ROJ/bqkF4BJQXU9Nv49GkZgAAAIByWcsFeOitvzyDaNJOZzEHv9fqGuj0L3maRVWb6O47HGzlMzniIy8WjL2dfgm2/ek+NxVR/yFnYTKDPr6+0uqSD/cb4eHaFbIj7v+k7H8hA1Ioz+duJ1ONAjn6KwneXxOXu15bYIR49P7Go0s9jCdSAP/r9NE5TnE3yiRiQzgEzw== tomk@node" | ||
project_id: "local.project_id" | ||
|
||
``` | ||
|
||
```yaml | ||
- name: Remove project ssh_key by id | ||
hosts: localhost | ||
tasks: | ||
- equinix.cloud.metal_project_ssh_key: | ||
id: "eef49903-7a09-4ca1-af67-4087c29ab5b6" | ||
state: absent | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Parameters | ||
|
||
| Field | Type | Required | Description | | ||
|-----------|------|----------|------------------------------------------------------------------------------| | ||
| `id` | <center>`str`</center> | <center>Optional</center> | UUID of the ssh_key. | | ||
| `name` | <center>`str`</center> | <center>Optional</center> | The name of the ssh_key. **(Updatable)** | | ||
| `public_key` | <center>`str`</center> | <center>Optional</center> | The public key of the project ssh_key. **(Updatable)** | | ||
| `project_id` | <center>`str`</center> | <center>Optional</center> | The ID of parent project. **(Updatable)** | | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Return Values | ||
|
||
- `metal_project_ssh_key` - The module object | ||
|
||
- Sample Response: | ||
```json | ||
|
||
{ | ||
"fingerprint": "98:9c:35:ed:f9:75:5b:52:e2:70:50:22:ea:77:5b:b6", | ||
"id": "eef49903-7a09-4ca1-af67-4087c29ab5b6", | ||
"public_key": "ssh-dss AAAAB3NzaC1kc3MAAACBAPLEVntPO3L7VUbEwWZ2ErkQJ3KJ8o9kFXJrPcpvVfdNag4jIhQDqbtAUgUy6BclhhbfH9l5nlGTprrpEFkxm/GL91qJUX6xrPkDMjMqx2wSKa4YraReOrCOfkqqEkC3o3G/gYSuvTzLgp2rmPiflypftZyzNM4JZT8jDwFGotJhAAAAFQDPk43bayONtUxjkAcOf+6zP1qb6QAAAIBZHHH0tIlth5ot+Xa/EYuB/M4qh77EkrWUbER0Kki7suskw/ffdKQ0y/v+ZhoAHtBU7BeE3HmP98Vrha1i4cOU+A7DCqV+lK/a+5LoEpua0M2M+VzNSGluYuV4qGpAOxNh3mxUi2R7yXxheN1oks1ROJ/bqkF4BJQXU9Nv49GkZgAAAIByWcsFeOitvzyDaNJOZzEHv9fqGuj0L3maRVWb6O47HGzlMzniIy8WjL2dfgm2/ek+NxVR/yFnYTKDPr6+0uqSD/cb4eHaFbIj7v+k7H8hA1Ioz+duJ1ONAjn6KwneXxOXu15bYIR49P7Go0s9jCdSAP/r9NE5TnE3yiRiQzgEzw== tomk@xps", | ||
"name": "test_key", | ||
"project_id": "local.project_id" | ||
} | ||
|
||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# metal_project_ssh_key_info | ||
|
||
Gather project SSH keys. Read more about project vs project SSH keys in [Equinix Metal documentation](https://metal.equinix.com/developers/docs/accounts/ssh-keys/#personal-keys-vs-project-keys). | ||
|
||
|
||
- [Examples](#examples) | ||
- [Parameters](#parameters) | ||
- [Return Values](#return-values) | ||
|
||
## Examples | ||
|
||
```yaml | ||
|
||
- set_fact: | ||
desired_name_substring: "tkarasek" | ||
|
||
- name: list project ssh keys | ||
equinix.cloud.metal_project_ssh_key_info: | ||
register: ssh_keys_listed | ||
|
||
- name: filter found ssh keys | ||
set_fact: | ||
both_ssh_keys_listed: "{{ ssh_keys_listed.resources | selectattr('name', 'match', desired_name_substring) }}" | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Parameters | ||
|
||
| Field | Type | Required | Description | | ||
|-----------|------|----------|------------------------------------------------------------------------------| | ||
| `name` | <center>`str`</center> | <center>**Required**</center> | Name to search for in existing keys. | | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Return Values | ||
|
||
- `resources` - Found resources | ||
|
||
- Sample Response: | ||
```json | ||
|
||
[ | ||
{ | ||
"fingerprint": "70:c1:73:8b:3f:2f:a4:18:ea:4d:79:13:52:7b:c4:3e", | ||
"id": "6edfcbc2-17e5-4221-9eac-2f40dbe60daf", | ||
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAt5gwVMhwcCrxyxpMEKwiS0xgit3PIIEgVXt6SQHc8eONq0mYJJ5TOBNTnySqXd9RtSv/Jbf5Aq9BzBGWeoZ6sZfKwh984Ip35StJtjXtyIOlY3skovndtupBIwlGXgX/WQzyLr+G/+Yu9/nhdxQi801PDZnDvKoeomM0rMD29nV+m0ud+GrtsAt6VFul2PxqpypZ1TYviyED6IKo7rgQsQDkE9QHcNdfT1FZWiJbfP7o8TIurQJcAXg+MtLoc8rKKcxFMeZ9FSydgtTC7nP1h558RtECGWiUgaBPI7TpBmcdMtbEfAiBoGT17GWnT8qmy2u5xnEKPD9Qft4w4fjfpw==", | ||
"label": "tkarasek", | ||
"project_id": local.project_id | ||
}, | ||
{ | ||
"fingerprint": "ba:70:af:b3:0f:0e:7f:e5:eb:97:e2:27:b1:f5:6f:94", | ||
"id": "d00c596d-b42a-44a7-ac14-e299b85e73d3", | ||
"key": "ssh-dss AAAAB3NzaC1kc3MAAACBAOpXVtmc0Bla98bt0o5/Zj7sb4mHIukgVFZu7F32R3VK1cEKB4rEE8uS0oLS/qMRLue45TWVJwRMYGlPjt3p/VyraelxoyJZLuITIsqa5hBc9w0oTlB5Bmbkn16umW96WCaWEoq/aitpocbRChTiP5biI6FyQTQlIHDaYzBDOi11AAAAFQDUXy7cmuzphDpJSYYTiudiUhVokwAAAIEAyUQ9m8qL/1HPkFe6jbXAvtSSmW27F4c+G2xR5HizaHQzXgBOxPcsOsY17KTU+Ddbg+OF9soWNwSpm9pyVjVmNGqH3S8R1pwvuJF/O2Asy1m6wpWhbPw8JdEBW7WHoptBpfuzJoS2LOzJUEmUu4Eb+xS237KG1d1BVny/49KAoH0AAACBAJKBSsm9Xey0fUN6vYtTQgoYeGxxj/LqAIAOs/TpCxZDntly860y/SzHYai8x48k4t7whENY1CJ41fpMcPlz8xIsrNP3326Wbr0ExwOIvJKAVN1YLYqF8NXWzaVrjo5WbSeI8PiWTYemvLAujVxZssIrApTZBhp55nnwge6K1zTG tomk@air", | ||
"label": "ansible-integration-test-ssh_key-ztiapihf-ssh_key1_renamed", | ||
"project_id": local.project_id | ||
} | ||
] | ||
|
||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.