ANSIBLE & AWX mit GITHUB verbinden
-
Connecting to GitHub with HTTPS
The project creation process is pretty straightforward, just needing a name, SCM type (git), an address, and a credential.
The SCM URL can be found from the github repository, by clicking the clone option. This is the same URL you would use if cloning a repo manually, or with VSCode.
Creating a Personal Access Token
Connecting to github via HTTPS requires the creation and use of a Personal Access Token (PAT), rather than just entering your primary username and password. Of course, if you’re reading a public repository you don’t technically need a credential at all, but if you want to get a private repository you will need to authenticate. This token is created in your github account settings, under the developer options. The PAT creation option has great granularity in permissions, so you don’t need to give more rights than needed. In the case of a Tower project, we really only need to read repository data. If you’re connecting to a private repository, there doesn’t appear to be a way to grant only read rights, so you’ll need to grant full repo control.
Be sure to copy the generated token before closing the page!
Creating the Credential Object
The next step is to create a Tower credential object with the new PAT. The obvious credential type would appear to be GitHub Personal Access Token, but that would be wrong (imagine my surprise). The correct credential type is Source Control. Any other type will not be available to add to the project, which I guess makes sense. When creating the Source Control credential, use the GitHub username and the PAT as the password.
This is everything that’s needed to create a project. Navigate to the Projects page and create a new project for the github repo.
If everything was created correctly, you should see a successful job in tower of type SCM Update.
If the sync job completed successfully (green circle), you can now create a job template from any playbook in that project.
CREDITS: https://murrahjm.github.io/Source-Control-and-the-Tower-Project/