Copy name server info to all web servers
1. Disable NetworkManager service
[root@master ~]# systemctl status/stop/disable NetworkManager
2. Update your config file with correct dns entry
[root@master ~]# cat mydns.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 10.0.2.2
3. Write your yaml file
[root@master ~]# cat mydns.yaml
- hosts: myweb
tasks:
- copy:
src: dns.conf
dest: /etc/resolv.conf
4. Check your ansible config file
[root@master ~]# ansible --version
config file = /etc/ansible/ansible.cfg
5. Find your inventory file
[root@master ~]# cat /etc/ansible/ansible.cfg | more
[defaults]
inventory = /root/myhosts
host_key_checking=false
6. Check your inventory record. Set up passwordless authentication (ssh-keygen)
[root@master ~] # cat myhosts
[myweb]
worker1 ansible_user=root ansible_ssh_pass=changeme ansible_connection=ssh
worker2 ansible_user=root ansible_ssh_pass=changeme ansible_connection=ssh
7. Run your playbook
[root@master ~]# ansible-playbook mydns.yaml
Monday, December 7, 2020
Ansible - File copy - update DNS record on client machines
Subscribe to:
Post Comments (Atom)
Git branch show detached HEAD
Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03) 00 2. Run re-set hard $ git reset --hard 3. ...
-
snmpconfig command allow you to managge snmpv1/v3 agent configuration on SAN switch. Event trap level is mapped with event severity level....
-
Firmware upgrade on HPE SuperDom Flex 280 - prerequisites tasks a. Set up repo b. Upload firmware to your webserver 1. For foundation so...
-
Disabling the Telnet protocol on Brocade SAN switches By default, telnet is enabled on Brocade SAN switches. As part of security hardening o...
No comments:
Post a Comment