Compare commits
2 Commits
a98125ce97
...
6deb9c073a
| Author | SHA1 | Date | |
|---|---|---|---|
| 6deb9c073a | |||
| 3bc8a2ec93 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
*~* # - Ignore temp vim files
|
||||
*~
|
||||
~*
|
||||
|
||||
# Ignore credentials
|
||||
hostlist
|
||||
|
||||
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
|
||||
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.
|
||||
@@ -6,6 +6,6 @@ cat /dev/null > ../../hostlist
|
||||
|
||||
for var in $(grep hosting ../../memlist)
|
||||
do
|
||||
echo $var:$(virsh domifaddr $var --full --source arp | awk '/192.168.0./ {print $4}' | cut -d "/" -f 1) >> ../../hostlist
|
||||
echo $var ansible_host=$(virsh domifaddr $var --full --source arp | awk '/192.168.0./ {print $4}' | cut -d "/" -f 1) >> ../../hostlist
|
||||
done
|
||||
|
||||
|
||||
21
hostlist
21
hostlist
@@ -1,21 +0,0 @@
|
||||
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