官术网_书友最值得收藏!

Testing

To test that Ansible is working correctly and that we can successfully connect and run commands remotely, let's use the Ansible ping command to check one of our hosts. Note that this is not like a network ping, Ansible ping confirms that it can communicate via SSH and execute commands remotely:

    $ ansible mon1 -m ping

The preceding command gives the following output:

Excellent, that worked, now let's run a simple command remotely to demonstrate the power of Ansible. The following command will retrieve the current running kernel version on the specified remote node:

    $ ansible mon1 -a 'uname -r'

This is the desired result:

主站蜘蛛池模板: 称多县| 钟山县| 靖安县| 余江县| 石河子市| 姜堰市| 宜春市| 克东县| 永和县| 宁安市| 广平县| 天全县| 石柱| 临清市| 哈巴河县| 灯塔市| 英吉沙县| 秦安县| 紫金县| 甘德县| 错那县| 泽州县| 辽源市| 内黄县| 牙克石市| 伊金霍洛旗| 耒阳市| 四平市| 白城市| 广东省| 宜川县| 洛川县| 阳西县| 宁陵县| 上虞市| 鸡泽县| 华蓥市| 华容县| 金坛市| 乐东| 菏泽市|