Skip to content

Commit

Permalink
Merge pull request #7 from Otus-DevOps-2023-05/ansible-1
Browse files Browse the repository at this point in the history
ansible-1
  • Loading branch information
c3ntik authored Oct 9, 2023
2 parents 41c04cb + 3a440ea commit 53347bf
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[defaults]
inventory = ./inventory.json
remote_user = ubuntu
private_key_file = ~/.ssh/otus.pub
host_key_checking = False
retry_files_enabled = False
8 changes: 8 additions & 0 deletions ansible/clone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Clone
hosts: app
tasks:
- name: Clone repo
git:
repo: https://github.com/express42/reddit.git
dest: /home/ubuntu/red2
4 changes: 4 additions & 0 deletions ansible/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[app]
appserver ansible_host=158.160.107.84
[db]
dbserver ansible_host=158.160.50.213
16 changes: 16 additions & 0 deletions ansible/inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"all":{
"children":{
"app":{
"hosts":{
"appserver":"158.160.107.84"
},
"db":{
"hosts":{
"db":"51.250.73.164"
}
}
}
}
}
}
9 changes: 9 additions & 0 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
app:
hosts:
appserver:
ansible_host: 158.160.107.84

db:
hosts:
dbserver:
ansible_host: 158.160.50.213
1 change: 1 addition & 0 deletions ansible/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible>=2.4

0 comments on commit 53347bf

Please sign in to comment.