Instance not created through Terraform
Run the below script in swarm manager:
centos - users cd ~/.ssh ssh-keygen -t rsa -C"<comments>"
Note
Copy and paste may not work in Linux, you can type comments.
Example 1. Example$ ssh-keygen -t rsa -C "ansible-nitin" Generating public/private rsa key pair. Enter file in which to save the key (/home/centos/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/centos/.ssh/id_rsa. Your public key has been saved in /home/centos/.ssh/id_rsa.pub. The key fingerprint is: SHA256:HCHKTPqm18uju3Gmejxp9XEAip11VvO0E7ezGxE26Lo ansible-nitin The key's randomart image is: +---[RSA 2048]----+ | . . ..o o.= | | = .o.o. +.= + | | .o++ +. .+ + | | ..+ ... .. + | | o S. . o | | o .. . o o | | ..oo+. o . . | | .**... E | | .+==o. | +----[SHA256]-----+
Get the key form “id_rsa.pub” file.
Add rsa key and communication between swarm manager node to another server.
cd ~/.ssh vi authorized keys
Update the “centos” user in the below mentioned ansible code:
infra/ansible/environments/u-analyze-func/group_vars/all/1_thirdparty_services_vars.yml ansible_user: "centos"
Add “centos” in /infra/ansible/roles/docker/tasks/install.yml
name: Add deploy user to docker group ansible.builtin.user: name: "centos" groups: docker append: yes
Ensure that NFS type (in bound rule) is added in the security group.
Run the ansible code from centos user (swarm manager).
Once GPU instance is created, run the yum update and install GPU ASR engine.
When a new server is created or server is rebooted, run the base.yml and docker.yml playbook.
When a new server is created with an existing name, check the “docker node ls” and remove the node (with same name) which is down.
Third party server to be configured in swarm manager node in inventory file.