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

failed: ansible-galaxy -fr roles/requirements.yml #4

Open
tjyang opened this issue Jan 18, 2022 · 3 comments
Open

failed: ansible-galaxy -fr roles/requirements.yml #4

tjyang opened this issue Jan 18, 2022 · 3 comments

Comments

@tjyang
Copy link

tjyang commented Jan 18, 2022

Describe the bug

I am new on ansible tool, not able to figure out the error message myself from ansible-galaxy error.

To Reproduce
Steps to reproduce the behavior:

  1. ansible version
    [me@rocky8t01 awx-turnkey]$ ansible --version
    ansible 2.9.27
    config file = /etc/ansible/ansible.cfg
    configured module search path = ['/home/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python3.6/site-packages/ansible
    executable location = /usr/bin/ansible
    python version = 3.6.8 (default, Nov 9 2021, 14:44:26) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
    [me@rocky8t01 awx-turnkey]$

  2. ansible can ping itself
    [me@rocky8t01 awx-turnkey]$ ansible rocky8t01 -m ping
    [DEPRECATION WARNING]: Distribution centos 8.5 on host rocky8t01 should use /usr/libexec/platform-python, but is using /usr/bin/python
    for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python
    for this host. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. This
    feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
    rocky8t01 | SUCCESS => {
    "ansible_facts": {
    "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
    }
    [me@rocky8t01 awx-turnkey]$

  3. ansible-galaxy

[me@rocky8t01 awx-turnkey]$ ansible-galaxy --version
ansible-galaxy 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-galaxy
python version = 3.6.8 (default, Nov 9 2021, 14:44:26) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
[me@rocky8t01 awx-turnkey]$

  1. git remote repo info
    [me@rocky8t01 awx-turnkey]$ git remote -v
    origin https://github.com/miracle-as/awx-turnkey.git (fetch)
    origin https://github.com/miracle-as/awx-turnkey.git (push)

  2. See error
    [me@rocky8t01 awx-turnkey]$ ansible-galaxy -fr roles/requirements.yml
    usage: ansible-galaxy role [-h] ROLE_ACTION ...
    ansible-galaxy role: error: argument ROLE_ACTION: invalid choice: 'roles/requirements.yml' (choose from 'init', 'remove', 'delete', 'list', 'search', 'import', 'setup', 'info', 'install')
    [me@rocky8t01 awx-turnkey]$

  3. end

Expected behavior
ansible-galaxy should not produce error message

Desktop (please complete the following information):

  • OS: [e.g. iOS]
    [me@rocky8t01 awx-turnkey]$ cat /etc/redhat-release
    Rocky Linux release 8.5 (Green Obsidian)
    [me@rocky8t01 awx-turnkey]$
@tjyang
Copy link
Author

tjyang commented Jan 18, 2022

@JakobHolstDK , can you advise what is the version of your ansible and ansible-galaxy ?

@pankajps
Copy link

pankajps commented Feb 2, 2022

The step where you say to update the role should use the command "ansible-galaxy install -fr roles/requirements.yml". Without the word install the command fails.

@tjyang
Copy link
Author

tjyang commented Feb 2, 2022

@JakobHolstDK

  • ansible-galaxy version info
[me@rocky8t01 awx-turnkey]$ ansible-galaxy --version
ansible-galaxy 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible-galaxy
  python version = 3.6.8 (default, Nov  9 2021, 14:44:26) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
[me@rocky8t01 awx-turnkey]$

@pankajps

  • with "install" argument, it works !. Thanks.
[me@rocky8t01 awx-turnkey]$ ansible-galaxy install -fr roles/requirements.yml
- extracting miracle-ansible-role-awxrpm-scl-installer to /home/me/.ansible/roles/miracle-ansible-role-awxrpm-scl-installer
- miracle-ansible-role-awxrpm-scl-installer (master) was installed successfully
[me@rocky8t01 awx-turnkey]$

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

2 participants