ansible-practice/
βββ inventories/
β βββ production/
β β βββ hosts
β β βββ group_vars/
β βββ staging/
β βββ hosts
β βββ group_vars/
βββ roles/
β βββ common/
β β βββ tasks/
β β βββ handlers/
β β βββ files/
β β βββ defaults/
β β βββ templates/
β β βββ vars/
β β βββ main.yml
β β βββ more.yml
β βββ webserver/
β βββ tasks/
β βββ files/
β βββ templates/
βββ site.yml ( Master Playbook )
βββ deploy-webserver.yml
βββ provision-infrastructure.yml
βββ production.yml
βββ staging.yml
βββ ansible.cfg
β‘ Remember to share your controller ssh public key id_rsa.pub
with the worker node you want to control.
βΉοΈ The list of worker nodes will store in inventories folder
-
$ ssh key-keygen
-
$ cat ./.ssh/id_rsa.pub ssh-rsa XXXXXXXXXXXX...
$ vi ./.ssh/authorized_keys
βΉοΈ Remember to execute the ansible command in the project's root directory.
Name | Description | roles |
---|---|---|
test-playbook | Test to ping managed node | ping-sample |
install-docker-playbook | Install Docker | docker-installer pip-installer |
-
SFTP ( OPTIONAL )