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
Next revision Both sides next revision
сервис_ansible [2022/03/15 09:42]
val [Пример 3]
сервис_ansible [2022/06/07 15:30]
val [Использование модулей]
Line 59: Line 59:
  
 [nodes] [nodes]
-node[1:3]+192.168.X.[10:30:10]
  
 [nodes:​vars] [nodes:​vars]
Line 105: Line 105:
 node1# ansible corpX -f 2 -m apt -a '​pkg=apache2 state=present update_cache=true'​ node1# ansible corpX -f 2 -m apt -a '​pkg=apache2 state=present update_cache=true'​
  
-node1# ansible addnodes -f 5 -m apt -a '​pkg=ceph state=present update_cache=true+node1# ansible addnodes -f 5 -m apt -a '​pkg=ceph,​tgt-rbd ​state=present update_cache=true'​
-node1# ansible addnodes -m community.general.shutdown ​ !!!Зависает Vbox, попробовать в один поток +
- +
-node3# ansible addnodes -m copy -a '​src=/​etc/​ceph/​ceph.conf dest=/​etc/​ceph/​ceph.conf'+
  
 ubuntu20# apt install python3-paramiko ubuntu20# apt install python3-paramiko
Line 143: Line 140:
     - name: Add Docker'​s official GPG key     - name: Add Docker'​s official GPG key
       apt_key:       apt_key:
-        ​url: https://​download.docker.com/​linux/​debian/​gpg+#        ​url: https://​download.docker.com/​linux/​debian/gpg 
 +#        url: https://​download.docker.com/​linux/​ubuntu/gpg
         state: present         state: present
     - name: Add Docker'​s repository into sources list     - name: Add Docker'​s repository into sources list
       apt_repository:​       apt_repository:​
 #        repo: deb [arch=amd64] https://​download.docker.com/​linux/​debian buster stable #        repo: deb [arch=amd64] https://​download.docker.com/​linux/​debian buster stable
-        ​repo: deb [arch=amd64] https://​download.docker.com/​linux/​debian bullseye stable+#        ​repo: deb [arch=amd64] https://​download.docker.com/​linux/​debian bullseye ​stable 
 +#        repo: deb [arch=amd64] https://​download.docker.com/​linux/​ubuntu focal stable
         state: present         state: present
     - name: Install Docker     - name: Install Docker
-      apt: pkg=docker-ce state=present update_cache=true+      apt:  
 +        ​pkg
 +          - docker-ce 
 +          - docker-ce-cli 
 +          - containerd.io 
 +          - docker-compose-plugin 
 +        ​statepresent ​ 
 +        ​update_cachetrue
 </​code><​code>​ </​code><​code>​
 gate# ansible-playbook provision_docker.yml gate# ansible-playbook provision_docker.yml
Line 424: Line 430:
 </​code><​code>​ </​code><​code>​
 # ansible-playbook -f 5 nodes.yml # ansible-playbook -f 5 nodes.yml
 +
 +  ИЛИ
 +
 +# ansible-playbook -f 5 conf/​ansible/​roles/​nodes.yml
 </​code>​ </​code>​
сервис_ansible.txt · Last modified: 2024/06/04 13:46 by val