aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rss.jinwei.me/config/roles/rss')
-rw-r--r--rss.jinwei.me/config/roles/rss/defaults/main.yaml1
-rw-r--r--rss.jinwei.me/config/roles/rss/tasks/main.yaml49
-rw-r--r--rss.jinwei.me/config/roles/rss/templates/Dockerfile.rssbot.j212
3 files changed, 0 insertions, 62 deletions
diff --git a/rss.jinwei.me/config/roles/rss/defaults/main.yaml b/rss.jinwei.me/config/roles/rss/defaults/main.yaml
deleted file mode 100644
index 28f1f39..0000000
--- a/rss.jinwei.me/config/roles/rss/defaults/main.yaml
+++ /dev/null
@@ -1 +0,0 @@
1rss_home: /opt/rss
diff --git a/rss.jinwei.me/config/roles/rss/tasks/main.yaml b/rss.jinwei.me/config/roles/rss/tasks/main.yaml
deleted file mode 100644
index f62c897..0000000
--- a/rss.jinwei.me/config/roles/rss/tasks/main.yaml
+++ /dev/null
@@ -1,49 +0,0 @@
1- name: install packages
2 apt:
3 name:
4 - python3-pymysql
5 update_cache: true
6
7- name: create rss database if not exists
8 community.mysql.mysql_db:
9 login_host: "{{ lookup('aws_ssm', '/jinwei-me/mysql/host') }}"
10 login_port: "{{ lookup('aws_ssm', '/jinwei-me/mysql/port') }}"
11 login_user: "{{ lookup('aws_ssm', '/jinwei-me/mysql/username') }}"
12 login_password: "{{ lookup('aws_ssm', '/jinwei-me/mysql/password') }}"
13 name: "{{ lookup('aws_ssm', '/jinwei-me/mysql/rss_db_name') }}"
14 state: present
15
16- name: create rss database user
17 community.mysql.mysql_user:
18 login_host: "{{ lookup('aws_ssm', '/jinwei-me/mysql/host') }}"
19 login_port: "{{ lookup('aws_ssm', '/jinwei-me/mysql/port') }}"
20 login_user: "{{ lookup('aws_ssm', '/jinwei-me/mysql/username') }}"
21 login_password: "{{ lookup('aws_ssm', '/jinwei-me/mysql/password') }}"
22 name: "{{ lookup('aws_ssm', '/jinwei-me/mysql/rss_db_user') }}"
23 host: "%"
24 password: "{{ lookup('aws_ssm', '/jinwei-me/mysql/rss_user_password') }}"
25 priv: "{{ lookup('aws_ssm', '/jinwei-me/mysql/rss_db_name') }}.*:ALL"
26 state: present
27
28- name: create rss_home
29 file:
30 path: "{{ rss_home }}"
31 state: directory
32
33- name: render Dockerfile.rssbot
34 template:
35 src: Dockerfile.rssbot.j2
36 dest: "{{ rss_home }}/Dockerfile.rssbot"
37 mode: 0644
38
39- name: render docker-compose
40 template:
41 src: docker-compose.yaml.j2
42 dest: "{{ rss_home }}/docker-compose.yaml"
43 mode: 0644
44
45- name: Start rss toolchain using docker-compose
46 community.docker.docker_compose:
47 project_name: rss
48 project_src: "{{ rss_home }}"
49 register: output
diff --git a/rss.jinwei.me/config/roles/rss/templates/Dockerfile.rssbot.j2 b/rss.jinwei.me/config/roles/rss/templates/Dockerfile.rssbot.j2
deleted file mode 100644
index f7eab63..0000000
--- a/rss.jinwei.me/config/roles/rss/templates/Dockerfile.rssbot.j2
+++ /dev/null
@@ -1,12 +0,0 @@
1FROM alpine:3.17
2
3ENV VERSION={{ lookup('aws_ssm', '/jinwei-me/tgbot/version') }}
4ENV TOKEN ""
5
6WORKDIR /app
7
8ADD https://github.com/iovxw/rssbot/releases/download/${VERSION}/rssbot-en-x86_64-unknown-linux-musl /app/rssbot
9
10RUN chmod +x /app/rssbot
11
12CMD ["sh", "-c", "./rssbot ${TOKEN}"]
Powered by cgit v1.2.3 (git 2.41.0)