Ansible a little trial.

Source: Internet
Author: User

After we've installed the ansible,

Password-free login is configured.

Now we can check the connectivity of management hosts and managed hosts

Ansible all-m Ping

In our actual production we tend to use sudo to perform root permissions for ordinary users.

Ansible all-m ping-u Ansible-sudo

We can find a directory to create a host list file inventory.cfg

If we create it in the home directory,

Cat/home/inventory.cfg

[Webservers]
192.168.220.98
192.168.220.116

Ansible all-m ping-i inventory.cfg

To specify the host list here, we can also place the inventory.cfg file somewhere else.

For example, if we put it in the/etc/ansible directory, we need to specify a detailed location here.

Ansible all-m ping-i/etc/ansible/inventory.cfg

Note: You often need to get details of the execution process when debugging an Automation script in Ansible, you can add a-V or a-VVV after the command to get detailed output results

Ansible all-m Ping-v

Ansible all-m PING-VVV

Ansible a little trial.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.