User Tools

Site Tools


сервис_ansible

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_ansible [2025/02/11 13:56]
val [Роль OpenVPN сервера]
сервис_ansible [2025/03/15 16:44] (current)
val [Использование модулей]
Line 108: Line 108:
 node1# ansible all -m ping node1# ansible all -m ping
 node1# ansible all -m ping -i inv_file.ini node1# ansible all -m ping -i inv_file.ini
-node1# ansible all -m ping -i node2:​2222, ​-e "​ansible_python_interpreter=/​usr/​bin/​python3"​+node1# ansible all -m ping -i node2:2222,
  
 node1# ansible corpX -m command -a 'uname -a' node1# ansible corpX -m command -a 'uname -a'
  
-kube1# ansible kubes -a 'sed -i""​ -e "/​swap/​s/​^/#/"​ /​etc/​fstab'​ 
-kube1# ansible kubes -a '​swapoff -a' 
-  ИЛИ 
 (venv1) server# ansible all -a 'sed -i""​ -e "/​swap/​s/​^/#/"​ /​etc/​fstab'​ -i /​root/​kubespray/​inventory/​mycluster/​hosts.yaml #​--limit=kube4,​kube5 (venv1) server# ansible all -a 'sed -i""​ -e "/​swap/​s/​^/#/"​ /​etc/​fstab'​ -i /​root/​kubespray/​inventory/​mycluster/​hosts.yaml #​--limit=kube4,​kube5
 (venv1) server# ansible all -a '​swapoff -a' -i /​root/​kubespray/​inventory/​mycluster/​hosts.yaml #​--limit=kube4 (venv1) server# ansible all -a '​swapoff -a' -i /​root/​kubespray/​inventory/​mycluster/​hosts.yaml #​--limit=kube4
Line 666: Line 663:
 </​code><​code>​ </​code><​code>​
 server:~# wget https://​val.bmstu.ru/​unix/​conf.git/​conf/​ansible/​roles/​openvpn1.tgz && tar -xvzf openvpn1.tgz && cd openvpn1 server:~# wget https://​val.bmstu.ru/​unix/​conf.git/​conf/​ansible/​roles/​openvpn1.tgz && tar -xvzf openvpn1.tgz && cd openvpn1
 +
 +server:​~/​openvpn1#​ ansible -m ping -i inventory.yaml all
  
 server:​~/​openvpn1#​ ansible-playbook openvpn1.yaml -i inventory.yaml -e "​variable_host=test_nodes"​ server:​~/​openvpn1#​ ansible-playbook openvpn1.yaml -i inventory.yaml -e "​variable_host=test_nodes"​
сервис_ansible.1739271409.txt.gz · Last modified: 2025/02/11 13:56 by val