Last active
November 5, 2022 02:30
-
-
Save wagnerbianchijr/d9a3ae8db80fd5a9c92e328aa6e281b4 to your computer and use it in GitHub Desktop.
Ansible-AWS-MariaDB (roles execution)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[BIANCHI LABS - ansible] ansible@jumphost: roles $ ansible-playbook bianchi-aws-bootstrap/bianchi-aws-bootstrap.yml | |
PLAY [localhost] **************************************************************************************************************************** | |
TASK [Gathering Facts] ********************************************************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Creating a new VPC] ******************************************************************************************* | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Setting the VPC ID fact] ************************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Creating the IGW (Internet Gateway)] ************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Setting new fact for the Internet Gateway] ******************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Associating a subnet to the VPC] ****************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Setting new fact for the SBT ID] ****************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Route IGW] **************************************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Creating the Security Group] ********************************************************************************** | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Setting facts for the new Security Group created] ************************************************************* | |
ok: [localhost] | |
TASK [bianchi-aws-bootstrap : Creating EC2 instances for MariaDB Servers ([dbserver01])] **************************************************** | |
changed: [localhost] | |
TASK [bianchi-aws-bootstrap : Add host to a temp inventory] ********************************************************************************* | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-194.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-03d76227bb5f8bc36'}}, u'key_name': u'ansible', u'public_ip': u'18.231.117.174', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.194', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-231-117-174.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-0fb4f9ddf0e207624', u'tags': {u'Name': u'dbserver01'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-231-117-174.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:23:16.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adding the dbservers to the static inventory file ([dbservers])] ********************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-194.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-03d76227bb5f8bc36'}}, u'key_name': u'ansible', u'public_ip': u'18.231.117.174', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.194', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-231-117-174.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-0fb4f9ddf0e207624', u'tags': {u'Name': u'dbserver01'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-231-117-174.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:23:16.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adjusting the local DNS] ************************************************************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-194.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-03d76227bb5f8bc36'}}, u'key_name': u'ansible', u'public_ip': u'18.231.117.174', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.194', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-231-117-174.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-0fb4f9ddf0e207624', u'tags': {u'Name': u'dbserver01'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-231-117-174.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:23:16.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Creating EC2 instances for MariaDB Servers ([dbserver02])] **************************************************** | |
changed: [localhost] | |
TASK [bianchi-aws-bootstrap : Add host to a temp inventory] ********************************************************************************* | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-253.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-0d782dbe5a91f1958'}}, u'key_name': u'ansible', u'public_ip': u'18.228.14.156', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.253', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-228-14-156.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-018c81f2b8bd432c8', u'tags': {u'Name': u'dbserver02'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-228-14-156.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:23:41.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adding the dbservers to the static inventory file ([dbservers])] ********************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-253.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-0d782dbe5a91f1958'}}, u'key_name': u'ansible', u'public_ip': u'18.228.14.156', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.253', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-228-14-156.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-018c81f2b8bd432c8', u'tags': {u'Name': u'dbserver02'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-228-14-156.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:23:41.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adjusting the local DNS] ************************************************************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-253.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-0d782dbe5a91f1958'}}, u'key_name': u'ansible', u'public_ip': u'18.228.14.156', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.253', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-228-14-156.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-018c81f2b8bd432c8', u'tags': {u'Name': u'dbserver02'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-228-14-156.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:23:41.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Creating EC2 instances for MariaDB Servers ([dbserver03])] **************************************************** | |
changed: [localhost] | |
TASK [bianchi-aws-bootstrap : Add host to a temp inventory] ********************************************************************************* | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-19.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-04d04eb36b01838a6'}}, u'key_name': u'ansible', u'public_ip': u'18.229.133.184', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.19', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-229-133-184.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-0225ab1aac3bf7944', u'tags': {u'Name': u'dbserver03'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-229-133-184.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:24:05.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adding the dbservers to the static inventory file ([dbservers])] ********************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-19.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-04d04eb36b01838a6'}}, u'key_name': u'ansible', u'public_ip': u'18.229.133.184', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.19', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-229-133-184.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-0225ab1aac3bf7944', u'tags': {u'Name': u'dbserver03'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-229-133-184.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:24:05.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adjusting the local DNS] ************************************************************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-19.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-04d04eb36b01838a6'}}, u'key_name': u'ansible', u'public_ip': u'18.229.133.184', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.19', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-229-133-184.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-0225ab1aac3bf7944', u'tags': {u'Name': u'dbserver03'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-229-133-184.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:24:05.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Creating an EC2 instance for MariaDB MaxScale] **************************************************************** | |
^@changed: [localhost] | |
TASK [bianchi-aws-bootstrap : Add hosts to a temp inventory] ******************************************************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-4.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-020e67f6e11d26680'}}, u'key_name': u'ansible', u'public_ip': u'18.229.125.85', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.4', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-229-125-85.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-092510e919f094a53', u'tags': {u'Name': u'mxserver01'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-229-125-85.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:24:30.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adding the mxserver to the static inventory file] ************************************************************* | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-4.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-020e67f6e11d26680'}}, u'key_name': u'ansible', u'public_ip': u'18.229.125.85', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.4', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-229-125-85.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-092510e919f094a53', u'tags': {u'Name': u'mxserver01'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-229-125-85.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:24:30.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
TASK [bianchi-aws-bootstrap : Adjusting the local DNS] ************************************************************************************** | |
changed: [localhost] => (item={u'ramdisk': None, u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-1-4.sa-east-1.compute.internal', u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-020e67f6e11d26680'}}, u'key_name': u'ansible', u'public_ip': u'18.229.125.85', u'image_id': u'ami-0102667d2046392a0', u'tenancy': u'default', u'private_ip': u'10.0.1.4', u'groups': {u'sg-07e0a14d45763a6da': u'DBDMZ'}, u'public_dns_name': u'ec2-18-229-125-85.sa-east-1.compute.amazonaws.com', u'state_code': 16, u'id': u'i-092510e919f094a53', u'tags': {u'Name': u'mxserver01'}, u'placement': u'sa-east-1a', u'ami_launch_index': u'0', u'dns_name': u'ec2-18-229-125-85.sa-east-1.compute.amazonaws.com', u'region': u'sa-east-1', u'ebs_optimized': False, u'launch_time': u'2019-11-22T00:24:30.000Z', u'instance_type': u't2.micro', u'state': u'running', u'architecture': u'x86_64', u'hypervisor': u'xen', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1'}) | |
PLAY RECAP ********************************************************************************************************************************** | |
localhost : ok=26 changed=16 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
------------- | |
[BIANCHI LABS - ansible] ansible@jumphost: roles $ ansible-playbook bianchi-aws-dbservers/bianchi-aws-dbservers.yml | |
PLAY [dbservers] **************************************************************************************************************************** | |
TASK [Gathering Facts] ********************************************************************************************************************** | |
ok: [dbserver03] | |
ok: [dbserver02] | |
ok: [dbserver01] | |
TASK [bianchi-aws-dbservers : Setting the motd per customer] ******************************************************************************** | |
changed: [dbserver02] | |
changed: [dbserver03] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : Setup the Epel-Release repo] ********************************************************************************** | |
changed: [dbserver02] | |
changed: [dbserver03] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : Adding the MariaDB Official Repository] *********************************************************************** | |
changed: [dbserver02] | |
changed: [dbserver03] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : Adding needed packages] *************************************************************************************** | |
changed: [dbserver02] | |
changed: [dbserver03] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : Setting up the MariaDB Packages] ****************************************************************************** | |
^@changed: [dbserver03] | |
changed: [dbserver01] | |
changed: [dbserver02] | |
TASK [bianchi-aws-dbservers : Adding Database Servers configuration files] ****************************************************************** | |
changed: [dbserver03] | |
changed: [dbserver02] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : Adjusting users bash_profile] ********************************************************************************* | |
changed: [dbserver03] => (item={u'path': u'/root/', u'name': u'root'}) | |
changed: [dbserver01] => (item={u'path': u'/root/', u'name': u'root'}) | |
changed: [dbserver02] => (item={u'path': u'/root/', u'name': u'root'}) | |
changed: [dbserver03] => (item={u'path': u'/home/ec2-user/', u'name': u'ec2-user'}) | |
changed: [dbserver01] => (item={u'path': u'/home/ec2-user/', u'name': u'ec2-user'}) | |
changed: [dbserver02] => (item={u'path': u'/home/ec2-user/', u'name': u'ec2-user'}) | |
TASK [bianchi-aws-dbservers : Retsarting and reloading the mariadb.service deamon] ********************************************************** | |
changed: [dbserver01] | |
changed: [dbserver03] | |
changed: [dbserver02] | |
TASK [bianchi-aws-dbservers : Moving up users definitions on Master database server ([dbserver01])] **************************************** | |
skipping: [dbserver03] | |
skipping: [dbserver02] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : Creating user on the Master datababe server ([dbserver01])] *************************************************** | |
skipping: [dbserver03] | |
skipping: [dbserver02] | |
changed: [dbserver01] | |
TASK [bianchi-aws-dbservers : debug] ******************************************************************************************************** | |
ok: [dbserver03] => { | |
"msg": { | |
"changed": false, | |
"skip_reason": "Conditional result was False", | |
"skipped": true | |
} | |
} | |
ok: [dbserver02] => { | |
"msg": { | |
"changed": false, | |
"skip_reason": "Conditional result was False", | |
"skipped": true | |
} | |
} | |
ok: [dbserver01] => { | |
"msg": { | |
"changed": true, | |
"cmd": "mysql < /root/mariadb_users_definition.sql -vvv", | |
"delta": "0:00:00.026201", | |
"end": "2019-11-22 00:29:10.082077", | |
"failed": false, | |
"rc": 0, | |
"start": "2019-11-22 00:29:10.055876", | |
"stderr": "", | |
"stderr_lines": [], | |
"stdout": "--------------\nCREATE USER mariadb@'10.0.%' IDENTIFIED BY '123'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT RELOAD, REPLICATION SLAVE ON *.* TO mariadb@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nCREATE USER 'maxusr'@'10.0.%' IDENTIFIED BY '123'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT SELECT ON mysql.user TO 'maxusr'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT SELECT ON mysql.db TO 'maxusr'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT SELECT ON mysql.tables_priv TO 'maxusr'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT SHOW DATABASES ON *.* TO 'maxusr'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT SELECT ON mysql.roles_mapping TO maxusr@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nCREATE USER 'maxmon'@'10.0.%' IDENTIFIED BY '321'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT SELECT ON mysql.user TO 'maxmon'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT RELOAD, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'maxmon'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\n--------------\nGRANT CREATE, SELECT, UPDATE, INSERT, DELETE ON maxscale_schema.* TO 'maxmon'@'10.0.%'\n--------------\n\nQuery OK, 0 rows affected (0.000 sec)\n\nBye", | |
"stdout_lines": [ | |
"--------------", | |
"CREATE USER mariadb@'10.0.%' IDENTIFIED BY '123'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT RELOAD, REPLICATION SLAVE ON *.* TO mariadb@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"CREATE USER 'maxusr'@'10.0.%' IDENTIFIED BY '123'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT SELECT ON mysql.user TO 'maxusr'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT SELECT ON mysql.db TO 'maxusr'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT SELECT ON mysql.tables_priv TO 'maxusr'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT SHOW DATABASES ON *.* TO 'maxusr'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT SELECT ON mysql.roles_mapping TO maxusr@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"CREATE USER 'maxmon'@'10.0.%' IDENTIFIED BY '321'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT SELECT ON mysql.user TO 'maxmon'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT RELOAD, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'maxmon'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"--------------", | |
"GRANT CREATE, SELECT, UPDATE, INSERT, DELETE ON maxscale_schema.* TO 'maxmon'@'10.0.%'", | |
"--------------", | |
"", | |
"Query OK, 0 rows affected (0.000 sec)", | |
"", | |
"Bye" | |
] | |
} | |
} | |
TASK [bianchi-aws-dbservers : Getting the Master database server's private ip ([dbserver01])] *********************************************** | |
skipping: [dbserver03] | |
skipping: [dbserver02] | |
ok: [dbserver01] | |
TASK [bianchi-aws-dbservers : Setting up replication on dbserver02] ************************************************************************* | |
skipping: [dbserver03] | |
skipping: [dbserver01] | |
changed: [dbserver02] | |
TASK [bianchi-aws-dbservers : Start replication on dbserver02] ****************************************************************************** | |
skipping: [dbserver03] | |
skipping: [dbserver01] | |
changed: [dbserver02] | |
TASK [bianchi-aws-dbservers : Setting up replication on dbserver03] ************************************************************************* | |
skipping: [dbserver02] | |
skipping: [dbserver01] | |
changed: [dbserver03] | |
TASK [bianchi-aws-dbservers : Start replication on dbserver03] ****************************************************************************** | |
skipping: [dbserver02] | |
skipping: [dbserver01] | |
changed: [dbserver03] | |
PLAY RECAP ********************************************************************************************************************************** | |
dbserver01 : ok=13 changed=10 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0 | |
dbserver02 : ok=12 changed=10 unreachable=0 failed=0 skipped=5 rescued=0 ignored=0 | |
dbserver03 : ok=12 changed=10 unreachable=0 failed=0 skipped=5 rescued=0 ignored=0 | |
----------------- | |
[BIANCHI LABS - ansible] ansible@jumphost: roles $ ansible-playbook bianchi-aws-mxservers/bianchi-aws-mxservers.yml | |
PLAY [mxservers] **************************************************************************************************************************** | |
TASK [Gathering Facts] ********************************************************************************************************************** | |
ok: [mxserver01] | |
TASK [bianchi-aws-mxservers : Setting the motd per customer] ******************************************************************************** | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Adjusting users bash_profile] ********************************************************************************* | |
changed: [mxserver01] => (item={u'path': u'/root/', u'name': u'root'}) | |
changed: [mxserver01] => (item={u'path': u'/home/ec2-user/', u'name': u'ec2-user'}) | |
TASK [bianchi-aws-mxservers : Setup the Epel-Release repo] ********************************************************************************** | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Adding the MariaDB Official Repository] *********************************************************************** | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Adding needed packages] *************************************************************************************** | |
^@changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Setting up the MariaDB MaxScale Packages] ********************************************************************* | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Executing the maxkeys] **************************************************************************************** | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Changing the ownership of the .secrets file] ****************************************************************** | |
ok: [mxserver01] | |
TASK [bianchi-aws-mxservers : debug] ******************************************************************************************************** | |
ok: [mxserver01] => { | |
"msg": [ | |
"Generating .secrets file in /var/lib/maxscale." | |
] | |
} | |
TASK [bianchi-aws-mxservers : Executing the maxpasswd for users (maxusr)] ******************************************************************* | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : debug] ******************************************************************************************************** | |
ok: [mxserver01] => { | |
"msg": "18A7D54E56F4DD7A24B7D86B66646A45" | |
} | |
TASK [bianchi-aws-mxservers : Executing the maxpasswd for users (mariadb)] ****************************************************************** | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : debug] ******************************************************************************************************** | |
ok: [mxserver01] => { | |
"msg": "18A7D54E56F4DD7A24B7D86B66646A45" | |
} | |
TASK [bianchi-aws-mxservers : Executing the maxpasswd for users (maxmon)] ******************************************************************* | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : debug] ******************************************************************************************************** | |
ok: [mxserver01] => { | |
"msg": "D38C28286869FBFE880596AB5D027ED1" | |
} | |
TASK [bianchi-aws-mxservers : Adding Database Servers configuration files] ****************************************************************** | |
changed: [mxserver01] | |
TASK [bianchi-aws-mxservers : Restarting and reloading the maxscale.service deamon] ********************************************************* | |
changed: [mxserver01] | |
PLAY RECAP ********************************************************************************************************************************** | |
mxserver01 : ok=18 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment