Code Monkey home page Code Monkey logo

Comments (3)

mbainter avatar mbainter commented on September 23, 2024

Of note, this is particularly problematic and reproducible when using galaxy_force_install = true

from packer-plugin-ansible.

timblaktu avatar timblaktu commented on September 23, 2024

Ugh, I started hitting this too when I made some changes to the project that caused my vsphere-clone and virtualbox-ovf builders to provision around the same time. Perhaps I'll stick in a "sleep" provisioner to delay one of the builders, like this:

provisioner "shell" {
    only = ["vsphere-clone.dev-env"]
    inline_shebang = "/bin/bash -l"
    inline = [
      "echo Delaying the vSphere provisioner a bit to prevent ansible-galaxy collisions.",
      "echo This is a workaround for https://github.com/hashicorp/packer-plugin-ansible/issues/21...",
      "sleep 30"
    ]
  }

Assuming packer builder environments do NOT provide any sort of separation of ansible workspaces, it would seem that another workaround would be to separate the provisioners for each builder using only/except, and for each provide a different roles path and collections_path. In theory, this would inform the separate ansible processes (spawned by separate packer builder processes) to install roles and collections from ansible-galaxy into distinct folders. (It also tells the ansible processes where to look for roles/collections at runtime..)

Seems like that would work, but man what a mess to have to implement as a workaround. I'm all ears if someone else has ideas.

from packer-plugin-ansible.

sdejong629 avatar sdejong629 commented on September 23, 2024

Yeah, I still have this issue. It tries to (forceably) install a role that is in use by another build. Omitting the galaxy_force will result in errors about a role already being present. I've solved this by adding the roles to the actual repository and not using ansible galaxy to install them

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.