Comments on How to Install and Configure Ansible on Ubuntu 20.04

Ansible is a very popular configuration management tool designed to streamline the process of controlling a large number of servers. In this guide, we will learn how to install and configure Ansible on an Ubuntu 20.04 server.

1 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Wallace

Good totorial, but nobody should be using root for remote logins, especially on ubuntu, where the root account is blocked from logins in the distro.

Using sudo is the expected mode for ansible, which completely supports that use with the "becomes" keyward and supports different deployment userids and certs in the inventory file with 'ansible_user'.

I suspect most locations wouldn't use IP addresses in the inventory file either, unless they are doing subnet ranges. People use DNS in the real world.

some examples:

[code][subnet]172.22.222.[1:254]

[dbs]

db-[99:101]-node.example.com

[current]regulusdeneb         ansible_connection=localpi3           ansible_user=osmc[/code]

Simple stuff.  A playbook to get system release information:

[code]---- name: Get OS Release Info  become: true  gather_facts: true  hosts: current  tasks:  - name: System Details    debug: msg="{{ item }}"    with_items:     - "{{ ansible_distribution }}"    - "{{ ansible_distribution_version }}"[/code]