Page:
Ansible Configuration
Pages
Ansible Configuration
Configure Linux Nodes
Configure Window Nodes
Configuring an AD Sudo Group
DFS01 DFS02 Basic Config
DHCPD Configuration
Docker Configuration
Final
GPO DFS Based Profiles & Home Directories
GPO Remote Desktop
GPO Wallpaper
Home
Mgmt02 sparkle configuration
Milestone 1
Milestone 2
Network Diagrams
Playbook for Linux Users
Playbook for Windows Domain User
RVTM
Redundant ADDS Config
Redundant DFS Setup
System Infrastructure and Assignments
System Infrastructure
Util Configuration
W1 Milestone 1
W2 Milestone 1
Who did what
dhcp1 razzle configuration
dhcp2 dazzle configuration
No results
13
Ansible Configuration
Hannelore Sanokklis edited this page 2024-04-26 18:26:35 -04:00
Install Ansible
- Install ansible on your controller (
mgmt2-sparklein this case)sudo apt install ansible sshpass python3-paramiko
Set up Ansible Directory
- Make directory
ansiblemkdir -p ansible
Create host files
- Within the
ansibledirectory make two hosts files, one for windows and one for linux. - Put all your VM's hostnames in their respective files
vi windows_hosts.txt
vi linux_hosts.txt
Create RSA Key pair on controller (mgmt2-sparkle)
- On the controller (
mgmt02-sparkle)ssh-keygen
Copy keys to linux nodes
ssh-copy-id sparkle-deployer@hostname- replace
hostnamewith node name (you will copy them to every nodes)
- replace
- do the command above for all the nodes
util-sparkledhcp1-razzledhcp2-dazzle
Add commands for passwordless SSH login
Make sure you re-run these commands everytime you come back to your machine!
eval $(ssh-agent)
ssh-add -t 14400
Ping Linux hosts
ansible all -m ping -i linux_hosts.txt
Ping Windows Hosts
OpenSSH will create SSH key on systems once it is install. This is why you don't need to copy the keys to the windows machine before you can ping them with anisble, all you have to do it have OpenSSH set up.
ansible windows -i windows_hosts.txt -m win_ping -u sparkle-deployer@sparkle.local --ask-pass