Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix symlinks creation in ansible provisioneer #4134

Merged
merged 2 commits into from Feb 13, 2024
Merged

Fix symlinks creation in ansible provisioneer #4134

merged 2 commits into from Feb 13, 2024

Conversation

rakhinskiy
Copy link
Contributor

When I use

provisioner:
  name: ansible
  ...
  inventory:
    links:
      .files: ../.inventory/.files
      host_vars: ../.inventory/host_vars
      group_vars: ../.inventory/group_vars

I receive FileExistError

Traceback (most recent call last):
  File ".venv/bin/molecule", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File ".venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/molecule/command/test.py", line 113, in test
    base.execute_cmdline_scenarios(scenario_name, args, command_args, ansible_args)
  File ".venv/lib/python3.11/site-packages/molecule/command/base.py", line 124, in execute_cmdline_scenarios
    execute_scenario(scenario)
  File "venv/lib/python3.11/site-packages/molecule/command/base.py", line 167, in execute_scenario
    execute_subcommand(scenario.config, action)
  File ".venv/lib/python3.11/site-packages/molecule/command/base.py", line 157, in execute_subcommand
    return command(config).execute(args)
           ^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/molecule/command/base.py", line 57, in __init__
    self._setup()
  File ".venv/lib/python3.11/site-packages/molecule/command/base.py", line 76, in _setup
    self._config.provisioner.manage_inventory()
  File ".venv/lib/python3.11/site-packages/molecule/provisioner/ansible.py", line 838, in manage_inventory
    self._link_or_update_vars()
  File ".venv/lib/python3.11/site-packages/molecule/provisioner/ansible.py", line 912, in _link_or_update_vars
    os.symlink(source, target)
FileExistsError: [Errno 17] File exists: 'roles/common/molecule/docker-al-8/../.inventory/.files' -> '.cache/molecule/common/docker-al-8/inventory/.files'

@rakhinskiy rakhinskiy requested a review from a team as a code owner February 8, 2024 23:36
@github-actions github-actions bot added the bug label Feb 8, 2024
@cristianonicolai cristianonicolai merged commit 4767203 into ansible:main Feb 13, 2024
13 of 15 checks passed
@rakhinskiy rakhinskiy deleted the fix-provisioner-ansible-symlink-update branch February 13, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants