For a parameterized build with branch selection, you will need a plugin Active Choices Go to Jenkins settings Section "Manage Plugins" Go to the "Available" tab and specify "Active Choice" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized project, and add the …
Continue reading "Jenkins – Active Choice: Git branch"
By default, Jenkins uses your browser’s settings language. In order to force change it, you can use the Locale plugin Go to Jenkins settings Section "Manage Plugins" Go to the "Available" tab and specify "Locale" in the search. Install it. And back to Jenkins settings, tab "Configure System" Find the …
Continue reading "Jenkins – Change default language"
When trying to get a value from AWS SSM, Ansible Playbook using Python3 as an interpreter generates the following error: fatal: [localhost-py3]: FAILED! => {"changed": false, "msg": "AnsibleError: An unhandled exception occurred while templating '{{ lookup('aws_ssm', 'server_listeners', decrypt=false, region=’eu-west-1′) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup …
Continue reading "FIX ERROR – Ansible AWS SSM: AnsibleError: An unhandled exception occurred while templating"
HTTPS In order to be able to work with the Git repository in CodeCommit using the AIM role, AWS Cli must be installed on the instance. You will also need "credential-helper", for this we create a configuration file for Git: And copy the following into it: Now you can work with CodeCommit over …
Continue reading "CodeCommit – Git"
Check if the value of the variable "GIT_COMMIT_ID" is set, if so, then do a checkout by the hash of the commit, if not, then do a checkout by the name of the branch. The variable "GIT_BRANCH_NAME" is taken from the Active Choice parameter. Jenkinsfile:
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
The following error occurred while trying to delete the database in MS SQL: The database 'YOUR_DB_NAME' is enabled for database mirroring. Database mirroring must be removed before you drop the database. Solution: