private_key_path_src to contain a remote location

Added option for private_key_path_src variable
to contain also URL to remote location.

Change-Id: I0777455078d9b5d9d878778c1f4d44a8a475838a
This commit is contained in:
Roman Popelka 2022-01-20 14:03:16 +01:00
parent 81f3fdafe3
commit 1c2c574b92
2 changed files with 19 additions and 8 deletions

View File

@ -24,7 +24,7 @@ deployment is working by passing refstack tests.
| dest_dir * | False | pwd | String | Local directory where the artifact files will be stored. |
| download_artifacts | False | False | Bool | Whether artifacts should be downloaded to the host or not. They will be downloaded to dest_dir location.|
| guideline | False | 2021.11 | String | Specific refstack guideline. |
| private_key_path_src * | False | None | String | If defined, the key defined by the param is copied to the targeted machine to private_key_path location.|
| private_key_path_src | False | None | String | If defined, the key defined by the param is copied to the targeted machine to private_key_path location. Variable contains either a local path (the path on a machine, the playbook is executed from) or link to remote location from which the key will be downloaded.|
| refstack_client_source | False | ~/.refstack-client | String | Destination where refstack-client will be cloned only if the dir doesn't exist or it's empty, otherwise it will be used as is.|
| tempestconf_source | False | None | String | A path to python-tempestconf's source. If not defined, refstack-client's default is applied. |
| refstack_client_version | False | HEAD | String | Version of refstack-client cloned from git. |

View File

@ -14,13 +14,24 @@
# can be used in the following task which uploads the result to the user's
# refstack account
- name: Copy private key
copy:
src: "{{ private_key_path_src }}"
dest: "{{ private_key_path }}"
mode: '0600'
when:
- private_key_path is defined
- private_key_path_src is defined
block:
- name: Copy private key from local machine
copy:
src: "{{ private_key_path_src }}"
dest: "{{ private_key_path }}"
mode: '0600'
when:
- private_key_path is defined
- private_key_path_src is defined
rescue:
- name: Copy private key from remote machine
get_url:
url: "{{ private_key_path_src }}"
dest: "{{ private_key_path }}"
mode: '0600'
when:
- private_key_path is defined
- private_key_path_src is defined
- name: Upload results with signature
shell: |