Open alexandrud opened 2 months ago
Apparently ansible does offer a way to do this at runtime. It has a couple of variables to manipulate this. I ended up with:
resource "ansible_playbook" "playbook" {
for_each = toset(var.ansible_playbooks)
playbook = each.key
name = vsphere_virtual_machine.vm.default_ip_address
replayable = var.ansible_replayable
tags = var.ansible_tags
verbosity = var.ansible_verbosity
extra_vars = {
ansible_ssh_host_key_checking = var.ansible_ssh_host_key_checking
}
}
Hi,
Are there no configuration options for the Ansible provider? In my case, since I'm working on a proof of concept, I re-build a VM with the same IP several times. Since the key for the host changes, the playbook fails. I looked around for documentation on provider configuration options, but could not find anything. It would be nice to be able to set options for the provider from the configuration block. Maybe follow the
ansible.cfg
structure: https://docs.ansible.com/ansible/latest/reference_appendices/config.html