Skip to content

Var is not set before a role call from a playbook #336

Closed
@nikitakazantsev12

Description

@nikitakazantsev12

In a role called from a playbook we have the following task:

- name: Generate file.txt
  template:
    src: glogin.sql.j2
    dest: "{{ home }}/file.txt"
    backup: yes
  with_items:
    - "{{ databases }}"
  become: yes
  become_user: "{{ user }}"

Expected result: the file file.txt created in given path.

Actual result:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was:     names = os.listdir(path)
fatal: [xxx]: FAILED! =>
  msg: Unexpected failure during module execution.
  stdout: ''

Without "strategy: mitogen_linear" (with strategy: linear) the task works as expected.

Looks like when using mitogen strategy the var is not set before role is being called from a playbook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ansibleIssues relating to Mitogen for AnsiblebugCode feature that hinders desired execution outcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions