From 242cf70b6bfb42af5f488804f1935dd45d22b133 Mon Sep 17 00:00:00 2001 From: Sachin Prabhu Date: Fri, 28 Mar 2025 13:00:30 +0000 Subject: [PATCH] devel: remove fix_ssh target Better method to access target machines directly now available. Signed-off-by: Sachin Prabhu --- devel/Makefile | 3 -- devel/README.md | 3 -- devel/fix_ssh.yml | 66 -------------------------------------------- docs/Fedora-Setup.md | 12 ++++++++ 4 files changed, 12 insertions(+), 72 deletions(-) delete mode 100644 devel/fix_ssh.yml diff --git a/devel/Makefile b/devel/Makefile index 053e803e..5fc96b3f 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1,8 +1,5 @@ INVENTORY := ./inventory -fix_ssh: - @ansible-playbook -i ${INVENTORY} fix_ssh.yml - centos8_build_setup: @ansible-playbook -i ${INVENTORY} centos8_build_setup.yml diff --git a/devel/README.md b/devel/README.md index cbf6c14d..4459ce2d 100644 --- a/devel/README.md +++ b/devel/README.md @@ -2,9 +2,6 @@ This folder contains ansible playbooks which are useful when manual access to th The Makefile targets are as follows -##fix_ssh: -Fix the ssh on the test machines so that you can directly ssh into them. Before you can use this target, you will need to create authorized_keys file in the directory which will be copied to /root/.ssh/authorized_keys on the test machine. - ##centos8_build_setup: Install the required packages needed to setup a samba build environment on the storage* hosts. This is useful when instrumenting samba on these machines to check for a root cause for test failures diff --git a/devel/fix_ssh.yml b/devel/fix_ssh.yml deleted file mode 100644 index af906df3..00000000 --- a/devel/fix_ssh.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Create an authorized_keys file in the local directory containing the public -# keys for ssh access to the remote machine. ---- -- hosts: all - become: yes - tasks: - - - name: Check if authorized_keys exist - local_action: stat path=authorized_keys - register: authorized_keys - become: no - - - assert: - that: - - authorized_keys.stat.exists - fail_msg: >- - authorized_keys does not exist. Please add an authorized_keys file - which will be copied over to the test vms. - run_once: true - - - name: Allow all users to sudo - lineinfile: - path: /etc/sudoers - state: present - insertafter: EOF - line: 'ALL ALL=(ALL) NOPASSWD: ALL' - - - name: allow password authentication - lineinfile: - path: /etc/ssh/sshd_config - state: present - regexp: '^PasswordAuthentication no' - line: 'PasswordAuthentication yes' - - - name: Restart sshd - service: - name: sshd - state: restarted - - # Password: 'x' - - name: change root password - user: - name: root - update_password: always - password: "$6$wEc5aSnByo3LM51M$TQzO2oyTmHzSncT/SGdVJAbCpuMOwfJSE2dS9p.L0gcFiG5./PqBREtDMdmxFZsuj1M5sq7iGoeoaKmt661Zh1" - - - name: Create /root/.ssh - file: - path: /root/.ssh - owner: root - group: root - mode: 0700 - state: directory - - - name: Copy authorized_keys to /root/.ssh - copy: - src: authorized_keys - dest: /root/.ssh/authorized_keys - owner: root - group: root - mode: 0600 - - - name: Install net-tools - yum: - name: net-tools - state: present diff --git a/docs/Fedora-Setup.md b/docs/Fedora-Setup.md index dd89b605..70caa756 100644 --- a/docs/Fedora-Setup.md +++ b/docs/Fedora-Setup.md @@ -58,3 +58,15 @@ $ cd sit-environment/ $ make clean ``` This clears up all the vms and temporary files created by the tool and the system is ready for a rebuild + +To setup the host system to allow direct ssh into the test vms, edit ~/.ssh/config and add the following line +``` +Include /path/to/sit-environment/playbooks/ansible/ssh_config +``` +Change the path to your own instance of the sit-environment repo. You should now be able to directly ssh into the test systems. +eg: client0 +``` +$ ssh client0 +Last login: Fri Mar 28 12:57:45 2025 from 192.168.121.1 +[root@client0 ~]# +```