mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
Merge pull request #3545 from chrismeyersfsu/fix-tower_header_on_insights_playbook_fetches
include tower header to insights on plan fetch Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -40,10 +40,20 @@ class ActionModule(ActionBase):
|
||||
username = self._task.args.get('username', None)
|
||||
password = self._task.args.get('password', None)
|
||||
proj_path = self._task.args.get('project_path', None)
|
||||
license = self._task.args.get('awx_license_type', None)
|
||||
awx_version = self._task.args.get('awx_version', None)
|
||||
|
||||
session = requests.Session()
|
||||
session.auth = requests.auth.HTTPBasicAuth(username, password)
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': '{} {} ({})'.format(
|
||||
'AWX' if license == 'open' else 'Red Hat Ansible Tower',
|
||||
awx_version,
|
||||
license
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
url = '{}/r/insights/v3/maintenance?ansible=true'.format(insights_url)
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
# scm_revision: current revision in tower
|
||||
# scm_revision_output: where to store gathered revision (temporary file)
|
||||
# roles_enabled: Allow us to pull roles from a requirements.yml file
|
||||
# awx_version: Current running version of the awx or tower as a string
|
||||
# awx_license_type: "open" for AWX; else presume Tower
|
||||
|
||||
- hosts: all
|
||||
connection: local
|
||||
@@ -110,6 +112,8 @@
|
||||
username: "{{scm_username}}"
|
||||
password: "{{scm_password}}"
|
||||
project_path: "{{project_path}}"
|
||||
awx_license_type: "{{awx_license_type}}"
|
||||
awx_version: "{{awx_version}}"
|
||||
register: results
|
||||
|
||||
- name: Save Insights Version
|
||||
|
||||
Reference in New Issue
Block a user