From the course: Red Hat Certified Engineer (EX294) Cert Prep: 1 Foundations of Ansible

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use the Ansible console

Use the Ansible console

From the course: Red Hat Certified Engineer (EX294) Cert Prep: 1 Foundations of Ansible

Start my 1-month free trial

Use the Ansible console

- [Instructor] A very odd tool included with Ansible is Ansible Console. It's odd in that Ansible's designed to be a stateful system where it's concerned mainly about the state of the configuration it's in. What's mostly concerned about the state the configuration is in. Ansible Console is very different. It let's you log into an interactive session and execute modules targeted at managed hosts or groups of hosts. Let's walk through how it works. First let's run it, but we'll provide the dash b and uppercase k options so we become root. In a terminal type in ansible-console space -b space uppercase K and hit enter. Enter the sudo password of user1 rhost1 when prompted. If you want to target an Ansible group such as web servers we actually cd into it like it were a directory. Type in cd space webservers and hit enter. Now everything we run will be executed on the managed host in the webservers Ansible group.…

Contents