SnmpWalk for Windows
The software can be downloaded from following website.
https://www.softpedia.com/get/Network-Tools/Misc-Networking-Tools/SnmpWalk.shtml
https://download.cnet.com/SnmpWalk/3000-2085_4-75795880.html
Computer is miraculous!
The software can be downloaded from following website.
https://www.softpedia.com/get/Network-Tools/Misc-Networking-Tools/SnmpWalk.shtml
https://download.cnet.com/SnmpWalk/3000-2085_4-75795880.html
.ssh/config
Host <host>
port <new_port>
user <new_user>
IdentityFile <new_file>
Introduction to AWS Networking
AWS VPC Basics - Understanding what is VPC and Calculating CIDR for VPC and Subnets
This is the list of posts for Learning - Ansible 101
Learning - Ansible 101 - Episode 1 - Introduction to Ansible
Learning - Ansible 101 - Episode 2 - Ad-hoc tasks and Inventory
Learning - Ansible 101 - Episode 3 - Introduction to Playbooks
Run ad-hoc tasks using Ansible.
vagrant init geerlingguy/centos7
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/centos7"
config.ssh.insert_key = false
config.vm.synced_folder ".", "/vagrent", disabled: true
config.vm.provider :virtualbox do |v|
v.memory= 256
v.linked_clone = true
end
# App server 1
config.vm.define "app1" do |app|
app.vm.hostname = "orc-app1.test"
app.vm.network :private_network, ip: "192.168.60.4"
end
# App server 2
config.vm.define "app2" do |app|
app.vm.hostname = "orc-app2.test"
app.vm.network :private_network, ip: "192.168.60.5"
end
# DB server
config.vm.define "db" do |db|
db.vm.hostname = "orc-db.test"
db.vm.network :private_network, ip: "192.168.60.6"
end
end
vagrant up
inventory
file# Application servers
[app]
192.168.60.4
192.168.60.5
# Database server
[db]
192.168.60.6
# Group has all the servers
[multi:children]
app
db
# Variable for all the servers
[multi:vars]
ansible_ssh_user=vagrant
ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
ansible multi -i inventory -a "hostname"
Note: accept host key if prompt, or change the .ssh/config file to ignore host key
To run one by one,
ansible multi -i inventory -a "hostname" -f 1
ansible -i inventory db -m setup
ansible -i inventory multi -b -m yum -a "name=ntp state=present"
ansible -i inventory multi --become -m yum -a "name=ntp state=present"
Note: Run the second time, the status will be SUCCESS, not CHANGED
sudo
passwordansible -i inventory multi -K -m yum -a "name=ntp state=present"
Note: for this image, the vagrant user has password vargent
ansible -i inventory multi -b -m service -a "name=ntpd state=started enabled=yes"
Use google search "ansible service module".
Use ansible-doc
command
ansible-doc service
ansible -i inventory multi -b -a "service ntpd stop"
ansible -i inventory multi -b -a "ntpdate -q 0.rhel.pool.ntp.org"
Setup user on mysql server.
ansible -i inventory db -b -m mysql_user -a "name=django host=% password=12345 priv=*.*:ALL state=present"
ansible -i inventory multi -a "free -m" --limit '192.168.60.4'
ansible -i inventory multi -a "free -m" --limit '*.4'
ansible -i inventory multi -a "free -m" --limit '!192.168.60.4'
ansible -i inventory multi -a "free -m" --limit '!192.168.60.4:!192.168.60.5'
Introduction to Ansible
pip3 install ansible
ansible --version
Create a file called inventory
[example]
107.20.106.183
ansible -i inventory example -m ping -u centos
ansible.cfg
file[defaults]
INVENTORY=inventory
ansible example -m ping -u centos
ansible example -a "date" -u centos
ansible example -a "free -h" -u centos
In fact, above commands used default module -m command
, and the -a
option is giving the command arguments.
Then initialize vagrant
vagrant init geerlingguy/centos7
This will create a file called Vagrantfile
in current directory.
vagrant up
vagrant ssh
vagrant ssh-config
This configuration can be used to update ssh configuration
vagrant halt
vagrant destroy
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/centos7"
config.vm.provsion "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
end
playbook.yml
---
- name: Set up NTP on all servers.
hosts: all
become: yes
tasks:
- name: Ensure NTP is installed.
yum: name=ntp state=present
- name: Ensure NTP is running.
service: name=ntpd state=started enabled=yes
The name is optional
- yum: name=ntp state=present
- service: name=ntpd state=started enabled=yes
Run provision command
vagrant provision
The command can be run many times without change the result if success before.
But following command in playbook will run every time when triggered playbook.
- command: yum install -y ntp
To overcome this, change to following
- shell: |
if ! rpm -qa | grep -qw ntp; then
yum install -y ntp
fi
# <Post Title> - Posts List
<Post contain>
## References
[<SubPost_Title1>](<SubPost_URL1>)
[<SubPost_Title2>](<SubPost_URL2>)
[<SubPost_Title3>](<SubPost_URL3>)
[<SubPost_Title4>](<SubPost_URL4>)
Add following script after each subpost summary.
Note: The 8888 is the subpost id, 9999 is the index post (Posts List) id. This will create a button on current page (8888) to display Posts List
# <Post Title>
<Post contain>
<div><button id='related_posts_8888'>Display Learning Posts</button>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$("#related_posts_8888").click(function(event) {
el = $(document.getElementById( $(this).attr('id') ).parentElement);
$.get("?p=9999", function(data, status) {
el.html(/h2>References<\/h2>([\s\S]*?)<\/div>/.exec(data)[1]);
});
});
});
}) (jQuery);
</script>
</div>