From cf47ba5c10f81a07883c06a6992a0f0790ded97e Mon Sep 17 00:00:00 2001 From: Sarath037 <114940309+Sarath037@users.noreply.github.com> Date: Wed, 7 Dec 2022 12:51:48 +0530 Subject: [PATCH 1/7] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index bf476a2..348152e 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "

Hello World app! Version 3

" + return "

Hello World app! Version 1

" if __name__ == "__main__": app.run(host='0.0.0.0',port=5000) From 8df0d132e08c52feb8aad6e8d55b7c6b18d023df Mon Sep 17 00:00:00 2001 From: Sarath037 <114940309+Sarath037@users.noreply.github.com> Date: Wed, 7 Dec 2022 13:33:37 +0530 Subject: [PATCH 2/7] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 348152e..7154aef 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "

Hello World app! Version 1

" + return "

Hello World app! Version 2

" if __name__ == "__main__": app.run(host='0.0.0.0',port=5000) From 3d9e55b0e0ac7885e96638fe4167037a69e1f877 Mon Sep 17 00:00:00 2001 From: Sarath037 <114940309+Sarath037@users.noreply.github.com> Date: Wed, 7 Dec 2022 16:40:12 +0530 Subject: [PATCH 3/7] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 7154aef..bf476a2 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "

Hello World app! Version 2

" + return "

Hello World app! Version 3

" if __name__ == "__main__": app.run(host='0.0.0.0',port=5000) From 655e1cec57b3d2f135b048e6f4477d1302222fc1 Mon Sep 17 00:00:00 2001 From: Sarath037 <114940309+Sarath037@users.noreply.github.com> Date: Thu, 8 Dec 2022 08:22:59 +0530 Subject: [PATCH 4/7] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index bf476a2..7154aef 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "

Hello World app! Version 3

" + return "

Hello World app! Version 2

" if __name__ == "__main__": app.run(host='0.0.0.0',port=5000) From fd5e68c170bfdf7679c63bba6a398ae81669f5b7 Mon Sep 17 00:00:00 2001 From: Sarath037 <114940309+Sarath037@users.noreply.github.com> Date: Thu, 8 Dec 2022 08:28:05 +0530 Subject: [PATCH 5/7] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 7154aef..bf476a2 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "

Hello World app! Version 2

" + return "

Hello World app! Version 3

" if __name__ == "__main__": app.run(host='0.0.0.0',port=5000) From 3cc51923f70b2f95e2961dfecb161cd96a2a96fb Mon Sep 17 00:00:00 2001 From: Sarath037 <114940309+Sarath037@users.noreply.github.com> Date: Thu, 8 Dec 2022 08:40:03 +0530 Subject: [PATCH 6/7] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index bf476a2..348152e 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "

Hello World app! Version 3

" + return "

Hello World app! Version 1

" if __name__ == "__main__": app.run(host='0.0.0.0',port=5000) From 771fa86b30fa893716ba2bc1047e4f7a5b8d12df Mon Sep 17 00:00:00 2001 From: sarath Date: Thu, 15 Dec 2022 13:51:05 +0000 Subject: [PATCH 7/7] mysql install --- .gitignore | 1 + hosts | 2 ++ main.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .gitignore create mode 100644 hosts create mode 100644 main.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ff331c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hosts diff --git a/hosts b/hosts new file mode 100644 index 0000000..71cbef1 --- /dev/null +++ b/hosts @@ -0,0 +1,2 @@ +[amazon] +172.31.6.202 ansible_user="ec2-user" ansible_port=22 ansible_ssh_private_key_file="/home/ec2-user/test.pem" diff --git a/main.yml b/main.yml new file mode 100644 index 0000000..a4f3abf --- /dev/null +++ b/main.yml @@ -0,0 +1,58 @@ +--- +- name: "managing mariadb" + become: true + hosts: all + vars: + packages: + - mariadb-server + - MySQL-python + mysql_root_passwd: "mysql@123" + mysql_extra_usr: "sarath" + mysql_extra_usr_paswd: "sarath@123" + mysql_extra_database: "saradb" + tasks: + - name: "installing mariadb" + yum: + name: "{{ packages }}" + state: present + - name: "Restart/enable mariadb" + service: + name: mariadb + state: restarted + enabled: true + - name: "set root passwd" + ignore_errors: true + mysql_user: + login_user: "root" + login_password: "" + user: "root" + password: "{{ mysql_root_passwd }}" + host_all: true + - name: "removing anonymous users" + mysql_user: + login_user: "root" + user: "" + login_password: "{{ mysql_root_passwd }}" + host_all: true + state: absent + - name: "create data base" + mysql_db: + login_user: "root" + login_password: "{{ mysql_root_passwd }}" + name: "{{ mysql_extra_database }}" + state: present + - name: "removing test database" + mysql_db: + login_user: "root" + login_password: "{{ mysql_root_passwd }}" + name: test + state: absent + - name: "create extra user" + mysql_user: + login_user: "root" + login_password: "{{ mysql_root_passwd }}" + user: "{{ mysql_extra_usr }}" + password: "{{ mysql_extra_usr_paswd }}" + priv: '{{ mysql_extra_database }}.*:ALL' + host: "%" + state: present