Ansible Host Setup for mighty
Ansible Host Setup for mighty
- Install
ansible-core:
sudo dnf install -y ansible-core
- requirements.yaml setup:
cat « “EOF” | tee $HOME/requirements.yaml
collections:
-
name: community.crypto
-
name: community.general
-
name: community.mysql
-
name: ansible.posix EOF
-
Manual Commands are below if needed:
-
For
OpenSSHsupport, install this collection:
ansible-galaxy collection install community.crypto
- Install the Ansible Community Collection:
ansible-galaxy collection install community.general
- Install the
mysqlcommunity package for themariadbdatabase operations:
ansible-galaxy collection install community.mysql
- Install the
posixcollection for handlingsshkeys and use ofrsync:
ansible-galaxy collection install ansible.posix
- Install the `kubernetes@ collection:
ansible-galaxy collection install kubernetes.core
-
Edit
/etc/ansible/hosts -
Add the following:
cat << "EOF" | sudo tee /etc/ansible/hosts
[kubernetes_control_planes]
shin-ray ansible_ssh_host=192.168.1.101
[kubernetes_worker_nodes]
green-hills ansible_ssh_host=192.168.1.100
[rocky-linux8-slurm]
rocky-linux8-slurm-controller-node ansible_ssh_host=192.168.1.120
rocky-linux8-slurm-compute-node ansible_ssh_host=192.168.1.121
[rocky_linux10desktops]
shadow ansible_ssh_host=192.168.1.102
amy ansible_ssh_host=192.168.1.105
[rocky_linux10vms]
rocky-linux10-vm1 ansible_ssh_host=192.168.1.125
[rocky_linux9vms]
rocky-linux9-vm1 ansible_ssh_host=192.168.1.126
[rocky_linux8vms]
rocky-linux8-vm1 ansible_ssh_host=192.168.1.127
[control]
shin-ray ansible_ssh_host=192.168.1.101
[workers]
green-hills ansible_ssh_host=192.168.1.100
EOF
- Generate an
sshkey pair:
ssh-keygen -t rsa -b 4096
-
Use
ssh-copy-idto access each server from theansiblehost. -
Create the
group_varsdirectory:
sudo mkdir /etc/ansible/group_vars
- Create the
rocky_linux_10desktopsconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/rocky_linux_10desktops
---
ansible_ssh_user: root
EOF
- Make the
kubernetes_control_planesconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/kubernetes_control_planes
---
ansible_ssh_user: root
EOF
- Make the
kubernetes_worker_nodesconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/kubernetes_worker_nodes
---
ansible_ssh_user: root
EOF
- Create the
rocky-linux8-slurmconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/rocky-linux8-slurm
---
ansible_ssh_user: root
EOF
- Create the
rocky_linux10vmsconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/rocky_linux10vms
---
ansible_ssh_user: root
EOF
- Create the
rocky_linux9vmsconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/rocky_linux9vms
---
ansible_ssh_user: root
EOF
- Create the
rocky_linux8vmsconfiguration file:
cat << "EOF" | sudo tee /etc/ansible/group_vars/rocky_linux8vms
---
ansible_ssh_user: root
EOF
- Generate the
group_vars/allfile:
cat << "EOF" | sudo tee /etc/ansible/group_vars/all
---
rocky_linux8_slurm_controller_node_ip: 192.168.1.120
rocky_linux8_slurm_compute_node_ip: 192.168.1.121
EOF
- Test that the machines can be connected to:
ansible -m ping all
ansible -m ping <group_name>
ansible -m ping <host>
ansible -m ping <host1>:<host2>
ansible -m shell -a 'free -m' <host>