Compare commits
20 Commits
linux
...
cringehost
| Author | SHA1 | Date | |
|---|---|---|---|
| 765c4daf8f | |||
| 21a1b017ad | |||
| 6deb9c073a | |||
| 3bc8a2ec93 | |||
| a98125ce97 | |||
| 020edd51be | |||
| 13177dacd3 | |||
| 124954b34d | |||
| f216d3ccca | |||
| 21e39003ec | |||
| 23cee6e4e9 | |||
| 83e8e0372c | |||
| 03abb3ebae | |||
| 00dd59ffd8 | |||
| 1016bb9b03 | |||
| c0b4012ac3 | |||
| 11c6f769bf | |||
| 7473984a77 | |||
| 92be717a21 | |||
| ec9003865c |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
*~* # - Ignore temp vim files
|
||||
*~
|
||||
~*
|
||||
|
||||
# Ignore credentials
|
||||
hostlist
|
||||
11
README.md
11
README.md
@@ -1,3 +1,12 @@
|
||||
# admin
|
||||
|
||||
Репозиторий, угодный системному администратору, с его ссылками и скриптами
|
||||
Репозиторий, угодный системному администратору, с его ссылками и скриптами
|
||||
|
||||
# cringehosting_vmhosting
|
||||
|
||||
Бранч, посвященный хостингу виртуалок группы, а точнее, её IaaS-составляющей,
|
||||
где собраны скрипты Bash, плейбуки Ansible, конфиги Kubernetes, список группы.
|
||||
Чувствуйте себя свободно при желании внести вклад:
|
||||
1. Сделайте форк репозитория.
|
||||
2. Создайте бранч с фиксом/улучшением кода.
|
||||
3. Создайте запрос на слияние с веткой нашего репозитория.
|
||||
|
||||
2
ansible/ansible.cfg
Normal file
2
ansible/ansible.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
[defaults]
|
||||
host_key_checking=false
|
||||
8
ansible/init_pb.yaml
Normal file
8
ansible/init_pb.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
- name: initialize playbook for hostname and other configurations
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
|
||||
- import_tasks: tasks/ping.yaml
|
||||
- import_tasks: tasks/change_hostname.yaml
|
||||
8
ansible/inventory_settings.yaml
Normal file
8
ansible/inventory_settings.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
[all:vars]
|
||||
ansible_user=user
|
||||
ansible_ssh_pass=123456
|
||||
ansible_become_user=root
|
||||
ansible_become_pass=123456
|
||||
ansible_become_method=sudo
|
||||
ansible_sudo_pass=123456
|
||||
ansible_ssh_executable=/usr/bin/ssh
|
||||
1
ansible/members_list
Symbolic link
1
ansible/members_list
Symbolic link
@@ -0,0 +1 @@
|
||||
../hostlist
|
||||
12
ansible/tasks/change_hostname.yaml
Normal file
12
ansible/tasks/change_hostname.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
- name: clean /etc/hostname
|
||||
command:
|
||||
rm -f /etc/hostname
|
||||
become: true
|
||||
|
||||
- name: change hostname
|
||||
lineinfile:
|
||||
path: /etc/hostname
|
||||
line: "{{ inventory_hostname }}"
|
||||
create: true
|
||||
become: true
|
||||
|
||||
3
ansible/tasks/ping.yaml
Normal file
3
ansible/tasks/ping.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
- name: check connectivity
|
||||
ping:
|
||||
register: ping_result
|
||||
0
bash/ip_fetch/.keep
Normal file
0
bash/ip_fetch/.keep
Normal file
5
bash/ip_fetch/README
Normal file
5
bash/ip_fetch/README
Normal file
@@ -0,0 +1,5 @@
|
||||
Use mk_ip-hostname_table.sh only after pinging these domains, which will fill the host's ARP, so
|
||||
|
||||
# virsh domifaddr
|
||||
|
||||
...will work properly.
|
||||
11
bash/ip_fetch/mk_ip-hostname_table.sh
Executable file
11
bash/ip_fetch/mk_ip-hostname_table.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
hostlist=""
|
||||
|
||||
cat /dev/null > ../../hostlist
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
echo $var ansible_host=$(virsh domifaddr $var --full --source arp | awk '/192.168.0./ {print $4}' | cut -d "/" -f 1) >> ../../hostlist
|
||||
done
|
||||
|
||||
6
bash/virt-virsh/vmcloning-init
Executable file
6
bash/virt-virsh/vmcloning-init
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
virt-clone --original generic_hosting --name $var --auto-clone
|
||||
done
|
||||
6
bash/virt-virsh/vmreboot
Executable file
6
bash/virt-virsh/vmreboot
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
virsh reboot $var
|
||||
done
|
||||
6
bash/virt-virsh/vmshutdown
Executable file
6
bash/virt-virsh/vmshutdown
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
virsh shutdown $var
|
||||
done
|
||||
6
bash/virt-virsh/vmstart
Executable file
6
bash/virt-virsh/vmstart
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
virsh start $var
|
||||
done
|
||||
6
bash/virt-virsh/vmundefine
Executable file
6
bash/virt-virsh/vmundefine
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
virsh undefine $var
|
||||
done
|
||||
21
memlist
Normal file
21
memlist
Normal file
@@ -0,0 +1,21 @@
|
||||
hosting-antonkaretnikov
|
||||
hosting-alexanderboliubysh
|
||||
hosting-dorjisandakov
|
||||
hosting-sergeymoskalenko
|
||||
hosting-katerinenikitina
|
||||
hosting-kirillsavchenko
|
||||
hosting-nikitamochalov
|
||||
hosting-danilreutov
|
||||
hosting-anastasiatsygankova
|
||||
hosting-egorkaikov
|
||||
hosting-stepanyankov
|
||||
hosting-daniilivlev
|
||||
hosting-mariaborzykh
|
||||
hosting-irinakatalanina
|
||||
hosting-mariagerasimenko
|
||||
hosting-evgeniatroshinovskaya
|
||||
hosting-marinerusskikh
|
||||
hosting-vsevolodignatenko
|
||||
hosting-konstantinbekbauov
|
||||
hosting-egorparkhomenko
|
||||
hosting-danilmatveyev
|
||||
Reference in New Issue
Block a user