Browse Source

Fix some issues when executing workload 'dockerswarm'.

* Disable checking for `scp`, add '-o StrictHostKeyChecking=no';
* Add the process that waiting for ssh connection OK of nodes.

Change-Id: Iec6d0c0a51219c42072d26b0920a1263200c2909
Closes-Bug: #1664790
ericxiett 2 years ago
parent
commit
ed8c406fe3
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      workloads/ansible/shade/dockerswarm/roles/prov_apply/tasks/main.yml

+ 11
- 3
workloads/ansible/shade/dockerswarm/roles/prov_apply/tasks/main.yml View File

@@ -9,7 +9,7 @@
9 9
 
10 10
 - name: Make certificate configuration file
11 11
   copy:
12
-    src: templates/openssl.cnf
12
+    src: "templates/openssl.cnf"
13 13
     dest: "/tmp/{{ env }}/{{ node_ip }}/keys/"
14 14
 
15 15
 - name: Make service file
@@ -29,11 +29,19 @@
29 29
     dest: "/tmp/{{ env }}/{{ node_ip }}/keys/bootstrap.sh"
30 30
   when: swarmnode.openstack.private_v4 != ""
31 31
 
32
+- name: Wait for ssh connection
33
+  wait_for:
34
+    host: "{{ node_ip  }}"
35
+    port: 22
36
+    delay: 2
37
+    timeout: 300
38
+    search_regex: OpenSSH
39
+
32 40
 - name: Transfer configureation
33
-  shell: scp -r "/tmp/{{ env }}/{{ node_ip }}/keys" "core@{{ node_ip }}:/home/core"
41
+  shell: scp -o "StrictHostKeyChecking=no" -r "/tmp/{{ env }}/{{ node_ip }}/keys" "core@{{ node_ip }}:/home/core"
34 42
 
35 43
 - name: Transfer certificate file over to the nodes
36
-  shell: scp -r "/tmp/{{ env }}/keys" "core@{{ node_ip }}:/home/core"
44
+  shell: scp -o "StrictHostKeyChecking=no" -r "/tmp/{{ env }}/keys" "core@{{ node_ip }}:/home/core"
37 45
 
38 46
 - name: Start services
39 47
   shell: ssh "core@{{ node_ip }}" "sh keys/bootstrap.sh"

Loading…
Cancel
Save