From 35fd9dd3ab90e729e99ede4784c4d8e789152243 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 5 Feb 2020 23:43:22 -0600 Subject: [PATCH] Basic MySQL configuration --- ec2.yml | 8 +++++++- roles/mysql/tasks/main.yml | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ec2.yml b/ec2.yml index 0a65dd5..c44932b 100755 --- a/ec2.yml +++ b/ec2.yml @@ -7,13 +7,19 @@ - user - hosts: tag_role_nextcloud vars: + mysql_root_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 62316565376333396465333931356163343363663063636233653536373033396230626639613964 + 3037613839373833646234626236643430393364643131610a333539373533663434373935376130 + 65323365313465316635646465376665616132653832316362363535366563363863636530313666 + 3036393134386131310a643734363261633166636263343538313533393738323934303137343163 + 39636637643035616236663364663562366133613233313139623937313531343564 acme_directory: "https://acme-staging-v02.api.letsencrypt.org/directory" acme_version: 2 nextcloud_tarbz2: "https://download.nextcloud.com/server/releases/nextcloud-18.0.0.tar.bz2" nextcloud_url: "nc.assburgers.club" nextcloud_webroot: "/var/www/nextcloud" roles: - - mysql - nextcloud - hosts: tag_role_cockpit roles: diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index cb4c41d..f3b11f5 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -15,4 +15,18 @@ name: mysql state: started enabled: true + - name: Update root password + mysql_user: + name: root + host: "{{ item }}" + password: "{{ mysql_root_password }}" + login_user: root + login_password: "{{ mysql_root_password }}" + check_implicit_admin: yes + priv: "*.*:ALL,GRANT" + loop: + - "{{ ansible_hostname }}" + - 127.0.0.1 + - ::1 + - localhost become: true