To get the IP addresses of all instances with the "Application" tag and its value "Frontend", and also filter by state to display information about only those instances that are in the "running" state: To display the name of instance along with the IP address:
An example of how to get the IP address of another host from the "hosts" file by performing a task on another host. server1 – our Playbook will be executed on it server2 – we need its IP address in the Playbook hosts: In order to get the IP address, we will …
Continue reading "Ansible – Get the IP address of another host from the hosts file"
There is a "hosts" file in which there is a group of "db". These are database instances that play a different role. The goal is to add the role type to the "hosts" file, so that later we can use this value in a loop that will be executed on a completely different host, …
Continue reading "Ansible – Use values in a loop from hosts file on another host"
There is a "hosts" file in which in the "db" group there are N number of hosts, you need to automatically set a variable in the playbook equal to the number of hosts in a particular group hosts example.yaml
If a variable is used in Jenkins Pipeline that is created on the basis of a Webhook or etc, then a task will fail with a manual start. To avoid this, you can add a check for the existence of a variable and set its value. In this example, the presence of the …
Continue reading "Jenkins – Check for the existence of a variable"
When creating an HTTP/HTTPS subscription in AWS SNS, you can observe that the subscription is hanging in the status: "Pending confirmation" SNS to the specified URL makes a POST request in which it sends data in JSON format and expects to receive a key value in response: "SubscribeURL". But if the application does not …
Continue reading " AWS SNS – HTTP(S) Subscription: manual confirmation"
Install Java OpenJDK, as it is a dependency for Jenkins. The latest versions of Jenkins are compatible with version 11, so let’s install it. To add the Jenkins repository, you will need the "wget" utility, if it is not installed, then install: Add the repository and import its key: Install Jenkins: …
Continue reading "CentOS 7 – Jenkins install"
In this example, we will create a Terraform module for the AWS provider, which will be launched for 3 different environments using Terragrunt. Requirements: Installed AWS CLI Installed Terraform (version above 12.0) Installed Terragrunt
An example of a pipeline for working with the plugin for kubernetis. We build the maven project, create a docker image with the received artifact and push it into the docker image storage. Pipeline: Dockerfile – already created in the pipeline itself. envVar – taken from the secret of kubernetes
Dockerfile: