This commit is contained in:
David Lopez 2023-07-25 12:51:47 +02:00
parent 2644c4b027
commit 536c808bd7
7 changed files with 27 additions and 60 deletions

0
hola
View File

22
hosts
View File

@ -28,4 +28,24 @@ mongo2
[verdnatura_servers]
docker ansible_host=10.0.6.116
docker ansible_host=10.0.6.116
mox1 ansible_host=10.24.1.1
mox2 ansible_host=10.24.1.2
mox3 ansible_host=10.24.1.3
mox4 ansible_host=10.24.1.4
mox5 ansible_host=10.24.1.5
ve3 ansible_host=10.24.2.3
ve4 ansible_host=10.24.2.4
ve5 ansible_host=10.24.2.5
vcenter ansible_host=10.24.2.255
mox1-ilo ansible_host=10.24.3.1
mox2-ilo ansible_host=10.24.3.2
mox3-ilo ansible_host=10.24.3.3
mox4-ilo ansible_host=10.24.3.4
mox5-ilo ansible_host=10.24.3.5
ve3-ilo ansible_host=10.24.4.3
ve4-ilo ansible_host=10.24.4.4
ve5-ilo ansible_host=10.24.4.5
mox91 ansible_host=10.29.1.91
mox92 ansible_host=10.29.1.92
mox93 ansible_host=10.29.1.93

6
ping/ping.yml Normal file
View File

@ -0,0 +1,6 @@
---
- hosts: all
gather_facts: false
tasks:
- ping:

View File

@ -1,14 +0,0 @@
---
- name: Install WordPress, MySQL, Nginx, and PHP-FPM
hosts: all
remote_user: root
# remote_user: user
# become: yes
# become_method: sudo
roles:
- common
- mysql
- nginx
- php-fpm
- wordpress

View File

@ -1,14 +0,0 @@
---
- hosts: webservers #modify your server list
remote_user: root
tasks:
- include_vars: users.yml
- name: Creating users to Jump Server
user: name="{{ item.username}}"
with_items: "{{ users }}"
- name: Placing SSH Key to Authorized Key
#please note that this code assumes as if the public-private key pair is generated, all public users (created above) have public keys copied at one place i.e. keyfiles directory for the ease
authorized_key: user="{{item.username}}" key="{{ lookup('file', './keyfiles/authorized_keys.{{ item.username}}.pub')}}"
with_items: "{{ users }}"

View File

@ -1,14 +0,0 @@
---
- name: Install WordPress, MySQL, Nginx, and PHP-FPM
hosts: all
remote_user: root
# remote_user: user
# become: yes
# become_method: sudo
roles:
- common
- mysql
- nginx
- php-fpm
- wordpress

View File

@ -1,17 +0,0 @@
---
# The playbook creates a new database test and populates data in the database to test the sharding.
- hosts: $servername
remote_user: root
tasks:
- name: Create a new database and user
mongodb_user: login_user=admin login_password=${mongo_admin_pass} login_port=${mongos_port} database=test user=admin password=${mongo_admin_pass} state=present
- name: Pause for the user to get created and replicated
pause: minutes=3
- name: Execute the collection creation script
command: /usr/bin/mongo localhost:${mongos_port}/test -u admin -p ${mongo_admin_pass} /tmp/testsharding.js
- name: Enable sharding on the database and collection
command: /usr/bin/mongo localhost:${mongos_port}/admin -u admin -p ${mongo_admin_pass} /tmp/enablesharding.js