Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-17948

Creation of ansible roles with molecule tests doesn't work due to checkout directory name

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      When building ansible roles in an ansible-galaxy compatible manner (or forking them from github) the root of the ansible role definition is the root of the repository.

      Let's say we have a repo with a name of myname.ansible-role-name, which will result in an root file structure of:

      bitbucket-pipelines.yml
      defaults/
      files/
      handlers/
      meta/
      molecule/
      README.md
      requirements.txt
      tasks/
      templates/
      vars/
      

      When using molecule to test these locally you can just run "molecule test" in the root of this directory structure as long as the name of the directory you are in matches the name of the role specified in molecule/default/playbook.yml

      ie.

      ---
      - name: Converge
        hosts: all
        roles:
          - role: myname.ansible-role-name
      

      Then when you execute the pipeline to run your molecule tests the system is unable to find the role you have defined because it is checked out into the path defined by the BITBUCKET_CLONE_DIR of /opt/atlassian/pipelines/agent/build

      The proposed change would be that the code is checked out into
      /opt/atlassian/pipelines/agent/$BITBUCKET_REPO_SLUG
      instead to solve the problem (and creating a build symlink to this $BITBUCKET_REPO_SLUG would probably help for backwards compatibility).
      This will likely help other path aware/dependent code builds and automation pipelines.

      Attachments

        Activity

          People

            jderaedt Jeroen De Raedt
            4edcaf99292a Gerwin van de Steeg
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: