[PATCH v3 18/36] terraform: Create the user's .ssh/config if it does not already exist

Chuck Lever <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Chuck Lever <[email protected]>

While setting up some new test runners, I encountered this failure:

TASK [terraform : Ensure the Include directive is present on the controller] ***
task path: /usr/local/home/queue-5-4/worker/queue-5-4-kernel/build/playbooks/roles/terraform/tasks/main.yml:31
fatal: [localhost]: FAILED! => {
    "changed": false,
    "rc": 257
}
MSG:
Path /usr/local/home/queue-5-4/.ssh/config does not exist !

Reviewed-by: Luis Chamberlain <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
---
 playbooks/roles/terraform/tasks/main.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/playbooks/roles/terraform/tasks/main.yml b/playbooks/roles/terraform/tasks/main.yml
index 91c424c4ab6b..dabc9384e470 100644
--- a/playbooks/roles/terraform/tasks/main.yml
+++ b/playbooks/roles/terraform/tasks/main.yml
@@ -118,6 +118,7 @@
     path: "{{ sshconfig }}"
     insertbefore: BOF
     append_newline: true
+    create: true
     marker: "# {mark} Managed by kdevops"
     mode: "u=rw,g=r,o=r"
     block: "Include {{ kdevops_ssh_config_prefix }}*"
-- 
2.51.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.