diff --git a/releasenotes/notes/ssh-pub-key-check-c42309653dbe3493.yaml b/releasenotes/notes/ssh-pub-key-check-c42309653dbe3493.yaml new file mode 100644 index 00000000..6b38bb0c --- /dev/null +++ b/releasenotes/notes/ssh-pub-key-check-c42309653dbe3493.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - The check to validate whether an appropriate ssh public key + is available to copy into the container cache has been + corrected to check the deployment host, not the LXC host. diff --git a/tasks/main.yml b/tasks/main.yml index 6503f4a3..e26478da 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,17 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Check for the presence of a public key file on the host - stat: +- name: Check for the presence of a public key file on the deployment host + local_action: + module: stat path: /root/.ssh/id_rsa.pub register: _ssh_key when: lxc_container_ssh_key is undefined tags: - always -- name: Fail if a ssh public key is not set in a var and not present on the host +- name: Fail if a ssh public key is not set in a var and is not present on the deployment host fail: - msg: "Please set the lxc_container_ssh_key variable or ensure that the host has the file /root/.ssh/id_rsa.pub present." + msg: "Please set the lxc_container_ssh_key variable or ensure that the deployment host has the file /root/.ssh/id_rsa.pub present." when: - lxc_container_ssh_key is undefined - not _ssh_key.stat.exists