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

Add button for new inventory source not appearing for inventory admin users #9297

Closed
unixsysadmin opened this issue Feb 12, 2021 · 8 comments

Comments

@unixsysadmin
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

Add button for new inventory source not appearing for inventory admin users

ENVIRONMENT
  • AWX version: 17.0.1
  • AWX install method: docker on linux
  • Ansible version: 2.9.17
  • Operating System: CentOS 8.3
  • Web Browser: Firefox
STEPS TO REPRODUCE
  • Create an organization
  • Add a user to that organization
  • Make that user an Inventory Admin, in this case this is achieved via Team Roles

Screen Shot 2021-02-12 at 13 33 28

  • Create a new inventory as that user
  • Navigate to the inventory sources for the inventory
  • Add a new inventory source using the 'add' button
EXPECTED RESULTS

The Add button should be displayed to allow you to add the source.

Screen Shot 2021-02-12 at 13 35 21

ACTUAL RESULTS

The Add button to allow the additional source is not shown.

Screen Shot 2021-02-12 at 13 36 12

ADDITIONAL INFORMATION

When logged in as the 'admin' account to AWX, navigating to the same inventory source page shows the 'Add' button.

Using the AWX 17.0.1 Collection to add an inventory source as the same inventory admin user works successfully, so we know the user has the correct privileges. Sample code:

  - name: Add required inventory sources
    tower_inventory_source:
      name: "{{ item.name }}"
      description: "{{ item.description }}"
      organization: "{{ item.organization }}"
      state: present
      inventory: "{{ item.inventory }}"
      source: "{{ item.source }}"
      source_project: "{{ item.project }}"
      source_path: "{{ item.path }}"
      overwrite: "{{ item.overwrite }}"
      overwrite_vars: "{{ item.overwrite_vars }}"
      update_on_project_update: "{{ item.update_on_project_update }}"
      tower_host: "{{ tower_host }}"
      tower_username: "{{ awx_username }}"
      tower_password: "{{ awx_user_password }}"
    no_log: no
    loop: "{{ inventory_sources }}"
@unlikelyzero
Copy link

We will need to add a regression test in this area

@AlexSCorey
Copy link
Member

I believe this is an api bug because an options request to /inventory_sources does not return POST for a user that has inventory admin

@kladiv
Copy link

kladiv commented May 24, 2021

+1
UPDATE:

  • a team (or user) with "Inventory Admin" role of the Organization should be allowed to create an Inventory Source
  • a team (or user) with "Admin" role of the specific Inventory should be allowed to create an Inventory Source

@fosterseth fosterseth assigned fosterseth and unassigned fosterseth Jun 4, 2021
@AlanCoding

This comment has been minimized.

@AlanCoding
Copy link
Member

Sorry, I had the wrong info there, was confused looking at inventory vs. inventory source. This may be really simple, see #10372

@thenets
Copy link
Member

thenets commented Jun 24, 2021

  • Tests passed on latest AWX v̶e̶r̶s̶i̶o̶n̶ build ✅

@kladiv
Copy link

kladiv commented Jun 24, 2021

is this issue solved in the latest released AWX version?

@thenets
Copy link
Member

thenets commented Jun 25, 2021

@kladiv I corrected myself on the comment above. The tests passed on latest build:

  • The fixes are available on "devel" branch
  • Also, should be available next AWX release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants