Ansible is one of the popular configuration management tools. Ansible
can also be used for infrastructure provisioning as well in AWS. Please
find steps for installing Ansible on Apple Mac OS or laptop.
Ansible can be installed on Mac OS many ways, but preferred way is using pip which is a Python package manager.
Install Pip
If pip isn’t already available on your system, run the following commands to install it: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get-pip.py
pip --version
Once pip is installed, install Ansible using pip.
Install Ansible using Pip
To install ansible globally, use following command sudo -H pip3 install ansible
Once Ansible is installed, you can verify the version.
ansible --version
You should be able to see the version.
Install Boto framework
Boto is a Python package that provides interfaces to Amazon Web Service. It is AWS SDK for Python.
sudo pip install boto sudo pip install boto3
Create Ansible hosts file
when you install Ansible on Mac OS, it does not create ansible hosts file. so you need to create it.
sudo mkdir /etc/ansible
Watch the above steps as a video in YouTube channel:
Nexus 3 is one of the popular binary repository managers. It can be also
used to store Docker images as well besides storing binaries such as
WARs, EARs, Jars, DLLs and Exes.
Let us see how to configure Nexus to host as private Docker registry.
Pre-requisites:
Make sure Nexus is successfully configured, it is up and running.
Also do open port 8085 open as well besides port 8081 for Nexus.
Docker is setup and running.
Steps to configure Nexus 3 as Docker Registry:
1. Login to Nexus and click on Server Administration link at the top of the window. Click on Repositories.
2. Now click on create repository
3. Choose docker hosted repository
4. Choose the value as mentioned:
5. Click on Create repository.
Configure Realm
6. Move Docker Bearer Token realm to right by clicking on >
This settings allows docker repository to have anonymous read enabled.
7. after moving save it.
Please click below link to know how to create Docker image and push docker images into Nexus
Let's say you have forgotten Jenkins admin password. How to reset or retrieve the admin password? Here below are the steps for resetting Jenkins admin password:
1. Edit the Jenkins config.xml under /var/lib/jenkins to disable securityFlag by executing below command: sudo vi /var/lib/jenkins/config.xml
you need to disable security to Jenkins by below change 2. Find this <useSecurity>true</useSecurity> and change it to <useSecurity>false</useSecurity> 3. Restart Jenkins by below command: sudo service jenkins restart 4. Access Jenkins now, click on Manage Jenkins, click on configure Global security
5. click on Enable security
6. Click on Jenkins Own user database option.
7. click on apply and save
8. Now click on Manage users, click on admin, click on configure
9. Enter new password and apply/save
After changing the password, you will be able to log into your Jenkins controller again using the same username and the new password that you have just set.
Enable security
Log in as your admin account.
On the dashboard, select Manage Jenkins in the navigation pane on the left side of the page.
On the Manage Jenkins page, under the Security section, select Configure Global Security.
Set the Authorization to Logged-in users can do anything. Uncheck the option Allow anonymous read access. Select Save.
unzip awscliv2.zip sudo ./aws/install aws --version The above command should display the version like below:
aws-cli/2.0.33 Python/3.7.3 Linux/5.3.0-1030-aws botocore/2.0.0dev37
You can clean workspace using Workspace cleanup pluginin Jenkins after builds executions.
Install workspace clean up Plug-in
Free Style Job Workspace - cleanup
Go to your existing freestyle job, click on Post-Build actions --> Select Delete workspace when build is done option.
Now run the job. You should be able to see workspace is cleaned up after build is done inside Jenkins node. You will not see any folder with job name, in Ubuntu usually under /var/lib/jenkins/workspace/
Pipeline Job Workspace - cleanup code
Go to your existing pipeline job, you can code something like this below:
pipeline {
agent any
tools {
maven 'Maven3'
}
stages {
stage ("checkout") {
steps {
checkout logic here
}
}
stage ('build') {
steps {
sh "mvn clean install -f MyWebApp/pom.xml"
}
}
}