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

Make the binary path of "brew" accessible outside role context #99

Open
SPR0STO opened this issue May 7, 2024 · 0 comments
Open

Make the binary path of "brew" accessible outside role context #99

SPR0STO opened this issue May 7, 2024 · 0 comments

Comments

@SPR0STO
Copy link

SPR0STO commented May 7, 2024

Binary file "brew" not found after successful play of role

ANSIBLE VERSION

ansible [core 2.14.0]
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

OS / ENVIRONMENT

macOS Sonoma

STEPS TO REPRODUCE

cat Homebrew.yml
- name: Homebrew
  hosts: remote_host
  ignore_errors: True
  tasks:
    - name: Install Homebrew 
      ansible.builtin.include_role:
        name: geerlingguy.mac.homebrew
    - name: Git version by command
      ansible.builtin.command: git --version
    - name: Git version by shell
      ansible.builtin.shell: which git && $(which git) --version
    - name: Brew version by command
      ansible.builtin.command: brew --version
    - name: Brew version by shell
      ansible.builtin.shell: which brew && $(which brew) --version

ansible-playbook Homebrew.yml

EXPECTED RESULTS

The executable file "brew" founded.
The executable file "brew" runs successfully with command line options

ACTUAL RESULTS

TASK [Git version by command] 
changed: [remote_host] => {
    "changed": true,
    "cmd": [
        "git",
        "--version"
    ],
    "delta": "0:00:00.007289",
    "end": "2024-05-07 16:22:17.812074",
    "invocation": {
        "module_args": {
            "_raw_params": "git --version",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true
        }
    },
    "msg": "",
    "rc": 0,
    "start": "2024-05-07 16:22:17.804785",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "git version 2.39.3 (Apple Git-146)",
    "stdout_lines": [
        "git version 2.39.3 (Apple Git-146)"
    ]
}

TASK [Git version by shell] 
changed: [remote_host] => {
    "changed": true,
    "cmd": "which git && $(which git) --version",
    "delta": "0:00:00.012526",
    "end": "2024-05-07 16:22:19.093296",
    "invocation": {
        "module_args": {
            "_raw_params": "which git && $(which git) --version",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true
        }
    },
    "msg": "",
    "rc": 0,
    "start": "2024-05-07 16:22:19.080770",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "/usr/bin/git\ngit version 2.39.3 (Apple Git-146)",
    "stdout_lines": [
        "/usr/bin/git",
        "git version 2.39.3 (Apple Git-146)"
    ]
}

TASK [Brew version by command] 
fatal: [remote_host]: FAILED! => {
    "changed": false,
    "cmd": "brew --version",
    "invocation": {
        "module_args": {
            "_raw_params": "brew --version",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true
        }
    },
    "msg": "[Errno 2] No such file or directory: b'brew'",
    "rc": 2,
    "stderr": "",
    "stderr_lines": [],
    "stdout": "",
    "stdout_lines": []
}

fatal: [remote_host]: FAILED! => {
    "changed": true,
    "cmd": "which brew && $(which brew) --version",
    "delta": "0:00:00.004781",
    "end": "2024-05-07 16:22:21.915563",
    "invocation": {
        "module_args": {
            "_raw_params": "which brew && $(which brew) --version",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2024-05-07 16:22:21.910782",
    "stderr": "",
    "stderr_lines": [],
    "stdout": "",
    "stdout_lines": []
}
SPR0STO added a commit to SPR0STO/ansible-collection-mac that referenced this issue May 9, 2024
SPR0STO added a commit to SPR0STO/ansible-collection-mac that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant