@@ -176,10 +176,10 @@ def cmd_terraform(configure_data, base_project, dryrun, workspace='default', des
176176 cmds = []
177177 terraform_common_cmd = [config .get_terraform_bin (), f"-chdir={ cfg_paths ['provider' ]} " ]
178178 if destroy :
179+ cmds .append (terraform_common_cmd + ['destroy' , '-auto-approve' , '-no-color' ])
179180 if workspace != 'default' :
180181 cmds .append (terraform_common_cmd + ['workspace' , 'select' , 'default' , '-no-color' ])
181182 cmds .append (terraform_common_cmd + ['workspace' , 'delete' , workspace , '-no-color' ])
182- cmds .append (terraform_common_cmd + ['destroy' , '-auto-approve' , '-no-color' ])
183183 else :
184184 cmds .append (terraform_common_cmd + ['init' , '-no-color' ])
185185 if workspace != 'default' :
@@ -260,7 +260,7 @@ def ansible_command_sequence(configure_data_ansible, base_project, sequence, ver
260260 if 'roles_path' in configure_data_ansible :
261261 original_env ['ANSIBLE_ROLES_PATH' ] = configure_data_ansible ['roles_path' ]
262262
263- # 2. Verify that needed binary are usable
263+ # 2. Verify that the two needed binaries are usable
264264 ansible_bin_paths = {}
265265 for ansible_bin in ['ansible' , 'ansible-playbook' ]:
266266 binpath = shutil .which (ansible_bin )
@@ -292,6 +292,16 @@ def ansible_command_sequence(configure_data_ansible, base_project, sequence, ver
292292 ansible_cmd_seq .append ({'cmd' : ['mkdir' , '-p' , junit ]})
293293
294294 ssh_share = ansible_common .copy ()
295+
296+ # This is to avoid any manual intervention during first connection.
297+ # Without this code it is usually needed to interactively
298+ # accept the ssh host fingerprint.
299+ # It is implemented using https://docs.ansible.com/ansible/latest/command_guide/intro_adhoc.html
300+ # - the binary used is 'ansible' instead of 'ansible-playbook'
301+ # - option 'all' runs the same command on all hosts in the inventory (that comes from ansible_common)
302+ # - '-a' is for running a single command remotely,
303+ # - 'true' is just the simplest possible command as th epoint is not what we run but establishing a first connection
304+ # to have the fingerprint saved in the local known_host file.
295305 ssh_share [0 ] = ansible_bin_paths ['ansible' ]
296306 # Don't set '--ssh-extra-args="..."' but 'ssh-extra-args=...'
297307 # for avoiding the ansible ssh connection failure introduced by
0 commit comments