From 16145f12002624f098be35b4108d38d9d23146df Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Mon, 12 Dec 2022 10:58:43 -0800 Subject: config: start rss stack using docker-compose --- rss.jinwei.me/config/roles/rss/tasks/main.yaml | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'rss.jinwei.me/config/roles/rss/tasks') diff --git a/rss.jinwei.me/config/roles/rss/tasks/main.yaml b/rss.jinwei.me/config/roles/rss/tasks/main.yaml index 16091cb..070c48e 100644 --- a/rss.jinwei.me/config/roles/rss/tasks/main.yaml +++ b/rss.jinwei.me/config/roles/rss/tasks/main.yaml @@ -1,3 +1,35 @@ +- name: install packages + apt: + name: + - python3-pymysql + update_cache: true + +- name: create ttrss database if not exists + community.mysql.mysql_db: + login_host: "{{ lookup('aws_ssm', '/jinwei-me/mysql/host') }}" + login_port: "{{ lookup('aws_ssm', '/jinwei-me/mysql/port') }}" + login_user: "{{ lookup('aws_ssm', '/jinwei-me/mysql/username') }}" + login_password: "{{ lookup('aws_ssm', '/jinwei-me/mysql/password') }}" + name: "{{ lookup('aws_ssm', '/jinwei-me/mysql/ttrss_db_name') }}" + state: present + +- name: create ttrss database user + community.mysql.mysql_user: + login_host: "{{ lookup('aws_ssm', '/jinwei-me/mysql/host') }}" + login_port: "{{ lookup('aws_ssm', '/jinwei-me/mysql/port') }}" + login_user: "{{ lookup('aws_ssm', '/jinwei-me/mysql/username') }}" + login_password: "{{ lookup('aws_ssm', '/jinwei-me/mysql/password') }}" + name: "{{ lookup('aws_ssm', '/jinwei-me/mysql/ttrss_db_user') }}" + host: "*" + password: "{{ lookup('aws_ssm', '/jinwei-me/mysql/ttrss_db_password') }}" + priv: "{{ lookup('aws_ssm', '/jinwei-me/mysql/ttrss_db_name') }}.*:ALL" + state: present + +- name: create rss_home + file: + path: "{{ rss_home }}" + state: directory + - name: render Dockerfile.rssbot template: src: Dockerfile.rssbot.j2 -- cgit v1.2.3