java binary instalation on ubuntu
- Download tar file and extract
- then use location of that
export JAVA_HOME=/hms/installs/jdk-21.0.5
export PATH=$JAVA_HOME/bin:$PATH
java -version
installing maven binary in ubuntu
- Download tar file and extract
- then use the location of that
M2_HOME=/hms/installs/mvn-3-2-3/
PATH=$M2_HOME/bin:$PATH
export PATH
mvn -version
starting working on ansible
- Install ansible
- Create ansible.cfg file
[defaults]
inventory = ./inventory.ini
host_key_checking = False
retry_files_enabled = False
- now create inventory.ini file
[enum]
172.16.3.23 ansible_user=cloud-user ansible_ssh_private_key_file=/home/rinas/.ssh/m1-sec.pem
[radius]
172.27.2.43 ansible_user=cloud-user ansible_ssh_private_key_file=/home/rinas/.ssh/m1-radius.pem
[hutch]
172.16.3.114 ansible_user=centos ansible_ssh_private_key_file=~/.ssh/etisalat-ipg-keypair.pem
- if want playbook now cretate my-any-name.yml
---
- name: Gather system information
hosts: all
gather_facts: yes
tasks:
- name: Display disk usage
ansible.builtin.command: df -h
register: disk_usage
- name: Show disk usage output
ansible.builtin.debug:
var: disk_usage.stdout_lines
- name: Check uptime
ansible.builtin.command: uptime
register: system_uptime
- name: Show system uptime
ansible.builtin.debug:
var: system_uptime.stdout
- Try without playbook
ansible all -m ping -i inventory.ini
- Try with playbook
ansible-playbook my-any-name.yml -i inventory.ini
Written by A.M. Rinas