Ansible-vault password in Jenkins

Ansible is one of my favorite tools. I use them for almost everything – system configuration, servers provisioning, serverless services provisioning and even for calling API that hasn’t its own Ansible module. You can do everything with Ansible! Moreover, you can also use Jenkins to run Ansible. I’m very glad that it’s possible and I use that possibility as often as possible. Of course, only if it makes sense. Also, I’m sure that it’s normal practice, as somebody develops an Ansible plugin for Jenkins. Anyway, one of the very, very important Ansible’s feature is ansible-vault, that allows to encrypt sensitive Continue reading

Please install google-auth library – Ansible problem

Ansible is a great tool used by many engineers to automate their work. Also, Ansible is growing very, very fast. It means, that there are many bugs inside that tool. Sometimes bug is not a problem – especially when it doesn’t exist – but not fully written documentation. This is probably the reason for the problem I want to describe. If you use Ansible for GCP deployment, you may face the failure reason saying “Please install google-auth library”. But what if you are sure, that you have this library installed? TL;DR – just give me a solution! Run your playbook Continue reading

Ansible 2.8 sudo escalation problem

If you use Ansible, probably you have some habits, that are hard to give them up. Also, many people have a very nasty sin – they ignore deprecation warnings. Moreover, some of them even like turning off warnings about deprecated features! And due to that, they are forced to digging the Internet and looking for the solution to their problem. But there is also another reason for digging – lack of documentation. It’s hard to say what is the cause of the problem which I’m going to describe, but I assume that both causes may be possible. Ok, so what’s Continue reading

How to pass credentials to Jenkins pipeline

Working with sensitive data is a hard thing nowadays. Especially in a DevOps methodology. New tools and ways of solving problems don’t make it easier. Well, for some reasons, DevSecOps came to life. Almost all systems need some type of credentials – password, API tokens, keys, certificates and so on. In Infrastructure as a Code, Configuration as a Code and other approaches like these mentioned, working with git repositories is necessary. But it’s a very bad practice to store credentials in a plain text. I hope that I don’t need to explain why. Luckily, most of the mature tools have Continue reading

Retry failed build in Jenkins

Failing build is not what we want to have in out Jenkins, but it happens sometimes. Not always it means that something “went terribly wrong”, but it can be a temporary problem in communication with the code repository or another, not dangerous error. In such cases, it would be great if the build could be retried in an automated way. It’s possible and very simple to implement with Jenkins. Moreover, we don’t need to create a complex configuration. Everything we need is just a plugin – Retry Failed Builds plugin. There are a lot of helpful plugins in Jenkins, and Continue reading

How to set a constant in Jenkins DSL

Working with the Jenkins DSL configuration is quite easy. But we need to remember about best practices and do some work for ourselves. Just to simplify out live. One of these things is creating good code. We should extract repeating code blocks and use them in different places. Let’s assume, that we want to create granular permissions – Alice has permissions only for Job A, but Bob has permissions for both, Job A and Job B. As you see, we have now two jobs and two users. But we don’t know when we will have to add more users. And Continue reading

Fail to load plugin Findbugs SonarQube 7.4

SonarQube is a very powerful tool, which can be used to inspect your code quality. It is able to detect bugs, code smells, and security vulnerabilities and provides continuous inspections. Many Developers and the whole Teams use this fantastic tool on a daily basis. SonarSource is improving SonarQube, so it’s a normal behavior, that sometimes we need to upgrade our application to a newer version. If you just did that and now you see “Fail to load plugin Findbugs” in your logs, AND you tried to upgrade to the 7.4 version, I think I have a solution of your problem. Continue reading

Jenkins DSL Authorization Matrix loop

Authorization Matrix is one of my favorite Jenkins functionality. It allows managing permissions per Project what gives enough granularity. But when you have a lot of Projects, you can find Jenkins DSL Plugin very helpful. Especially when you start your adventures with Jenkins, those two plugins can make your life easier. As you use Jenkins, I suppose you are in love with automation. You try to automate and optimize everything. And if you read this post, it’s more than certain that you faced the same problem I had faced in my work. How to create a Jenkins DSL Authorization Matrix Continue reading

Jenkins Job DSL Playground – how it works

Working with Jenkins Job DSL code sometimes is a pain in the neck. Especially if you have very big and complex scripts. You can make a mistake very quickly, so it would be great if there could be a way to test your code before the seed deployment. Of course, you can test your DSL scripts outside of Jenkins, but sometimes you don’t need to run the whole bunch of tests, right? You just want to check only the small part of your code… What if I tell you that you can do that? Ladies and gentleman, let me introduce Continue reading

Jenkins Job DSL Playground Docker image

I have been using Jenkins Job DSL Playground since I realized that DSL is the best option for managing Jenkins jobs. If you have a lot of them, changing anything can be very painful without any automation. Jenkins DSL Plugin allows transforming configuration into the code and store that in the Git repository. But, you know, sometimes changes are very complex and you can make a mistake, hence I needed something that helps me. And I found it – Jenkins Job DSL Playground. It was obvious for me, that I can also use a docker image, but I couldn’t find Continue reading