Posts
AWS Certified Solutions Architect - Associate
AWS Certified Solutions Architect - Associate is one of the most sought-after certifications in the IT industry.
Here’s a few tips for those seeking this certification.
Background Knowledge And Experience AWS recommends “at least one year of hands-on experience designing available, cost-efficient, fault-tolerant, and scalable and distributed systems on AWS.” In other words, if you recently started your career in IT, there are a few things you have to do before you start preparing for this certification.
read morePosts
Run Your Own OpenVPN Server
Introduction The article explains how to run your own OpenVPN server. We will create a Certificate Authority Server and an OpenVPN server. We will also generate certificates for the clients. We will also learn how to manage revocation of client certificates using the Ansible roles.
Use the Ansible roles gavika.openvpn and gavika.easy_rsa to install and configure your OpenVPN server.
You can install the OpenVPN server on any public cloud or hosting provider or on-premise servers.
read morePosts
Creating Administrative Linux User Accounts: gavika.administrators
We are pleased to announce gavika.administrators.
The Ansible role provides a declarative method to create Linux user accounts with administrative privileges. In other words, these users have sudo access without password and are empowered to run all commands on the system.
You might be wondering why you would need a role when you can write a couple tasks yourselves in an Ansible playbook. The reason is, Do Not Repeat Yourself(DRY). Instead of writing such tasks over and over, use the abstraction provided by the role.
read morePosts
How To Determine Your Public IP Address Programmatically From An Ansible Task
Short answer: use ipify
ipify provides a simple public address API.
Using the tool, you can determine your public IP address programmatically. If you are using the shell:
curl 'https://api.ipify.org' Using it in a shell script:
my_ip=$(curl 'https://api.ipify.org' -s) echo $my_ip Using the Ansible ipify module:
- hosts: localhost vars: tasks: - name: Get my public IP ipify_facts: timeout: 20 delegate_to: localhost register: public_ip - name: output debug: msg="{{ ipify_public_ip }}" Sample output of Ansible playbook execution:
read morePosts
Gavika Ansible Roles
Yesterday, we announced the launch of Ansible role to install and configure AWS CloudWatch Agent.
You might have seen my other open source Ansible roles on Ansible Galaxy and Github.
In the same spirit, the company, Gavika Information Technologies Pvt. Ltd. Bangalore, has started publishing open source projects on Github.
Ansible role to install and configure AWS CloudWatch Agent is the first project. Expect more projects in the future.
These are some guidelines for the Ansible role projects that Gavika follows:
read morePosts
Installing AWS CloudWatchAgent On EC2 Instance Via Ansible
Install the Ansible role gavika.aws_cloudwatchagent via Galaxy ansible-galaxy install gavika.aws_cloudwatchagent Create The Playbook File - cw-play.yml : --- - hosts: all become: true vars: roles: - role: gavika.aws_cloudwatchagent Prepare the AWS CloudWatch Agent configuration In your variables file, use aws_cloudwatch_agent_config
agent: metrics_collection_interval: 60 run_as_user: "cwagent" metrics: namespace: "Gavika" append_dimensions: InstanceId: "${aws:InstanceId}" metrics_collected: disk: measurement: - used_percent metrics_collection_interval: 60 resources: - "*" mem: measurement: - mem_used_percent metrics_collection_interval: 60 In this example, I am using the namespace, Gavika.
read morePosts
Simple Password Vault With Ansible
Ansible comes with a vault feature. It is meant to be used in the context of configuration management. But you can also use it as a standalone simple password vault for your personal or organization’s use.
Initial setup of password vault:
Create or clone a Git or another SCM repository git init Create the password vault ansible-vault create myvault.secret Type the new master password and confirm, ansible-vault will open your text editor.
read morePosts
PostgreSQL Cheatsheet
Install PostgreSQL Server Fedora and CentOS:
sudo dnf install postgresql-server Ubuntu 18.04:
sudo apt install postgresql New Server Initialization On CentOS 7/Fedora 30:
sudo postgresql-setup initdb Upgrading From An Older Version sudo postgresql-setup --upgrade Administering The Database Server Managing The postgresql Daemon Starting PostgreSQL server
sudo systemctl start postgresql Checking PostgreSQL Server Status:
sudo systemctl status postgresql Enabling PostgreSQL Server Systemd Unit/Enabling PostgreSQL Server On Boot:
sudo systemctl enable postgresql Allowing Password Based Login From localhost Edit /var/lib/pgsql/data/pg_hba.
read morePosts
Access Dictionary Keys As Object Attributes
You access Python dictionary keys using the syntax:
my_dicy[my_key] For example:
>>> my_dict = {'food': 'idly'} >>> my_dict['food'] 'idly' Sometimes, you might want to access the dictionary keys using:
my_dict.my_key syntax. If you do this is what happens:
>>> my_dict.food Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'dict' object has no attribute 'food' How can you solve this? Easy.
pip install attrdict How do you use the newly installed package?
read morePosts
Understanding and Implementing MySQL Replication: A Guide for All Skill Levels
In this tutorial, I will provide step-by-step process to implement MySQL replication. We will create one master and one slave. We will use two CentOS 6 servers - one for master and the other for slave. This following steps have been tested on two virtual machines.
Our master server will have IP address 192.168.122.10. Our slave server will have IP address 192.168.122.12.
You might want to run SELinux in permissive mode.
read more