I am trying to clone a repository from our internal Bitbucket server. The server runs with a self signed certificate. The clone operation breaks due to Peer's Certificate issuer is not recognized.
As a workaround, I tried to disabled SSL verification via the .gitconfig for the root user on the awx-task container, but with no luck. The process forked by AWX seems to ignore that. Second problem would be that this is just a transient solution.
The following Stackoverflow post describes another issue related to this:
https://serverfault.com/questions/877530/git-called-by-awx-ignores-manually-installed-root-ca
This is essentially a showstopper for us, as we cannot clone Ansible provisioning code without pain.
1.0.1.812.4.0.062.0.3202.62Project via the UIProject creation page that disables SSL verification for the given projectgit clone task command needs to leverage that setting
closing as duplicate of #416
To turn off certificate verification completely add AWX_TASK_ENV['GIT_SSL_NO_VERIFY'] = 'True' to /etc/tower/settings.py within the awx_task container and restart it.
A nicer solution is to copy the self-signed certificate (not the key) to /etc/pki/ca-trust/source/anchors/ on awx_task container and run update-ca-trust extract within. Make sure to configure AWX with the correct hostname of the git server, matching the certificate subject.
This is not working.. Any ideas?
PATCH /api/v1/settings/jobs/
{
"AWX_TASK_ENV": {
"GIT_SSL_NO_VERIFY": "True"
}
}
EDIT: AWX_TASK_ENV has "defined_in_file": true, is possible to override it somehow?
@muhahacz after running a job, can you visit:
GET /api/v2/project_updates/N/
...and confirm that GIT_SSL_NO_VERIFY is properly set under the job_env key?
@ryanpetrello
GIT_SSL_NO_VERIFY is not set ..
In fact I guess that I cannot set any AWX_TASK_ENV variable, if this option has "defined_in_file": true set.
I can not event set it in web gui ( http://awx/#/configuration/jobs )
Extra environment variables: (This setting has been manually in a setting file and is now disabled)
@muhahacz you've defined AWX_TASK_ENV in a .py setting file somewhere on the file system, which makes it read-only (and not editable from the API).
This is not working.. Any ideas?
PATCH /api/v1/settings/jobs/ { "AWX_TASK_ENV": { "GIT_SSL_NO_VERIFY": "True" } }EDIT: AWX_TASK_ENV has "defined_in_file": true, is possible to override it somehow?
@lukasmrtvy The following response above you from @kuklis helped me in the workaround.
To turn off certificate verification completely add AWX_TASK_ENV['GIT_SSL_NO_VERIFY'] = 'True' to /etc/tower/settings.py within the awx_task container and restart it.
@ryanpetrello
GIT_SSL_NO_VERIFY is not set ..In fact I guess that I cannot set any AWX_TASK_ENV variable, if this option has "defined_in_file": true set.
I can not event set it in web gui ( http://awx/#/configuration/jobs )
Extra environment variables: (This setting has been manually in a setting file and is now disabled)
I know it's been a while for that issue, but hope it will assist others.
You can add this extra variable in the Jobs Settings via the AWX web interface (http://awx/#/settings/jobs) under "EXTRA ENVIRONMENT VARIABLES"
Additional information in the documentation: https://docs.ansible.com/ansible-tower/latest/html/administration/configure_tower_in_tower.html#jobs
{
"GIT_SSL_NO_VERIFY": "True"
}
Most helpful comment
To turn off certificate verification completely add
AWX_TASK_ENV['GIT_SSL_NO_VERIFY'] = 'True'to/etc/tower/settings.pywithin the awx_task container and restart it.A nicer solution is to copy the self-signed certificate (not the key) to /etc/pki/ca-trust/source/anchors/ on awx_task container and run
update-ca-trust extractwithin. Make sure to configure AWX with the correct hostname of the git server, matching the certificate subject.