Closed ogajduse closed 1 year ago
My broker_settings.yaml
:
# Broker settings
debug: True
inventory_file: "inventory.yaml"
# Host Settings
host_username: "root"
host_password: "redhat"
# Provider settings
AnsibleTower:
instances:
- rhv:
base_url: "https://infra-ansible-tower-01.infra.ourdomain.com/"
# username: "ogajduse"
# password: ""
token: mytoken
default: True
- osp:
base_url: "https://infra-ansible-tower-01.infra.ourdomain.com/"
# username: "ogajduse"
# password: ""
token: mytoken
inventory: "satlab-osp-01-inventory"
- testing:
base_url: "https://dhcp-2-80.vms.ourdomain.com/"
#username: ""
#password: ""
inventory: "satlab-rhv-02-inventory"
username: ogajduse
password: ""
#default: True
release_workflow: "remove-vm"
extend_workflow: "extend-vm"
workflow_timeout: 3600
#results_limit: 50
my venv:
awxkit==17.1.0
broker @ file:///home/ogajduse/qa_repos/satelliteqe-github/broker
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
dynaconf==3.1.4
idna==2.10
logzero==1.7.0
PyYAML==5.4.1
requests==2.25.1
ssh2-python==0.26.0
urllib3==1.26.4
I found out that the _act
method gets called first with proivder AnsibleTower
and method execute
. Then it is called with same provider and method None
(Pdb) ll
121 def _checkout(self):
122 """checkout one or more VMs
123
124 :return: List of Host objects
125 """
126 hosts = []
127 if not self._provider_actions:
128 raise self.BrokerError("Could not determine an appropriate provider")
129 for action in self._provider_actions.keys():
130 provider, method = PROVIDER_ACTIONS[action]
131 logger.info(f"Using provider {provider.__name__} to checkout")
132 try:
133 -> host = self._act(provider, method, checkout=True)
134 except exceptions.ProviderError:
135 host = None
136 logger.debug(f"host={host}")
137 if host:
138 hosts.append(host)
139 logger.info(f"{host.__class__.__name__}: {host.hostname}")
140 return hosts
(Pdb) PROVIDER_ACTIONS
{'workflow': (<class 'broker.providers.ansible_tower.AnsibleTower'>, 'execute'), 'job_template': (<class 'broker.providers.ansible_tower.AnsibleTower'>, 'execute'), 'template': (<class 'broker.providers.ansible_tower.AnsibleTower'>, None), 'test_action': (<class 'broker.providers.test_provider.TestProvider'>, 'test_action'), 'inventory': (<class 'broker.providers.ansible_tower.AnsibleTower'>, None)}
(Pdb) action
'template'
(Pdb) provider
<class 'broker.providers.ansible_tower.AnsibleTower'>
(Pdb) print(method)
None
@jaryn what is the value of self._provider_actions
in the reproducer?
A reproducer that doesn't take so long time is
broker --log-level debug checkout --template deploy-sat-jenkins
A reproducer that doesn't take so long time is
broker --log-level debug checkout --template deploy-sat-jenkins
templates are not valid checkout actions for AnsibleTower, which is why they aren't listed under the help output for checkout
I did not realized that I reported duplicate of the issue that I reported earlier.
As I stated in #136, We agreed with @rdrazny that --template
is a valid option that can be passed to a workflow.
Do we know what is causing broker to fail with such error?
Reproducer