- Implementing DevOps with Ansible 2
- Jonathan McAllister
- 193字
- 2021-07-02 19:02:59
Setting up authentication between the control server and hosts
When connecting Ansible with remote hosts, Ansible's best practices encourage the use of SSH key sharing. SSH keys allow one Linux host to talk to another without asking for a specific password. In this section we are going to briefly look at how to set SSH key sharing up on the control server and n number of target machines.
If SSH key Sharing is not available Ansible also offers the option to ask for a password using the --ask-become-pass command-line argument.
To get started, create a /etc/ansible/hosts (if it doesn't exist) and add one or more remote systems into its contents. Your specific public SSH key should be located in authorized_keys on those target systems.
In this brief tutorial we will assume the SSH key authentication solution is being used. It helps us avoid having to enter or store raw passwords:
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa
Now ping all the nodes (assumes you have an inventory file created):
$ ansible all -m ping
For a complete documentation set around setting up SSH key sharing in Ubuntu the documentation can be found at http://linuxproblem.org/art_9.html.
- Vue 3移動(dòng)Web開發(fā)與性能調(diào)優(yōu)實(shí)戰(zhàn)
- Cocos2D-X權(quán)威指南(第2版)
- INSTANT FreeMarker Starter
- OpenShift在企業(yè)中的實(shí)踐:PaaS DevOps微服務(wù)(第2版)
- 碼上行動(dòng):用ChatGPT學(xué)會(huì)Python編程
- Spring Boot企業(yè)級(jí)項(xiàng)目開發(fā)實(shí)戰(zhàn)
- Mastering Android Development with Kotlin
- NGINX Cookbook
- Kubernetes源碼剖析
- Python 3 數(shù)據(jù)分析與機(jī)器學(xué)習(xí)實(shí)戰(zhàn)
- Learning Jakarta Struts 1.2: a concise and practical tutorial
- Raspberry Pi Robotic Projects
- Linux Networking Cookbook
- jQuery Essentials
- Mastering Responsive Web Design