Compare commits

...

10 Commits

17 changed files with 100 additions and 57 deletions

View File

@ -118,6 +118,7 @@ This segment caters to professional productivity needs. It encompasses a range o
- **[PC Video Conference](./roles/pc-video-conference/)**: Video conferencing software setup. - **[PC Video Conference](./roles/pc-video-conference/)**: Video conferencing software setup.
- **[PC Nextcloud](./roles/pc-nextcloud/)**: Client setup for Nextcloud cloud storage service. - **[PC Nextcloud](./roles/pc-nextcloud/)**: Client setup for Nextcloud cloud storage service.
- **[PC GnuCash](./roles/pc-gnucash/)**: Software to manage finances - **[PC GnuCash](./roles/pc-gnucash/)**: Software to manage finances
- **[PC Jrnl](./roles/pc-jrnl/)**: CLI Journaling
#### Anonymization #### Anonymization
Focusing on privacy and security, the Anonymization section offers tools for secure file sharing and anonymous web browsing. It includes software solutions that prioritize user privacy, ensuring secure online activities and data protection. Focusing on privacy and security, the Anonymization section offers tools for secure file sharing and anonymous web browsing. It includes software solutions that prioritize user privacy, ensuring secure online activities and data protection.
@ -150,7 +151,7 @@ Focuses on web server roles and applications, covering SSL certificates, Nginx c
- **[Nginx-Homepage](./roles/nginx-homepage/)**: Configures a homepage for Nginx. - **[Nginx-Homepage](./roles/nginx-homepage/)**: Configures a homepage for Nginx.
- **[Nginx-Https](./roles/nginx-https/)**: Enables HTTPS configuration for Nginx. - **[Nginx-Https](./roles/nginx-https/)**: Enables HTTPS configuration for Nginx.
- **[Nginx-Matomo-Tracking](./roles/nginx-matomo-tracking/)**: Integrates Matomo tracking with Nginx. - **[Nginx-Matomo-Tracking](./roles/nginx-matomo-tracking/)**: Integrates Matomo tracking with Nginx.
- **[Nginx-Redirect](./roles/nginx-redirect/)**: Manages URL redirects in Nginx. - **[Nginx-Redirect](./roles/nginx-domain-redirect/)**: Manages URL redirects in Nginx.
- **[Certbot Nginx](./roles/certbot-nginx/)**: Integrates Certbot with Nginx for SSL certificates. - **[Certbot Nginx](./roles/certbot-nginx/)**: Integrates Certbot with Nginx for SSL certificates.
- **[Postfix](./roles/postfix/)**: Setup for the Postfix mail transfer agent. - **[Postfix](./roles/postfix/)**: Setup for the Postfix mail transfer agent.

View File

@ -15,6 +15,7 @@
become: true become: true
roles: roles:
- pc-office - pc-office
- pc-jrnl
- name: personal computer for business - name: personal computer for business
hosts: business_personal_computer hosts: business_personal_computer

View File

@ -24,7 +24,7 @@
hosts: redirect hosts: redirect
become: true become: true
roles: roles:
- role: nginx-redirect - role: nginx-domain-redirect
vars: vars:
domain_mappings: "{{redirect_domain_mappings}}" domain_mappings: "{{redirect_domain_mappings}}"

View File

@ -0,0 +1,47 @@
# Ansible Role: Docker-Discourse
This Ansible role sets up Discourse, a popular open-source discussion platform, using Docker containers. It is designed to automate the deployment and configuration process of Discourse, making it easier to maintain and update.
## Role Variables
- `docker_compose_instance_directory`: Specifies the directory for the Docker Compose instance of Discourse.
## Handlers
- `recreate discourse`: Rebuilds the Discourse application using the launcher script. Triggered when configuration changes are detected.
## Tasks
- Includes tasks from `nginx-docker-proxy-domain.yml`.
- Creates the specified `docker_compose_instance_directory`.
- Checks out the repository at the specified directory.
- Pulls the Discourse Docker repository and updates it.
- Sets permissions for the `containers` directory.
- Copies configuration to `containers/app.yml`.
## Template: app.yml.j2
- Configures the Discourse Docker container with necessary parameters such as database settings, environment variables, and volumes.
- Specifies SMTP settings for email functionality.
## Dependencies
- `nginx-docker-reverse-proxy`: This dependency is necessary for the reverse proxy setup for Discourse.
## Usage
To use this role, include it in your Ansible playbook and configure the necessary variables as per your requirements. Ensure that the dependencies are also resolved.
## Discussion and Contributions
For discussions, questions, and contributions related to this role, please refer to the corresponding discussion thread on [Discourse Meta](https://meta.discourse.org/).
## Notes
- This role is part of a larger playbook and is designed to work in conjunction with other roles.
- Ensure you have the necessary permissions and access to run Ansible scripts in your environment.
---
This README was generated with information provided in the Ansible role. For more detailed instructions and information, refer to the inline comments within the role files. Additional support and context for this role can be found in an [online chat discussion](https://chat.openai.com/share/fdbf9870-1f7e-491f-b4d2-357e6e8ad59c).

View File

@ -1,11 +1,4 @@
--- ---
#- name: recreate discourse
# command:
# cmd: docker-compose up -d --force-recreate
# chdir: "{{docker_compose_instance_directory}}"
# environment:
# COMPOSE_HTTP_TIMEOUT: 600
# DOCKER_CLIENT_TIMEOUT: 600
- name: recreate discourse - name: recreate discourse
command: command:
cmd: ./launcher rebuild app cmd: ./launcher rebuild app

View File

@ -8,10 +8,6 @@
state: directory state: directory
mode: 0755 mode: 0755
#- name: add docker-compose.yml
# template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml
# notify: recreate discourse
- name: register directory - name: register directory
stat: stat:
path: "{{docker_compose_instance_directory}}" path: "{{docker_compose_instance_directory}}"
@ -45,7 +41,7 @@
mode: '700' mode: '700'
state: directory state: directory
- name: "copy configuration {{docker_compose_instance_directory}}containers/app.yml" - name: "copy configuration to {{docker_compose_instance_directory}}containers/app.yml"
template: template:
src: app.yml.j2 src: app.yml.j2
dest: "{{docker_compose_instance_directory}}containers/app.yml" dest: "{{docker_compose_instance_directory}}containers/app.yml"

View File

@ -50,7 +50,7 @@ env:
## TODO: The domain name this Discourse instance will respond to ## TODO: The domain name this Discourse instance will respond to
## Required. Discourse will not work with a bare IP number. ## Required. Discourse will not work with a bare IP number.
DISCOURSE_HOSTNAME: localhost DISCOURSE_HOSTNAME: {{domain}}
## Uncomment if you want the container to be started with the same ## Uncomment if you want the container to be started with the same
## hostname (-h option) as specified above (default "$hostname-$config") ## hostname (-h option) as specified above (default "$hostname-$config")
@ -63,7 +63,7 @@ env:
## TODO: The SMTP mail server used to validate new accounts and send notifications ## TODO: The SMTP mail server used to validate new accounts and send notifications
# SMTP ADDRESS, username, and password are required # SMTP ADDRESS, username, and password are required
# WARNING the char '#' in SMTP password can cause problems! # WARNING the char '#' in SMTP password can cause problems!
DISCOURSE_SMTP_ADDRESS: {{system_email_domain}} DISCOURSE_SMTP_ADDRESS: {{system_email_host}}
DISCOURSE_SMTP_PORT: 587 DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: {{system_email}} DISCOURSE_SMTP_USER_NAME: {{system_email}}
DISCOURSE_SMTP_PASSWORD: {{system_email_password}} DISCOURSE_SMTP_PASSWORD: {{system_email_password}}
@ -85,7 +85,7 @@ env:
## The Docker container is stateless; all data is stored in /shared ## The Docker container is stateless; all data is stored in /shared
volumes: volumes:
- volume: - volume:
host: /var/discourse/shared/standalone host: discourse_application_data
guest: /shared guest: /shared
- volume: - volume:
host: /var/discourse/shared/standalone/log/var-log host: /var/discourse/shared/standalone/log/var-log

View File

@ -1,34 +0,0 @@
version: '3'
services:
discourse:
image: discourse/base:release
depends_on:
- database
- redis
volumes:
- data:/shared
environment:
DISCOURSE_DB_HOST: database
DISCOURSE_DB_NAME: discourse
DISCOURSE_DB_USERNAME: discourse
DISCOURSE_DB_PASSWORD: {{discourse_database_password}}
DISCOURSE_REDIS_HOST: redis
ports:
- "127.0.0.1:{{http_port}}:80"
database:
image: postgres:latest
environment:
POSTGRES_DB: discourse
POSTGRES_USER: discourse
POSTGRES_PASSWORD: {{discourse_database_password}}
volumes:
- database:/var/lib/postgresql/data
redis:
image: redis:latest
volumes:
- redis_data:/data
volumes:
database:
data:
redis_data:

View File

@ -1,7 +1,7 @@
--- ---
- name: "include tasks mybb-proxy-domain.yml" - name: "include tasks create-proxy-with-domain-replace.yml"
include_tasks: mybb-proxy-domain.yml include_tasks: create-proxy-with-domain-replace.yml
loop: "{{ domains + [mybb_main_domain] }}" loop: "{{ domains + [source_domain] }}"
loop_control: loop_control:
loop_var: domain loop_var: domain

View File

@ -3,4 +3,4 @@ docker_compose_instance_directory: "{{path_docker_compose_instances}}mybb/"
docker_compose_instance_confd_directory: "{{docker_compose_instance_directory}}conf.d/" docker_compose_instance_confd_directory: "{{docker_compose_instance_directory}}conf.d/"
docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf" docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf"
target_mount_conf_d_directory: "/etc/nginx/conf.d/" target_mount_conf_d_directory: "/etc/nginx/conf.d/"
mybb_main_domain: "mybb.{{top_domain}}" source_domain: "mybb.{{top_domain}}"

View File

@ -23,7 +23,8 @@ This Ansible role configures Nginx to perform 301 redirects from one domain to a
```yaml ```yaml
- hosts: servers - hosts: servers
roles: roles:
- { role: nginx-redirect, domain_mappings: [ {source: 'example.com', target: 'newdomain.com'} ] } - { role: nginx-domain-redirect, domain_mappings: [ {source: 'example.com', target: 'newdomain.com'} ] }
``````
## Author Information ## Author Information
This role was created in 2023 by Kevin Veen Birkenbach. This role was created in 2023 by Kevin Veen Birkenbach.

33
roles/pc-jrnl/README.md Normal file
View File

@ -0,0 +1,33 @@
# Jrnl Role for Ansible
## Overview
This role automates the installation of Jrnl, a simple and effective command-line journal application. It uses the `community.general.pacman` module for systems that support the Pacman package manager, ensuring that Jrnl is installed and up to date.
## Requirements
- Ansible 2.9 or higher.
- Access to Pacman package manager (commonly available on Arch Linux and derivatives).
## Role Variables
No additional role variables are needed for this role as it solely focuses on the installation of Jrnl.
## Dependencies
No external dependencies.
## Example Playbook
Including this role in your playbook is straightforward. Simply add the role to your playbook's roles section:
```yaml
- hosts: all
roles:
- pc-jrnl
```
## Additional Information
For more detailed information on Jrnl and its functionalities, visit [Jrnl's official documentation](https://jrnl.sh/).
## Contributing
Contributions to this role are welcome. Please adhere to standard coding conventions and best practices.
## More Information
This role was created as part of a larger playbook. For more context on this role, you can refer to the related ChatGPT conversation [here](https://chat.openai.com/share/ae168ca0-5191-4bec-96a0-ffcfabca0024).

View File

@ -0,0 +1,5 @@
- name: install jrnl
community.general.pacman:
name:
- jrnl
state: present

View File

@ -4,4 +4,4 @@
- name: "include task create-domain-conf.yml" - name: "include task create-domain-conf.yml"
include_tasks: create-domain-conf.yml include_tasks: create-domain-conf.yml
vars: vars:
nginx_docker_reverse_proxy_extra_configuration: "sub_filter '{{mybb_main_domain}}' '{{domain}}';" nginx_docker_reverse_proxy_extra_configuration: "sub_filter '{{source_domain}}' '{{domain}}';"