Ansible Script 추가

This commit is contained in:
ByeonJungHun
2023-12-19 13:36:16 +09:00
parent 0273450ff6
commit 05cb8d9269
2610 changed files with 281893 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# ssh key 배포 installer
# authorized_keys.yaml은 client에 ssh-pass가 설치되어 있어야 해서 일단 미사용
1. 사전 작업
- ssh-keygen
2. 명령어
- ./key.sh <PASSWORD> <IPADDR>

View File

@@ -0,0 +1,11 @@
---
- hosts: cluster
remote_user: root
tasks:
- name: key add
authorized_key:
user: root
state: present
key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
manage_dir: False

View File

@@ -0,0 +1,32 @@
10.10.43.111
10.10.43.112
10.10.43.113
10.10.43.114
10.10.43.115
10.10.43.116
10.10.43.117
10.10.43.118
10.10.43.119
10.10.43.120
10.10.43.121
10.10.43.122
10.10.43.123
10.10.43.124
10.10.43.125
10.10.43.126
10.10.43.127
10.10.43.128
10.10.43.129
10.10.43.130
10.10.43.131
10.10.43.132
10.10.43.133
10.10.43.134
10.10.43.135
10.10.43.136
10.10.43.137
10.10.43.138
10.10.43.139
10.10.43.140
10.10.43.141
10.10.43.142

8
ansible/01_old/ssh_key/key.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/expect -f
set password [lindex $argv 0]
set host [lindex $argv 1]
spawn ssh-copy-id -o StrictHostKeyChecking=no root@$host
expect "password:"
send "$password\n"
expect eof

8
ansible/01_old/ssh_key/test.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
while read ip
do
./key.sh saasadmin1234 ${ip}
done < ip_list