Tuesday, March 9, 2021

RHEL8 - Ansible Installation

 Ansible Installation

1. Installation
Requirements
Control Node
- Python need to install
- sudo - user with root access
- Instal ansible on control node

Worker Nodes
- Python need to install
- sudo - user with root access


2. Add hosts entry
192.168.10.20    control
192.168.10.21    ansible1    w1
192.168.10.22    ansible2    w2

3. Verify group info for use.
# id ansible    # part of wheel group
# ssh ansible1 id ansible
# ssh ansible2 id ansible

4. Add sudo entry to user for root level access without entering password (not a good idea)
# visudo
go to line %wheel and comment it out and enable the line below

%wheel ALL=ALL    NOPASSWD: ALL

5. Set up ansible user and generate key at control node
$ ssh-keygen    # bad idea to not supply password

copy pyblic key to client machines
$ ssh-copy-id ansible1
$ ssh-copy-id ansible2

6. Check the version of your OS release and set up repo
$ cat /etc/os-release

Set up epel repo for RHEL system # my system is CentOS 8
$  sudo yum install epel-release -y

7. Install ansible and update python latest version
$ sudo yum install -y ansible

# yum search python
# yum install python
we already installed
# yum install pythonx

Update on your all OS.



No comments:

Post a Comment

Git branch show detached HEAD

  Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03)   00 2. Run re-set hard $ git reset --hard 3. ...