Code Monkey home page Code Monkey logo

Comments (6)

puppetmaster avatar puppetmaster commented on September 24, 2024 9

I used this "very dirty" but effective workaround ...

provisioner "ansible" {
    playbook_file = "${path.cwd}/provisionning/${var.name}/playbooks/${var.name}.yaml"
    ansible_env_vars = [
      "ANSIBLE_SSH_ARGS='-oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=ssh-rsa'",
      "ANSIBLE_HOST_KEY_CHECKING=False"
    ]
    user="${local.ssh_user}"
}

from packer-plugin-ansible.

Alexander-Giaquinto avatar Alexander-Giaquinto commented on September 24, 2024 1

@puppetmaster Yes, I used a similar approach. Best solution I found, that pleases business environments, is to build an image with packer first because packer has the ansible provisioner built it, then call that image in my terraform build whether it is AWS, proxmox, vmware etc. Then have ansible scripts set up for any extra needed configuration management. I know this requires more code, but the process is a little smoother.

from packer-plugin-ansible.

njpaul avatar njpaul commented on September 24, 2024

Same experience here.

Packer version: 1.7.3
Ansible version: 2.10.5
Python version: 3.6.9

from packer-plugin-ansible.

JMLX42 avatar JMLX42 commented on September 24, 2024

Same problem here.

Packer 1.7.5
Ansible Core 2.11.5
Python 3.9.7
Fedora 34

That workaround works though.

from packer-plugin-ansible.

Alexander-Giaquinto avatar Alexander-Giaquinto commented on September 24, 2024

Same issue here. The workaround is not business friendly.

from packer-plugin-ansible.

Y4suyuki avatar Y4suyuki commented on September 24, 2024

I had the same problem recently and I found aws ec2 inventory plugin for ansible could be a solution.
https://docs.ansible.com/ansible/latest/collections/amazon/aws/aws_ec2_inventory.html

I found this from my private repo created 3 years ago, so not sure this is relevant today.

working example.
https://github.com/Y4suyuki/whisper-server/blob/main/aws_ec2.yml

from packer-plugin-ansible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.