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

Kubernetes cluster in GKE – first steps

I use MacBook Pro on a daily basis, so I have no problem with Kubernetes cluster. I can just enable it in Docker for Mac configuration and then I can do almost whatever I want. If you use Linux or Windows, you can choose for example Minikube for testing purposes. But sometimes it’s not enough. There are some cases when you need something more – maybe you want to check how your application will behave in a more complex environment or just your workstation is not strong enough to run particular deployments. In such cases, Kubernetes cluster in GKE can 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

Nginx Ingress in GKE – wrong client IP

Google Cloud Platform is one of the leading Cloud Providers, with Amazon Web Services and Microsoft Azure. Many people think that AWS is the best choice because is the most mature. But with “the best” cloud provider is like with anything in the IT world – it depends. When we talk about the Kubernetes, the leading container orchestration tool, it seems that Google Cloud Platform is the best option. After all, Kubernetes has been designed and built by Google, and how it’s maintained by the Cloud Native Computing Foundation with Google as the founding member. So it should be a 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