当前位置:网站首页>Ansible job 1
Ansible job 1
2022-04-22 23:54:00 【m0_ sixty-four million two hundred and sixty-five thousand thre】
1) install and configure ansible as well as ansible The control node server.example.com as follows :
2) Create a file called /home/student/ansible/inventory The static inventory file of is as follows :
[student@server ~]$ mkdir ansible
[student@server ~]$ vim ansible/inventory
[dev]
node1
[test]
node2
[prod]
node1
node2
[balancers]
node1
[webserver:children]
prod
2.1)node1 yes dev Members of the host group
2.2)node2 yes test Members of the host group
2.3)node1 and node2 yes prod Members of the host group
2.4)node1 yes balancers A member of the host group
2.5)prod Group is webservers Members of the host group
3). Create a file called /home/student/ansible/ansible.cfg Configuration file for , As shown below :
[student@server ansible]$ vim ansible.cfg
[defaults]
inventory = ./inventory
remote_user=devops
ask_pass=False
host_key_checking=False
sudo_user=root
roles_path=/home/student/ansible/roles
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False
[student@server ansible]$ ansible --version
ansible 2.9.27
config file = /home/student/ansible/ansible.cfg
3.1 Host inventory file /home/student/ansible/inventory
3.2 The position of the character in the script is defined as /home/student/ansible/roles
4) Log in to the control host student user ,remote_user = devops, Enable privilege upgrade
[root@node1 ~]# vim /etc/sudoers
devops ALL=(ALL) NOPASSWD: ALL
[root@node2 ~]# vim /etc/sudoers
devops ALL=(ALL) NOPASSWD: ALL
test :
[student@server ansible]$ ansible prod -a 'hostname'
node1 | CHANGED | rc=0 >>
node1.example.com
node2 | CHANGED | rc=0 >>
node2.example.com
[student@server ansible]$ ansible prod -a 'useradd m1'
node1 | CHANGED | rc=0 >>
node2 | CHANGED | rc=0 >>
版权声明
本文为[m0_ sixty-four million two hundred and sixty-five thousand thre]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222236183687.html
边栏推荐
- 共轭梯度法(Conjugate Gradients)(3)
- “亿”点点技术情怀
- FileNotFoundError: [Errno 2] No such file or directory: 'image/1. Jpg 'problem solving
- 51 single chip microcomputer learning_ 4-1 nixie tube display
- 分享两道最近做的比较经典的OJ题(排列子序列+字符串中找出连续最长的数字串)
- FileNotFoundError: [Errno 2] No such file or directory: 'image/1.jpg'问题解决
- Rotate according to angle
- Failed to execute goal on project xxxxx
- FPGA (V) one of RTL codes (cross clock domain design)
- matlab-day01
猜你喜欢
![[note] PCIe ltssm status transition](/img/01/0978c1d5aeebd9770f042a384f604c.png)
[note] PCIe ltssm status transition
![FileNotFoundError: [Errno 2] No such file or directory: 'image/1. Jpg 'problem solving](/img/dd/d8068792911be2d04a04eb4c1a158c.png)
FileNotFoundError: [Errno 2] No such file or directory: 'image/1. Jpg 'problem solving

No module named 'Django is reported when Django specifies the database_ test. settings‘
![[pyGame] can the little dinosaur on chrome be played with code? It looks like fun~](/img/b4/a4140eb10658af40a8a2fc0f428b0f.jpg)
[pyGame] can the little dinosaur on chrome be played with code? It looks like fun~

On LD_ Preload hijacking

Beijing University of Aeronautics and Astronautics launched the trial of cnopendata
![[leetcode] binary tree, 226 flip the binary tree, 116 fill in the right pointer of the binary tree node, and 114 expand the binary tree into a linked list](/img/ea/dcecef82651f15ed1be3821bf8a063.png)
[leetcode] binary tree, 226 flip the binary tree, 116 fill in the right pointer of the binary tree node, and 114 expand the binary tree into a linked list

Django creates table structure and adds, deletes, modifies and queries database

Install the most complete version of ActiveMQ under the official website in 2022 and the official website access method

共轭梯度法(Conjugate Gradients)(4)
随机推荐
SystemVerilog verification - Test Platform preparation guide learning notes (1): data types
2022-4-22 job MySQL single table query
[leetcode] binary tree, 226 flip the binary tree, 116 fill in the right pointer of the binary tree node, and 114 expand the binary tree into a linked list
Select all text
3D旋转动画
SystemVerilog verification - Test Platform writing guide learning notes (3): connecting design and test platform
80386 compilation_ Introduction to global description table GDT
PIL库在深度学习中的常见操作
项目实训-小鬼僵尸
Visual studio 2019 restore default settings
物联网标识感知
[perseverance challenge] PCIe daily question and answer (table of contents)
"100 million" little technical feelings
ssh: connect to host 172.31.8.132 port 22: Connection refused
【leetcode】二叉树,深入理解前中后序
L1-080 乘法口诀数列 (20 分)
分享两道最近做的比较经典的OJ题(排列子序列+字符串中找出连续最长的数字串)
[* ctf2022] Web Topic reproduction and WP
grid_ Map (6): grid mapping in ROS compilation run
浅谈LD_PRELOAD劫持