From 19ed8f7f42390595b92cb3734831957673ea1614 Mon Sep 17 00:00:00 2001 From: Simon Zernisch Date: Tue, 13 Jun 2023 23:43:35 +0200 Subject: [PATCH] added stirling_pdf role --- hosts.yml | 3 +++ main.yml | 9 +++++++- roles/stirling_pdf/defaults/main.yml | 6 +++++ roles/stirling_pdf/tasks/main.yml | 33 ++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 roles/stirling_pdf/defaults/main.yml create mode 100644 roles/stirling_pdf/tasks/main.yml diff --git a/hosts.yml b/hosts.yml index 8c60cf4..41f0ed5 100644 --- a/hosts.yml +++ b/hosts.yml @@ -25,5 +25,8 @@ all: hosts: 10.11.12.35: chatpad_hosts: + hosts: + 10.11.12.35: + stirling_pdf_hosts: hosts: 10.11.12.35: \ No newline at end of file diff --git a/main.yml b/main.yml index e9b2724..c2c58fe 100644 --- a/main.yml +++ b/main.yml @@ -76,4 +76,11 @@ become: true roles: - chatpad - tags: chatpad \ No newline at end of file + tags: chatpad + +- name: Configure Stirling-PDF + hosts: stirling_pdf_hosts + become: true + roles: + - stirling_pdf + tags: stirling_pdf \ No newline at end of file diff --git a/roles/stirling_pdf/defaults/main.yml b/roles/stirling_pdf/defaults/main.yml new file mode 100644 index 0000000..089af81 --- /dev/null +++ b/roles/stirling_pdf/defaults/main.yml @@ -0,0 +1,6 @@ +stirling_pdf_folder: + - config + - data + +stirling_pdf_locale: de_DE +stirling_pdf_google_visibility: false \ No newline at end of file diff --git a/roles/stirling_pdf/tasks/main.yml b/roles/stirling_pdf/tasks/main.yml new file mode 100644 index 0000000..53eacfc --- /dev/null +++ b/roles/stirling_pdf/tasks/main.yml @@ -0,0 +1,33 @@ +--- +- name: Create Stirling-PDF directories if they do not exist + become: false + ansible.builtin.file: + path: /home/{{ system_user_name }}/docker/stirling_pdf/{{ item }} + state: directory + mode: '0755' + loop: '{{ stirling_pdf_folder }}' + +- name: Create docker network 'proxy' + community.docker.docker_network: + name: proxy + +- name: Create Stirling-PDF Container + community.docker.docker_container: + name: stirling-pdf + image: 'frooodle/s-pdf:latest' + pull: yes + state: started + restart_policy: unless-stopped + ports: + - '11006:8080' + env: + APP_LOCALE: "{{ stirling_pdf_locale }}" + APP_HOME_NAME: "{{ stirling_pdf_name }}" + APP_HOME_DESCRIPTION: "{{ stirling_pdf_description }}" + APP_NAVBAR_NAME: "{{ stirling_pdf_name }}" + APP_ROOT_PATH: / + ALLOW_GOOGLE_VISIBILITY: "{{ stirling_pdf_google_visibility | bool }}" + volumes: + - /home/{{ system_user_name }}/docker/stirling_pdf/config:/configs + networks: + - name: proxy \ No newline at end of file