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

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:

主站蜘蛛池模板: 克什克腾旗| 茌平县| 泰和县| 攀枝花市| 昌吉市| 利川市| 无为县| 广平县| 丁青县| 莆田市| 凉城县| 扶绥县| 教育| 如东县| 益阳市| 西华县| 盐池县| 巴林右旗| 项城市| 信宜市| 太白县| 太仓市| 陆川县| 乌什县| 阳原县| 蒙山县| 揭阳市| 江油市| 永靖县| 化德县| 仙桃市| 夏邑县| 云浮市| 绥化市| 灵川县| 闵行区| 江川县| 老河口市| 封开县| 房产| 江达县|