Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-1 #7

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading