How to install OCI CLI in CentOS 8 Stream
The steps mentioned in the internet is not working for me. So this is the working commands.
# yum install python38 -y
# ll /usr/bin/pip3.8
# ll /usr/bin/pip-3.8
# pip3.8 install oci-cli
# oci --version
How to install OCI CLI in CentOS 8 Stream
The steps mentioned in the internet is not working for me. So this is the working commands.
# yum install python38 -y
# ll /usr/bin/pip3.8
# ll /usr/bin/pip-3.8
# pip3.8 install oci-cli
# oci --version
How to redirect 404 error to the home page
Following steps helps to redirect all 404 error pages to the home page. Assume you already installed httpd in this server.
How to install letsencrypt on Amazon linux 2023
In Amazon linux 2023, EPEL is not available. All the documentations avaialble in internet is about EPEL and then install certbot. But here we need to use a different approach.
Single command to checkout all branches in git
[yourserver #] for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do; git branch --track ${branch#remotes/origin/} $branch; done;
This is useful when we do git migrations.
OS : CentOS 7
Error while installing Mysql
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Fix:
Import new key from rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
Yum update
yum install mysql-server
Error : Access denied for user 'user'@'hostname' (using password: YES) in mysql8
Mysql version is Mysql8
OS is Ubuntu 22
I am sure that i can connect from my both apps servers to the DB from the command shell.
The issue is the mysql user password. In my password, i had some special characters. When we input this password in command prompt, in bash shell it will work. But its not working from nodejs code (.env file)
Solution :
I change the password without a special character and the issue got fixed.
While running Ansible 2.14.1, i am getting the error
"unable to find /root/.my.cnf. Exception message: (1698, \"Access denied for user 'root'@'localhost
Solution to fix is :
You need to login to the server and find the mysqld.sock file. In my Ubuntu22 machine its /var/run/mysqld/mysqld.sock
I need to update this in my playbook as
Normally we will add the private key of the server in our .ssh/authorized keys, right?
But i want to keep the ssh key in a different location.
I created a folder called "centos" and i am planning to keep all the ansible files related to this project under this folder.
/Users/shivinvijai/Desktop/Learnings/Ansible/centos
In this folder, I fist created an inventory file.
shivinvijai@Shivins-MacBook-Pro centos % cat inventory
[myservers]
150.61.189.96 ansible_user=opc ansible_ssh_private_key_file=/Users/shivinvijai/Desktop/Learnings/Ansilbe/ssh-key-2023-01-01.key
shivinvijai@Shivins-MacBook-Pro centos %
I specify my username and path to the ssh key file.
Now, I going to do a test, here i am using my own inventory file so the command will be this
shivinvijai@Shivins-MacBook-Pro centos % ansible -i inventory -m ping myservers
150.61.189.96 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
This is my first experience in MAC as an ansible control node. The FIX is listed in this link
https://www.linuxblackmagic.com/2023/01/setting-up-my-mac-as-control-node-for.html
This will fix your issue, for me its working fine.
Here is my requirement, I am using my MAC so i need to develop Ansible playbooks in my MAC book.
I used PIP to install ansible in my mac book. After installation i am not able to do any ansible commands and I fixed the issue using this link (https://www.linuxblackmagic.com/2023/01/after-install-ansible-using-pip-in-mac.html)
After this, when you try to add hosts or ansible.cfg file, you may not find this in your mac.
I checked $HOME/.ansible folder and i can't find it.
I downloaded a sample configuration of ansible.cfg to the $HOME/.ansible folder
Then i created a hosts file which is defined in the inventory section of the ansible.cfg file.
localhost ansible_connection=local
Then I tried a test using this command.
ansible -i $HOME/.ansible/hosts -m ping all
localhost | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/opt/homebrew/bin/python3.11"
},
"changed": false,
"ping": "pong"
}
I installed ansible in my Mac using PIP. After installation i am not able to execute any ansible commands.
Fix :
Only for current session, you can export the path
export PATH="/Users/<username>/Library/Python/3.10/bin:$PATH"
For making it permeant, you need to open the file
vi ~/.zshrc (If not present, feel free to create it)
export PATH="/Users/<username>/Library/Python/3.10/bin:$PATH:
Source it,
source ~/.zshrc
After this, i could able to use ansible commands in my Mac