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

created new proxy for non-admin user #17230

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/foreman/cli/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,15 @@ def _finalize():
)
assert result.status == 0, f'Failed to register host: {result.stderr}'
proxy_id = target_sat.nailgun_smart_proxy.id
new_port = target_sat.available_capsule_port
with target_sat.default_url_on_new_port(9090, new_port) as url:
proxy_id_new = target_sat.api.SmartProxy(url=url).search(
query={'search': f'name={target_sat.hostname}'}
)[0]
target_host = rhel_contenthost.nailgun_host
new_proxy = proxy_id if auth_type == 'admin' else proxy_id_new
target_sat.cli.Ansible.with_user(username, password).roles_sync(
{'role-names': SELECTED_ROLE, 'proxy-id': proxy_id}
{'role-names': SELECTED_ROLE, 'proxy-id': new_proxy}
)
result = target_sat.cli.Host.with_user(username, password).ansible_roles_assign(
{'id': target_host.id, 'ansible-roles': f'{SELECTED_ROLE}'}
Expand Down
Loading