This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
сервис_ansible [2020/10/16 15:25] val [Использование playbook] |
сервис_ansible [2020/10/27 14:13] val |
||
---|---|---|---|
Line 83: | Line 83: | ||
===== Использование playbook ===== | ===== Использование playbook ===== | ||
- | * [[Управление учетными записями в Linux#Назначение пароля]] | ||
- | * [[https://docs.ansible.com/ansible/2.5/modules/user_module.html|Ansible module user - Manage user accounts]] | ||
* [[https://coderlessons.com/tutorials/raznoe/vyuchi-yaml/uchebnik-po-yaml|Учебник по YAML]] | * [[https://coderlessons.com/tutorials/raznoe/vyuchi-yaml/uchebnik-po-yaml|Учебник по YAML]] | ||
Line 95: | Line 93: | ||
user: vagrant | user: vagrant | ||
tasks: | tasks: | ||
- | - name: Install docker requirement | + | - name: Install Docker's prequirement |
- | apt: | + | apt: |
- | pkg: | + | pkg: |
- apt-transport-https | - apt-transport-https | ||
- ca-certificates | - ca-certificates | ||
Line 105: | Line 103: | ||
state: present | state: present | ||
update_cache: true | update_cache: true | ||
+ | - name: Add Docker's official GPG key | ||
+ | apt_key: | ||
+ | url: https://download.docker.com/linux/debian/gpg | ||
+ | state: present | ||
+ | - name: Add Docker's repository into sources list | ||
+ | apt_repository: | ||
+ | repo: deb [arch=amd64] https://download.docker.com/linux/debian buster stable | ||
+ | state: present | ||
+ | - name: Install Docker | ||
+ | apt: pkg=docker-ce state=present update_cache=true | ||
</code><code> | </code><code> | ||
λ vagrant rsync | λ vagrant rsync | ||
Line 112: | Line 120: | ||
==== Пример 2 ==== | ==== Пример 2 ==== | ||
- | + | * [[Управление учетными записями в Linux#Назначение пароля]] | |
- | <code> | + | * [[https://docs.ansible.com/ansible/2.5/modules/user_module.html|Ansible module user - Manage user accounts]]<code> |
node1# cat addusers.yml | node1# cat addusers.yml | ||
</code><code> | </code><code> | ||
- | - hosts: corp2 | + | - hosts: corpX |
tasks: | tasks: | ||
- name: Add user1 | - name: Add user1 |